mldsa44_finish
stdlib/mldsa/mldsa44_finish.nbv
mldsa44_finish(mu, w, h, ctilde)
Final steps of ML-DSA-44 verification (FIPS 204 Algorithm 8): apply the hint to w_approx (23 bits per canonical coefficient) and constrain H(mu || w1Encode(w1)) to equal ctilde. Returns mu.
- Calls
mldsa/mldsa_use_hint,keccak/shake256,slice- Precompiles
clone!,concat!,constrain_eq!,loop!- Used by
dilithium/mldsa/mldsa44_verify,dilithium/mldsa/mldsa44_verify_static,mersenne61/mldsa/mldsa44_verify,milli/mldsa/mldsa44_verify
Source
# Final steps of ML-DSA-44 verification (FIPS 204 Algorithm 8): apply the
# hint to w_approx (23 bits per canonical coefficient) and constrain
# H(mu || w1Encode(w1)) to equal ctilde. Returns mu.
(mu, w, h, ctilde)
static K = 4
let mut w1_bits[6 * 256 * K]
loop! 256 * K, i {
let b = mldsa_use_hint(slice((clone! w), 23 * i, 23), h[i])
loop! 6, j {
w1_bits[6 * i + j] = b[j]
}
}
constrain_eq! ctilde, shake256((concat! (clone! mu), w1_bits), 256)
mu