Skip to main content

ct_add_into

Function ct_add_into 

Source
pub fn ct_add_into(acc: &mut [u8], addend: &[u8])
Expand description

acc = (acc + addend) mod 2^(8·acc.len()), big-endian, in place.

Data-oblivious carry-propagating add. addend may be shorter than acc; it is right-aligned (its LSBs line up with acc’s LSBs), which is the shape needed by Hash_DRBG’s V = (V + H) mod 2^seedlen and V = (V + C + reseed_counter + …) mod 2^seedlen (SP 800-90A §10.1.1.4 step 6). Bytes of addend beyond acc’s length would overflow the modulus and are ignored (they must be zero for a well-formed call).