Skip to main content

Module hmac

Module hmac 

Source
Expand description

HMAC_DRBG — SP 800-90A Rev.1 §10.1.2.

Generic over any [tessera::Digest], driving tessera::hmac; used in practice over HMAC-SHA-256 / -384 / -512. Both the state size and the output block equal the digest’s output length outlen.

§Parameters (SP 800-90A §10.1, Table 2)

Hashsecurity_strengthoutlen (octets)
SHA-112820
SHA-22419228
SHA-25625632
SHA-38425648
SHA-51225664

reseed_interval = 2^48, max_number_of_bits_per_request = 2^19.

§Side-channel posture

(K, V) are secret. The construction is branch-free by shape: the only value-dependent control flow is the provided_data.is_empty() test of the Update (§10.1.2.2), which is on the (public) presence of additional input, not on secret content. HMAC-SHA-2 inherits the carry-based DPA of T2-D (see crate::drbg); no table lookup on secret data.

Structs§

HmacDrbg
HMAC_DRBG internal state (SP 800-90A §10.1.2.1): (K, V) each outlen octets, plus the reseed_counter. K and V are secret.