uint64_t uint_t
Default unsigned integer width is 64 bits.
Definition: fhe_config.h:49
int ring_init(ring_t *r, size_t lgd, size_t lgq, size_t lgm)
Initialize a polynomial ring.
void ring_free(ring_t *r)
Destroy a polynomial ring Free any memory allocated by the polynomial ring.
struct ring_t ring_t
Main Ring type used to define a polynomial ring.
Main Ring type used to define a polynomial ring.
Definition: fhe_ring.h:34
size_t d
Polynomial degree.
Definition: fhe_ring.h:36
size_t n
Number of residues in the CRT representation of M.
Definition: fhe_ring.h:37
uint_t * invms
[M / m_i]_{m_i}^-1
Definition: fhe_ring.h:43
uint_t * dinv
[d]_{m_i}^-1
Definition: fhe_ring.h:46
uint_t * m
CRT decomposition of M.
Definition: fhe_ring.h:44
uint_t * roots
Primitive roots of unity.
Definition: fhe_ring.h:41
mpz_t * ms
M/m_i for each CRT residue m_i.
Definition: fhe_ring.h:40
mpz_t M
Multiprecision representation of M.
Definition: fhe_ring.h:38
uint_t * iroots
Inverse primitive roots of unity.
Definition: fhe_ring.h:42
uint_t * minv
[m_i]^-1
Definition: fhe_ring.h:45
size_t lgd
log d where d is the polynomial degree
Definition: fhe_ring.h:35
mpz_t M_half
Multiprecision representation of M/2.
Definition: fhe_ring.h:39