Skip to main content

ct_increment

Function ct_increment 

Source
pub fn ct_increment(v: &mut [u8])
Expand description

V = (V + 1) mod 2^(8·V.len()), big-endian, in place — the CTR_DRBG counter increment (SP 800-90A §10.2.1.2, the V = (V + 1) mod 2^blocklen of the Update, and the generate loop of §10.2.1.5.2).

Constant time in V’s contents: the carry ripples through every byte regardless of value (no early break once carry == 0), so the timing does not reveal how many trailing 0xff bytes V had.