Index Mathematics Conjectures nbv lettuce Widgets

mldsa_mulmod_static

stdlib/mldsa/mldsa_mulmod_static.nbv

mldsa_mulmod_static(static a, static b)

a * b mod q for static a, b < q, evaluated at compile time

Calls
mldsa/mldsa_div_rem_q, mldsa/mldsa_static_limbs
Precompiles
static_eval!
Used by
mersenne61/mldsa/mldsa_ntt_q, milli/mldsa/mldsa_ntt_z, mldsa/mldsa_zeta_table

Source

# a * b mod q for static a, b < q, evaluated at compile time
(static a, static b)

static al = mldsa_static_limbs(a)
static bl = mldsa_static_limbs(b)
static x = [
  al[0] * bl[0]
  al[0] * bl[1] + al[1] * bl[0]
  al[0] * bl[2] + al[1] * bl[1] + al[2] * bl[0]
  al[1] * bl[2] + al[2] * bl[1]
  al[2] * bl[2]
]
static_eval! {
  (let k, let r) = mldsa_div_rem_q(x)
  r
}