Various Homomorphic Encryption (FHE) schema that use Ring-Learning With Errors (RLWE) problems (and post-quantum, lattice-based cryptography in general) need to perform a polynomial modulo and then a scalar modulo on the coefficients.
I use the polynom package for the polynomials and the polynomial modulo.
Is there a way to perform the scalar modulo on the coefficients?
There is no way in polynom. This is a simple workaround
I've create a small R package that also makes the function available: