Structs

NtruPrime parameters

Positions and coefficients for a polynomial.

Enums

Functions

This function creates a polynomial with w many -1 or 1 and with the highest degree of h_deg. Randomness of the coefficients and positions has to be provided.

r is the plaintext, h is the public key

Generate a key from given polynomials f and g. Generating the polynomials at random has to happen outside.

First transform each coefficients to a value between −(q−1)/2 and (q−1)/2 then round it to the nearest multiple of 3