libfhe
Data Structures | Typedefs | Functions
fhe_ring.h File Reference
#include "fhe_config.h"
#include <gmp.h>

Go to the source code of this file.

Data Structures

struct  ring_t
 Main Ring type used to define a polynomial ring. More...
 

Typedefs

typedef struct ring_t ring_t
 Main Ring type used to define a polynomial ring.
 

Functions

int ring_init (ring_t *r, size_t lgd, size_t lgq, size_t lgm)
 Initialize a polynomial ring. More...
 
void ring_free (ring_t *r)
 Destroy a polynomial ring Free any memory allocated by the polynomial ring. More...
 

Detailed Description

This file contains the declaration of the ring_t type, which implements the cyclotomic polynomial ring $R = Z_M[X] / <x^d + 1>$ for a generic modulus $M$.

Function Documentation

◆ ring_free()

void ring_free ( ring_t r)

Destroy a polynomial ring Free any memory allocated by the polynomial ring.

Parameters
rPolynomial ring

◆ ring_init()

int ring_init ( ring_t r,
size_t  lgd,
size_t  lgq,
size_t  lgm 
)

Initialize a polynomial ring.

Parameters
[out]rThe polynomial ring
lgdThe bit length of the polynomial degree
lgqThe bit length of the base ring modulus
lgmThe bit length of the CRT residues