Expand description
Constant-time comparison utilities.
These functions are resistant to timing attacks and should be used when comparing cryptographic values like MACs, signatures, or hashes.
Structs§
- Secret
Bytes - A wrapper for sensitive data that implements constant-time comparison.
Functions§
- ct_eq
- Compare two byte slices in constant time.
- ct_
eq_ 32 - Compare two 32-byte arrays in constant time.
- ct_
eq_ 64 - Compare two 64-byte arrays in constant time (for signatures).
- ct_
eq_ slice_ 32 - Compare a slice against a fixed-size array in constant time.
- ct_
select - Select between two values in constant time based on a condition.