Skip to content

crypto::sha1

SHA-1, from FIPS 180-4.

WPA2-PSK still rests on SHA-1: PBKDF2-SHA1 turns the passphrase into the PMK, and the pairwise key is derived with a SHA-1 PRF. It is cryptographic but not chosen for its collision resistance here — HMAC-SHA1 and the KDF rely only on it being a pseudo-random function, which the attacks on SHA-1 collisions do not touch. WPA3 moves to SHA-256; this stays for the large installed base of WPA2 networks.

Same streaming shape as [super::sha256], for the same reason, and the same argument that it can be trusted before hardware: SHA-1 is data-independent, so the only question is arithmetic, and the FIPS vectors in the tests answer it.

struct Sha1 { /* private fields */ }

A streaming SHA-1 hasher.

Implements: Hash, Clone, Default

const DIGEST_LEN: usize;

The digest is 160 bits.