Skip to main content

Module hmac_sha1

Module hmac_sha1 

Source
Expand description

hmac-sha1 key creation: HMAC over SHA-1, for interoperability with SHA-1-committed constructions (TOTP, WPA2). HMAC’s security rests on the PRF property, which SHA-1’s collision breaks do not reach; prefer hmac_sha2 in new designs.

Functions§

derive_key
Mint an HMAC-SHA-1 key from a parameterized derivation. See hmac_sha2::derive_key for the length and grant contracts.
generate_key
Generate a fresh random HMAC-SHA-1 key. length is the key length in bits; None means SHA-1’s block size, 512 bits.
import_key_jwk
Import an RFC 7517 oct JSON Web Key (as JSON text; alg "HS1") as an HMAC-SHA-1 key.
import_key_raw
Import raw key material as an HMAC-SHA-1 key.