ntt
library
Constants
-
R2
→ const int
-
Precomputed Montgomery constant: R^2 mod KYBER_Q.
For KYBER_Q = 3329 and R = 2^16, the reference value is 2285.
Properties
-
bitrevTable
→ List<int>
-
=============================================
Bit-reversal table for 256 coefficients
final
-
f
→ int
-
final
-
n
→ int
-
final
-
q
→ int
-
Local aliases for convenience.
final
-
qinv
→ int
-
final
-
zetasInv
→ List<int>
-
=============================================
Precomputed inverse zetas for the inverse NTT.
final
-
zetasOficial
→ List<int>
-
=============================================
Official zetas with 129 elements (only indices 1..127 used in forward NTT)
final
Functions
-
bitrevVector(List<int> poly)
→ void
-
Bit-reversal permutation of a polynomial vector.
-
fqmul(int a, int b)
→ int
-
Multiplication in the field modulo KYBER_Q using Montgomery reduction.
-
fromMontgomery(int x)
→ int
-
Converts an integer x from Montgomery representation back to standard representation.
-
invntt(List<int> inputPoly)
→ List<int>
-
-
modExp(int base, int exp, int mod)
→ int
-
=============================================
Modular exponentiation.
-
modInverse(int a, int mod)
→ int
-
Modular inverse using Fermat's little theorem.
-
ntt(List<int> inputPoly)
→ List<int>
-
=============================================
Wrappers for the transforms
-
toMontgomery(int x)
→ int
-
Converts an integer x into Montgomery representation.