Core engineering and protocols for Fast Modular Arithmetic Kernels.
Given an intermediate product a in [-q*2^15, q*2^15], Montgomery reduction computes a * R^(-1) mod q using only integer multiplication, shifts, and bitwise operations. Since q = 3329, the modular inverse q' = 3327 allows intermediate products to be folded efficiently into 16-bit registers, yielding strict constant-cycle execution.
To compress polynomial coefficients before serialization into byte arrays, Barrett reduction maps coefficients back into the canonical range [0, q-1] without branching. We demonstrate mathematical proofs of correctness for our 32-bit integer arithmetic routines, guaranteeing zero register carry-dependent stalls.