Addressed SLH-DSA hash calls #
This module implements the four FIPS 205 hash calls whose inputs are separated by an address:
PRF, F, H, and T_l. The SHAKE parameter sets use the canonical 32-byte address and
SHAKE256. The SHA2 parameter sets use the compressed 22-byte address and the precise SHA-256 or
SHA-512 branch prescribed for each call and security-element length.
The low-level calls accept every typed Address, as the signatures in Section 4.1 do. SHA2
applies the standard's total compressed-address projection; protocol call sites are responsible for
setting the address type and keeping the retained layer and tree fields in their standardized
ranges.
Inputs encode the source arities in their types: F and PRF consume one n-byte payload, H
consumes two consecutive n-byte blocks, and T_l consumes exactly l * n bytes. All outputs are
exactly n bytes. The hash calls use the total SHA2 functions, while ValidTInput separately
records the standard's SHA-2 input domain; validTInput_of_blocks_le_67 proves that fact for every
standardized WOTS+ or FORS call.
This is executable hash plumbing, not a constant-time or machine-costed implementation, a NIST
validation, a security proof, or an asymptotic parameter family. It does not define H_msg,
PRF_msg, WOTS+, XMSS, FORS, the hypertree, signing, or verification.
Main definitions #
Cslib.Crypto.SLHDSA.HashFamily: the SHAKE and SHA2 instantiation families.Cslib.Crypto.SLHDSA.NBytes,TwoNBytes,LBlocksBytes: typed call inputs.Cslib.Crypto.FixedBytes.pairBlocks: construct a two-block input without discarding its structure.Cslib.Crypto.SLHDSA.shakeInput,sha256Input,sha512Input: exact byte packages.Cslib.Crypto.SLHDSA.prf,f,h,tL: the four addressed FIPS 205 calls.Cslib.Crypto.SLHDSA.ValidTInput: the underlying SHA-2 input-domain obligation forT_l.
Main results #
Cslib.Crypto.SLHDSA.validTInput_of_blocks_le_67: every standardized block count is valid.
References #
The two concrete hash families used by the FIPS 205 parameter sets.
- shake : HashFamily
- sha2 : HashFamily
Instances For
One n-byte SLH-DSA security element.
Two consecutive n-byte blocks, the input shape of H.
Exactly l consecutive n-byte blocks, the input shape of T_l.
The exact SHAKE input PK.seed || ADRS || X, using the canonical 32-byte address.
SHAKE call packaging has n + 32 + m bytes.
The exact SHA-256 input PK.seed || toByte(0, 64 - n) || ADRS^c || X.
SHA-256 call packaging has 64 + 22 + m bytes.
The exact SHA-512 input PK.seed || toByte(0, 128 - n) || ADRS^c || X.
SHA-512 call packaging has 128 + 22 + m bytes.
FIPS 205 PRF(PK.seed, SK.seed, ADRS) from Sections 11.1--11.2.2.
FIPS 205 F(PK.seed, ADRS, M_1) from Sections 11.1--11.2.2.
The standard's source-domain predicate for an arbitrary T_l call.
SHAKE256 accepts every finite byte string. For SHA2, this is exactly the input predicate of the SHA-256 or SHA-512 branch selected by FIPS 205. The executable hash functions are total outside this domain; this predicate records that a call is within the source domain rather than imposing a runtime precondition.
Instances For
Every block count used by a standardized WOTS+ or FORS call is inside the SHA2 source domain.
The largest WOTS+ value is len = 67, while every standardized FORS value has k ≤ 35.
FIPS 205 T_l(PK.seed, ADRS, M_l) from Sections 11.1--11.2.2, extended totally through the
total SHA2 functions. ValidTInput separately records the standard's source domain.
FIPS 205 H(PK.seed, ADRS, M_2) from Sections 11.1--11.2.2.