3 ms·
The point is to pad the time to a random amount, not by a random amount. If a particular function by design needs to have a throughput of at least 100 requests
by PeterisP 12y ago
The point is to pad the time to a random amount, not by a random amount.
If a particular function by design needs to have a throughput of at least 100 requests/sec, then you ensure that it has a throughput of exactly 100 rq/sec by calculating the response and then busywaiting until 10ms has elapsed - no matter if the actually neccessary things took 1 or 9 ms based on the input, caching and whatever else.
Alternatively, you use a secure random to state that this request will respond in exactly x ms - not when some calculations are finished. Again, you need to be sure that your calculations are guaranteed to finish before x, so you need to know the worst case time of your algorithm, but you don't need it to be constant time.