Function bearssl::br_hmac_drbg_init [] [src]

pub unsafe extern "C" fn br_hmac_drbg_init(
    ctx: *mut br_hmac_drbg_context,
    digest_class: *const br_hash_class,
    seed: *const c_void,
    seed_len: usize
)

\brief HMAC_DRBG initialisation.

The context to initialise is provided as a pointer to its first field (the vtable pointer); this function sets that first field to a pointer to the vtable.

The seed value is what is called, in NIST terminology, the concatenation of the "seed", "nonce" and "personalization string", in that order.

The digest_class parameter defines the underlying hash function. Formally, the NIST standard specifies that the hash function shall be only SHA-1 or one of the SHA-2 functions. This implementation also works with any other implemented hash function (such as MD5), but this is non-standard and therefore not recommended.

\param ctx HMAC_DRBG context to initialise. \param digest_class vtable for the underlying hash function. \param seed initial seed. \param seed_len initial seed length (in bytes).