Skip to main content

Module const_time

Module const_time 

Source
Expand description

Constant-time byte-slice comparison.

Defends against timing oracles when comparing secrets (auth tokens, MAC tags, password hashes). Returns false if the lengths differ without leaking which prefix matched. Centralised so every site that compares secret material uses the same audited routine.

Functionsยง

constant_time_eq