aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_paillier.c
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2014-02-04 10:15:29 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2014-02-04 10:15:29 +0000
commit9728378c983196c86c2fc6b7902964955e41e379 (patch)
tree1ecd82f008f053fc7bccf7dc0b331dc6a5db2a0e /src/util/crypto_paillier.c
parent3a831d404fdb12a6b8aa4c34f04d9c96ac032a03 (diff)
downloadgnunet-9728378c983196c86c2fc6b7902964955e41e379.tar.gz
gnunet-9728378c983196c86c2fc6b7902964955e41e379.zip
- extended paillier-api to also include caller-suggested maximum supported homs
Diffstat (limited to 'src/util/crypto_paillier.c')
-rw-r--r--src/util/crypto_paillier.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/crypto_paillier.c b/src/util/crypto_paillier.c
index d47823905..6873d159f 100644
--- a/src/util/crypto_paillier.c
+++ b/src/util/crypto_paillier.c
@@ -92,12 +92,16 @@ GNUNET_CRYPTO_paillier_create (struct GNUNET_CRYPTO_PaillierPublicKey *public_ke
92 * 92 *
93 * @param public_key Public key to use. 93 * @param public_key Public key to use.
94 * @param m Plaintext to encrypt. 94 * @param m Plaintext to encrypt.
95 * @param desired_ops How many homomorphic ops the caller intends to use
95 * @param[out] ciphertext Encrytion of @a plaintext with @a public_key. 96 * @param[out] ciphertext Encrytion of @a plaintext with @a public_key.
96 * @return guaranteed number of supported homomorphic operations, can be zero 97 * @return guaranteed number of supported homomorphic operations >= 1,
98 * or desired_ops, in case that is lower,
99 * or -1 if less than one homomorphic operation is possible
97 */ 100 */
98int 101int
99GNUNET_CRYPTO_paillier_encrypt (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, 102GNUNET_CRYPTO_paillier_encrypt (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key,
100 const gcry_mpi_t m, 103 const gcry_mpi_t m,
104 int desired_ops,
101 struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext) 105 struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext)
102{ 106{
103 int possible_opts; 107 int possible_opts;