Expand description
Linear algebra with degree-256 polynomials over a prime-order field, vectors of such polynomials, and NTT polynomials / vectors
Structs§
- Elem
- An
Elemis a member of the specified prime-order field. Elements can be added, subtracted, multiplied, and negated, and the overloaded operators will ensure both that the integer values remain in the field, and that the reductions are done efficiently. For addition and subtraction, a simple conditional subtraction is used; for multiplication, Barrett reduction. - NttMatrix
- A K x L matrix of NTT-domain polynomials. Each vector represents a row of the matrix, so that multiplying on the right just requires iteration. Multiplication on the right by vectors is the only defined operation, and is only defined when multiplication of NTT polynomials is defined.
- NttPolynomial
- An
NttPolynomialis a member of the NTT algebraT_q = Z_q[X]^256of 256-tuples of field elements. NTT polynomials can be added and subtracted, negated, and multiplied by scalars. We do not define multiplication of NTT polynomials here. We also do not define the mappings between normal polynomials and NTT polynomials (i.e., betweenR_qandT_q). - NttVector
- An
NttVectoris a vector of polynomials fromT_qof lengthK. NTT vectors can be added and subtracted. If multiplication is defined for NTT polynomials, then NTT vectors can be multiplied by NTT polynomials, and “multipled” with each other to produce a dot product. - Polynomial
- A
Polynomialis a member of the ringR_q = Z_q[X] / (X^256)of degree-256 polynomials over the finite field with prime orderq. Polynomials can be added, subtracted, negated, and multiplied by field elements. We do not define multiplication of polynomials here. - Vector
- A
Vectoris a vector of polynomials fromR_qof lengthK. Vectors can be added, subtracted, negated, and multiplied by field elements.