mldsa_intt_native
stdlib/dilithium/mldsa/mldsa_intt_native.nbv only in the dilithium field
mldsa_intt_native(y)
NTT^-1 over Z_q (FIPS 204 Algorithm 42) in the field Z_q itself, where it is a linear map.
y holds 256 * count coefficients, polynomial j at 256 j. Returns the result laid out the same way as linear combinations of y.
NTT^-1(y)[k] = sum_m 256^-1 zeta^(-(2 brv(m) + 1) k) y[m]
- Calls
mldsa/mldsa_brv8,dilithium/mldsa/mldsa_zeta_table_native,slice,sum- Precompiles
clone!,div_exact!,len!,loop!,modulo!- Used by
dilithium/mldsa/mldsa44_w_approx,dilithium/mldsa/mldsa44_w_approx_static
Source
# NTT^-1 over Z_q (FIPS 204 Algorithm 42) in the field Z_q itself, where it
# is a linear map.
#
# `y` holds 256 * count coefficients, polynomial j at 256 j. Returns the
# result laid out the same way as linear combinations of `y`.
#
# NTT^-1(y)[k] = sum_m 256^-1 zeta^(-(2 brv(m) + 1) k) y[m]
(y)
static count = div_exact! (len! y), 256
static zetas = mldsa_zeta_table_native(8347681)
static mut col[256]
loop! 256, m {
col[m] = 2 * mldsa_brv8(m) + 1
}
let mut out[256 * count]
loop! 256, k {
static mut row[256]
loop! 256, m {
row[m] = zetas[modulo! 512 - (modulo! col[m] * k, 512), 512]
}
loop! count, j {
out[256 * j + k] = sum((clone! row) * slice((clone! y), 256 * j, 256))
}
}
out