Expand description
Constant-time primitives for branchless cryptographic operations.
All functions in this module are designed to avoid secret-dependent control flow and
secret-dependent memory accesses. Values pass through core::hint::black_box to inhibit
LLVM optimizations that might otherwise reintroduce branches.
How far this is verified (release-assembly audit, dudect timing tests) is tracked in
SECURITY.md.
Structs§
- Choice
- A constant-time boolean represented internally as
0u8(false) or1u8(true).
Functions§
- ct_
eq_ slice - Constant-time equality for two byte slices.
- ct_
eq_ u8 - Constant-time equality for two
u8values. - ct_
select_ array - Constant-time selection of fixed-size byte arrays, returning the selected array.
- ct_
select_ array_ into - Constant-time selection of fixed-size byte arrays directly into
out. - ct_
select_ i16 - Constant-time selection between two
i16values (used in lattice polynomial arithmetic). - ct_
select_ u8 - Constant-time selection between two
u8values: returnsif_truewhenchoiceis true, otherwiseif_false. - ct_
select_ u16 - Constant-time selection between two
u16values.