Index Mathematics Conjectures nbv lettuce Widgets

mldsa44_w_approx

stdlib/milli/mldsa/mldsa44_w_approx.nbv only in the milli field

mldsa44_w_approx(a_hat, v_bits, c, t1)

w_approx = NTT^-1(A_hat NTT(z) - NTT(c) NTT(2^13 t1)) for ML-DSA-44 in the 32 bit milli field (FIPS 204 Algorithm 8, step 7).

Values mod q are handled in base 2^10 limbs (see mldsa_reduce) and c * t1 is computed exactly over the native field (see mldsa_ct1). a_hat holds limbs from mldsa_expand_a, v_bits the 18 bits of each v = gamma1 - z, c the challenge coefficients and t1 the public key coefficients. Returns 23 bits per canonical coefficient of w_approx.

Calls
bits/from_bits, milli/mldsa/mldsa_ct1, milli/mldsa/mldsa_intt_sub, milli/mldsa/mldsa_ntt_z, milli/mldsa/mldsa_pointwise, slice
Precompiles
clone!, loop!, wtns!
Used by
milli/mldsa/mldsa44_verify

Source

# w_approx = NTT^-1(A_hat NTT(z) - NTT(c) NTT(2^13 t1)) for ML-DSA-44 in the
# 32 bit milli field (FIPS 204 Algorithm 8, step 7).
#
# Values mod q are handled in base 2^10 limbs (see mldsa_reduce) and c * t1
# is computed exactly over the native field (see mldsa_ct1). `a_hat` holds
# limbs from mldsa_expand_a, `v_bits` the 18 bits of each v = gamma1 - z,
# `c` the challenge coefficients and `t1` the public key coefficients.
# Returns 23 bits per canonical coefficient of w_approx.
(a_hat, v_bits, c, t1)

static K = 4
static L = 4
let mut v0[256 * L]
let mut v1[256 * L]
loop! 256 * L, i {
  v0[i] = wtns! from_bits(slice((clone! v_bits), 18 * i, 10))
  v1[i] = wtns! from_bits(slice((clone! v_bits), 18 * i + 10, 8))
}
let z_hat = mldsa_ntt_z(v0, v1)
let y = mldsa_pointwise(a_hat, z_hat, K)
let ct = mldsa_ct1(c, t1)
mldsa_intt_sub(y, ct)