Skip to main content

Module constant_time

Module constant_time 

Source
Expand description

Constant-time operations to prevent timing attacks.

These small primitives are owned by dcrypt so the published implementation does not need an unsafe-containing dependency for masks and comparisons.

Structs§

Choice
A one-bit value used by constant-time operations.
CtOption
An option whose validity is represented by a Choice.

Traits§

ConditionallySelectable
Select between two values without branching on choice.
ConstantTimeEq
Compare two values without data-dependent early exit.

Functions§

ct_eq
Constant-time comparison of two byte slices