Skip to main content

Module sha3

Module sha3 

Source
Expand description

SHA-3 and SHAKE hash function primitives (FIPS 202). SHA-3 / SHAKE high-level wrappers used by ML-KEM (FIPS 203).

This module no longer carries its own copy of the Keccak permutation: it builds on top of the shared sponge core in crate::sha3. The ML-KEM-specific surface is unchanged:

FunctionPrimitiveUsage in FIPS 203
hSHA3-256H — hash encapsulation key, dk integrity
gSHA3-512G — derive shared key and encryption randomness
jSHAKE-256J — implicit rejection key derivation
prfSHAKE-256PRF — CBD sampling randomness
XofSHAKE-128XOF — matrix sampling via super::sample::sample_ntt

Structs§

Xof
Extendable Output Function (XOF) context wrapping SHAKE-128.

Functions§

g
G(c) — SHA3-512 hash returning two 32-byte values.
h
H(s) — SHA3-256 hash returning 32 bytes.
j
J(s) — SHAKE-256 producing 32 bytes of output.
prf
PRF_eta(s, b) — SHAKE-256 pseudo-random function producing 64 * eta bytes.