108 const unsigned char *
const buf);
226 const unsigned char *buf);
void bgv_key_serialize(unsigned char *buf, const bgv_key_t *const k)
Serialize a BGV key pair.
struct bgv_key_t bgv_key_t
BGV key pair used to encrypt, decrypt, and relinearize a ciphertext.
struct bgv_keypair_t bgv_keypair_t
Generic key pair wraps a pair of polynomials.
int bgv_init(bgv_t *b, size_t lgd, size_t lgq, size_t lgm, size_t t)
Initialize BGV scheme parameters.
void bgv_ct_add(bgv_ct_t *c, const bgv_ct_t *const a, const bgv_ct_t *const b)
Add two BGV ciphertexts.
int bgv_key_cmp(const bgv_key_t *const a, const bgv_key_t *const b)
Test two keys for equality. Returns 1 if keys are equal, 0 otherwise.
struct bgv_t bgv_t
Main BGV type used to instantiate the scheme.
void bgv_encrypt(const bgv_t *const b, bgv_ct_t *c, const bgv_keypair_t *const k, const poly_t *const m)
Encrypt a polynomial using the BGV scheme.
void bgv_key_zero(const ring_t *const r, bgv_key_t *k)
Initialize an empty key pair.
void bgv_key_free(bgv_key_t *k)
Destroy a BGV key pair Free any memory allocated by the key generation process.
void bgv_ct_deserialize(const ring_t *const r, bgv_ct_t *c, const unsigned char *buf)
Deserialize a BGV ciphertext from a byte stream.
void bgv_decrypt(poly_t *m, const bgv_ct_t *const c, const poly_t *const s)
Decrypt a BGV ciphertext.
int bgv_ct_init(const ring_t *const r, bgv_ct_t *c, size_t n)
Initialize an empty BGV ciphertext.
void bgv_ct_serialize(unsigned char *buf, const bgv_ct_t *const c)
Serialize a BGV ciphertext into a byte stream.
void bgv_key_deserialize(const ring_t *const r, bgv_key_t *k, const unsigned char *const buf)
Deserialize a BGV key pair.
void bgv_ct_mul(bgv_ct_t *c, const bgv_keypair_t *e, const bgv_ct_t *const a, const bgv_ct_t *const b)
Multiply two BGV ciphertexts.
void bgv_free(bgv_t *b)
Destroy a BGV struct. Free any memory allocated by the context.
void bgv_ct_free(bgv_ct_t *c)
Destroy a BGV ciphertext Free any memory allocated by the encryption process.
struct bgv_ct_t bgv_ct_t
BGV Ciphertext consists of polynomials over the ciphertext ring .
void bgv_keygen(const bgv_t *const b, bgv_key_t *k)
Generate a BGV key pair.
void bgv_ct_relin(bgv_ct_t *c, const bgv_keypair_t *const k)
Relinearize a BGV ciphertext in place.
BGV Ciphertext consists of polynomials over the ciphertext ring .
Definition: fhe_bgv.h:62
poly_t * c
Ciphertext polynomials
Definition: fhe_bgv.h:64
size_t n
Number of polynomials.
Definition: fhe_bgv.h:63
BGV key pair used to encrypt, decrypt, and relinearize a ciphertext.
Definition: fhe_bgv.h:49
bgv_keypair_t pub
Public key pair .
Definition: fhe_bgv.h:51
poly_t s
Secret key .
Definition: fhe_bgv.h:50
bgv_keypair_t eval
Evaluation key pair .
Definition: fhe_bgv.h:52
Generic key pair wraps a pair of polynomials.
Definition: fhe_bgv.h:41
poly_t b
Polynomial b.
Definition: fhe_bgv.h:43
poly_t a
Polynomial a.
Definition: fhe_bgv.h:42
Main BGV type used to instantiate the scheme.
Definition: fhe_bgv.h:33
size_t t
Plaintext modulus .
Definition: fhe_bgv.h:34
ring_t r
Polynomial ring .
Definition: fhe_bgv.h:35
Main Polynomial type used to represent polynomials over for a generic modulus .
Definition: fhe_poly.h:45
Main Ring type used to define a polynomial ring.
Definition: fhe_ring.h:34