◄ Wiki / Crypto
constant-time equal
A comparison that checks whether two secret values match without stopping early on the first difference.
A naive equality check returns as soon as it finds a mismatched byte, and that timing leaks how many bytes matched — useful to an attacker guessing a secret. A constant-time equal always examines every byte and takes the same time regardless of where or whether values differ. Routing all secret comparisons through it removes that timing side channel.
See also
- constant-timeA coding discipline where execution timing never varies based on secret data.
- constant-timeA coding discipline where execution timing never varies based on secret data.