|
|
|
|
|
by zaroth
3823 days ago
|
|
Comparisons after hashing are naturally resistant to timing attacks, because you are not in direct control of the bytes being compared. Just ask Bitcoin miners how hard it is to pick an input which results in a hash with a desired n-bit prefix. But as a belt-and-suspenders you often see an attempt at fixed time comparisons of digests in any case. Coincidentally, hashing before comparing can be used in scripting languages where the compare function will often be optimized out from under you, making constant time compare difficult or impossible to actually guarantee. |
|