Skip to main content

Module sha3

Module sha3 

Source
Expand description

Keccak/SHA-3/SHAKE hash function implementations (FIPS 202). SHA-3 / SHAKE high-level wrappers used by ML-DSA (FIPS 204).

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-DSA-specific surface (sha3_256, sha3_512, shake128, shake256, h_init, g_init, plus the KeccakState re-export consumed by the rest of the algorithm) is unchanged.

Structs§

KeccakState
Keccak sponge state for SHA-3 and SHAKE constructions.

Functions§

g_init
Initialize the ML-DSA G function (SHAKE128 with streaming interface). Alias for shake128, named to match FIPS 204.
h_init
Initialize the ML-DSA H function (SHAKE256 with streaming interface). Alias for shake256, named to match FIPS 204.
sha3_256
Compute SHA3-256 over the input and return the 32-byte digest.
sha3_512
Compute SHA3-512 over the input and return the 64-byte digest.
shake128
Create a new SHAKE128 extendable-output function (XOF) context.
shake256
Create a new SHAKE256 extendable-output function (XOF) context.
shake128_digest
Convenience function: absorb input into SHAKE128 and squeeze into out.
shake256_digest
Convenience function: absorb input into SHAKE256 and squeeze into out.