Skip to main content

Module symmetric

Module symmetric 

Source
Expand description

Symmetric key encapsulation module for the KyberLib library. Symmetric primitives — SHAKE-128/256 (default) or AES-256-CTR + SHA-2 (under the deprecated 90s feature).

These primitives back FIPS 203 ML-KEM’s PRF/XOF/KDF surface. The module re-exports types for both backends under a uniform name so the active backend is selected at compile time via the 90s Cargo feature. Default (no 90s) → SHAKE; with 90s → AES + SHA-2.

End users typically don’t reach into this module directly — it’s exposed for backend selection inside the KEM machinery.

Structs§

KeccakState
Keccak state for absorbing data

Constants§

AES256CTR_BLOCKBYTES
Block size for AES256CTR in bytes.
XOF_BLOCKBYTES
Block size for XOF (Extendable Output Function) in bytes.

Functions§

hash_g
Computes SHA3-512 hash
hash_h
Computes SHA3-256 hash
kdf
Key derivation function (KDF) in non-90s mode
kyber_shake128_absorb
Absorb step of the SHAKE128 specialized for the Kyber context
kyber_shake128_squeezeblocks
Squeeze step of SHAKE128 XOF in non-90s mode
prf
Pseudo-random function (PRF) in non-90s mode
shake256_prf
Usage of SHAKE256 as a PRF in non-90s mode
xof_absorb
Absorbs input data into the XOF state in non-90s mode
xof_squeezeblocks
Squeezes XOF data into output in non-90s mode

Type Aliases§

XofState
Type alias for the XOF (Extendable Output Function) state.