Index Mathematics Conjectures nbv lettuce Widgets

ntt_negacyclic_mat

stdlib/polynomial/ntt_negacyclic_mat.nbv

ntt_negacyclic_mat(N, mat)

apply a negacyclic number theoretic transform to a matrix of polynomials

Calls
polynomial/ntt_negacyclic_vec, slice_to_end
Precompiles
assert_eq!, chunks_flat_map!, concat!, len!, static_assert_const!
Used by
bdlop/bdlop_linear_nizk_verify

Source

# apply a negacyclic number theoretic transform to
# a matrix of polynomials
(N, mat)

static mat_height = static_assert_const! mat[0]
static mat_width = static_assert_const! mat[1]
assert_eq! 2 + mat_height * mat_width * N, len! mat

let out = chunks_flat_map! slice_to_end(mat, 2), N * mat_width, mat_row {
  ntt_negacyclic_vec(N, mat_row)
}

concat! mat_height, mat_width, out