implementation of the paillier crypto system with libgcrypt More...
Go to the source code of this file.
Functions | |
void | GNUNET_CRYPTO_paillier_create (struct GNUNET_CRYPTO_PaillierPublicKey *public_key, struct GNUNET_CRYPTO_PaillierPrivateKey *private_key) |
Create a freshly generated paillier public key. More... | |
static int | GNUNET_CRYPTO_paillier_encrypt1 (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const gcry_mpi_t m, int desired_ops, struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext) |
Encrypt a plaintext with a paillier public key. More... | |
int | GNUNET_CRYPTO_paillier_encrypt (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const gcry_mpi_t m, int desired_ops, struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext) |
Encrypt a plaintext with a paillier public key. More... | |
void | GNUNET_CRYPTO_paillier_decrypt (const struct GNUNET_CRYPTO_PaillierPrivateKey *private_key, const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext, gcry_mpi_t m) |
Decrypt a paillier ciphertext with a private key. More... | |
int | GNUNET_CRYPTO_paillier_hom_add (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const struct GNUNET_CRYPTO_PaillierCiphertext *c1, const struct GNUNET_CRYPTO_PaillierCiphertext *c2, struct GNUNET_CRYPTO_PaillierCiphertext *result) |
Compute a ciphertext that represents the sum of the plaintext in c1 and c2. More... | |
int | GNUNET_CRYPTO_paillier_hom_get_remaining (const struct GNUNET_CRYPTO_PaillierCiphertext *c) |
Get the number of remaining supported homomorphic operations. More... | |
implementation of the paillier crypto system with libgcrypt
Definition in file crypto_paillier.c.
|
static |
Encrypt a plaintext with a paillier public key.
public_key | Public key to use. | |
m | Plaintext to encrypt. | |
desired_ops | How many homomorphic ops the caller intends to use | |
[out] | ciphertext | Encryption of plaintext with public_key. |
Definition at line 121 of file crypto_paillier.c.
References GNUNET_CRYPTO_PaillierCiphertext::bits, GNUNET_assert, GNUNET_break_op, GNUNET_CRYPTO_mpi_print_unsigned(), GNUNET_CRYPTO_mpi_scan_unsigned(), GNUNET_CRYPTO_PAILLIER_BITS, GNUNET_SYSERR, m, and GNUNET_CRYPTO_PaillierCiphertext::remaining_ops.