Module ct

Module ct 

Source
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§

SecretBytes
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.