ABY Framework  1.0
Arithmetic Bool Yao Framework
 All Classes Files Functions Variables Enumerations Enumerator Macros
Macros | Functions
djn.cpp File Reference

A library implementing the Damgaard Jurik Nielsen cryptosystem with s=1 (Same properties as Paillier, but more efficient). based on:
libdjn - A library implementing the Paillier cryptosystem. (http://hms.isi.jhu.edu/acsc/libdjn/) More...

#include "djn.h"
Include dependency graph for djn.cpp:

Macros

#define DEBUG   0
 
#define CHECKSIZE   0
 

Functions

void djn_complete_pubkey (unsigned int modulusbits, djn_pubkey_t **pub, mpz_t n, mpz_t h)
 
void djn_keygen (unsigned int modulusbits, djn_pubkey_t **pub, djn_prvkey_t **prv)
 
void djn_encrypt (mpz_t res, djn_pubkey_t *pub, mpz_t plaintext, gmp_randstate_t rnd)
 
void djn_encrypt_crt (mpz_t res, djn_pubkey_t *pub, djn_prvkey_t *prv, mpz_t plaintext, gmp_randstate_t rnd)
 
void djn_encrypt_fb (mpz_t res, djn_pubkey_t *pub, mpz_t plaintext, gmp_randstate_t rnd)
 
void djn_decrypt (mpz_t res, djn_pubkey_t *pub, djn_prvkey_t *prv, mpz_t ciphertext)
 
void djn_decrypt_plain (mpz_t res, djn_pubkey_t *pub, djn_prvkey_t *prv, mpz_t ciphertext)
 
void djn_freepubkey (djn_pubkey_t *pub)
 
void djn_freeprvkey (djn_prvkey_t *prv)
 
void djn_pow_mod_n_crt (mpz_t res, const mpz_t base, const mpz_t exp, const djn_pubkey_t *pub, const djn_prvkey_t *prv)
 
void djn_pow_mod_n_squared_crt (mpz_t res, const mpz_t base, const mpz_t exp, const djn_pubkey_t *pub, const djn_prvkey_t *prv)
 

Detailed Description

A library implementing the Damgaard Jurik Nielsen cryptosystem with s=1 (Same properties as Paillier, but more efficient). based on:
libdjn - A library implementing the Paillier cryptosystem. (http://hms.isi.jhu.edu/acsc/libdjn/)

Author
Daniel Demmler

Function Documentation

void djn_complete_pubkey ( unsigned int  modulusbits,
djn_pubkey_t **  pub,
mpz_t  n,
mpz_t  h 
)

create full public key given only n and h (e.g., after a key exchange)

void djn_decrypt ( mpz_t  res,
djn_pubkey_t pub,
djn_prvkey_t prv,
mpz_t  ciphertext 
)

decrypt, using CRT, assumes res to be initialized

void djn_decrypt_plain ( mpz_t  res,
djn_pubkey_t pub,
djn_prvkey_t prv,
mpz_t  ciphertext 
)

plain decrypt version without crt (= much slower), assumes res to be initialized

void djn_encrypt ( mpz_t  res,
djn_pubkey_t pub,
mpz_t  plaintext,
gmp_randstate_t  rnd 
)

encrypt plaintext to res

void djn_encrypt_crt ( mpz_t  res,
djn_pubkey_t pub,
djn_prvkey_t prv,
mpz_t  plaintext,
gmp_randstate_t  rnd 
)

encrypt plaintext using crt if private key is known

void djn_encrypt_fb ( mpz_t  res,
djn_pubkey_t pub,
mpz_t  plaintext,
gmp_randstate_t  rnd 
)

mpz_t version of encrypt_crt