Skip to main content

Module hash

Module hash 

Source
Expand description

SHAKE-based tweakable hash function wrappers (H_msg, PRF, PRF_msg, T_l, H, F). SHAKE-based tweakable hash function wrappers for SLH-DSA (FIPS 205, Section 11.1).

All hash functions in the SHAKE instantiation of SLH-DSA are built on top of SHAKE256. The address structure (Adrs) is included in each hash call to provide domain separation.

The _into variants write output to a caller-provided buffer (zero heap allocation). The standard variants return Vec<u8> for convenience.

Functions§

f_hash
F — convenience wrapper returning Vec.
f_hash_into
F(PK.seed, ADRS, M1) — single-input chain hash. Output to out (n bytes).
h_msg
H_msg — convenience wrapper returning Vec.
h_msg_into
H_msg(R, PK.seed, PK.root, M) — message hash. Output written to out (m bytes).
hash_h
H — convenience wrapper returning Vec.
hash_h_into
H(PK.seed, ADRS, M1 || M2) — two-input Merkle node hash. Output to out (n bytes).
prf
PRF — convenience wrapper returning Vec.
prf_into
PRF(PK.seed, SK.seed, ADRS) — secret value derivation. Output to out (n bytes).
prf_msg
PRF_msg — convenience wrapper returning Vec.
prf_msg_into
PRF_msg(SK.prf, opt_rand, M) — message randomizer. Output to out (n bytes).
t_l
T_l — convenience wrapper returning Vec.
t_l_into
T_l(PK.seed, ADRS, M) — multi-input compression. Output to out (n bytes).