GNUnet  0.11.x
Functions
crypto_paillier.c File Reference

implementation of the paillier crypto system with libgcrypt More...

#include "platform.h"
#include <gcrypt.h>
#include "gnunet_util_lib.h"
Include dependency graph for crypto_paillier.c:

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...
 
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...
 

Detailed Description

implementation of the paillier crypto system with libgcrypt

Author
Florian Dold
Christian Fuchs

Definition in file crypto_paillier.c.

Function Documentation

◆ GNUNET_CRYPTO_paillier_create()

void GNUNET_CRYPTO_paillier_create ( struct GNUNET_CRYPTO_PaillierPublicKey public_key,
struct GNUNET_CRYPTO_PaillierPrivateKey private_key 
)

Create a freshly generated paillier public key.

Parameters
[out]public_keyWhere to store the public key?
[out]private_keyWhere to store the private key?

Definition at line 39 of file crypto_paillier.c.

References GNUNET_assert, GNUNET_CRYPTO_mpi_print_unsigned(), GNUNET_CRYPTO_PAILLIER_BITS, GNUNET_CRYPTO_PaillierPrivateKey::lambda, GNUNET_CRYPTO_PaillierPrivateKey::mu, p, and q.

Referenced by handle_client_keygen(), and run().

43 {
44  gcry_mpi_t p;
45  gcry_mpi_t q;
46  gcry_mpi_t phi;
47  gcry_mpi_t mu;
48  gcry_mpi_t n;
49 
50  /* Generate two distinct primes. The probability that the loop body
51  is executed more than once is very very low... */
52  p = NULL;
53  q = NULL;
54  do
55  {
56  if (NULL != p)
57  gcry_mpi_release (p);
58  if (NULL != q)
59  gcry_mpi_release (q);
60  GNUNET_assert (0 ==
61  gcry_prime_generate (&p,
63  0, NULL, NULL, NULL,
64  GCRY_STRONG_RANDOM, 0));
65  GNUNET_assert (0 ==
66  gcry_prime_generate (&q,
68  0, NULL, NULL, NULL,
69  GCRY_STRONG_RANDOM, 0));
70  }
71  while (0 == gcry_mpi_cmp (p, q));
72  /* n = p * q */
73  GNUNET_assert (NULL != (n = gcry_mpi_new (0)));
74  gcry_mpi_mul (n,
75  p,
76  q);
78  sizeof(struct
80  n);
81 
82  /* compute phi(n) = (p-1)(q-1) */
83  GNUNET_assert (NULL != (phi = gcry_mpi_new (0)));
84  gcry_mpi_sub_ui (p, p, 1);
85  gcry_mpi_sub_ui (q, q, 1);
86  gcry_mpi_mul (phi, p, q);
87  gcry_mpi_release (p);
88  gcry_mpi_release (q);
89 
90  /* lambda equals phi(n) in the simplified key generation */
93  phi);
94  /* mu = phi^{-1} mod n, as we use g = n + 1 */
95  GNUNET_assert (NULL != (mu = gcry_mpi_new (0)));
96  GNUNET_assert (0 != gcry_mpi_invm (mu,
97  phi,
98  n));
99  gcry_mpi_release (phi);
100  gcry_mpi_release (n);
101  GNUNET_CRYPTO_mpi_print_unsigned (private_key->mu,
103  mu);
104  gcry_mpi_release (mu);
105 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val)
Output the given MPI value to the given buffer in network byte order.
Definition: crypto_mpi.c:78
unsigned char lambda[2048/8]
Lambda-component of the private key.
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-qr.c:59
unsigned char mu[2048/8]
Mu-component of the private key.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
#define GNUNET_CRYPTO_PAILLIER_BITS
Size of paillier plain texts and public keys.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_paillier_encrypt1()

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.

Parameters
public_keyPublic key to use.
mPlaintext to encrypt.
desired_opsHow many homomorphic ops the caller intends to use
[out]ciphertextEncrytion of plaintext with public_key.
Returns
guaranteed number of supported homomorphic operations >= 1, or desired_ops, in case that is lower, or -1 if less than one homomorphic operation is possible

Definition at line 120 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, and GNUNET_CRYPTO_PaillierCiphertext::remaining_ops.

126 {
127  int possible_opts;
128  gcry_mpi_t n_square;
129  gcry_mpi_t r;
130  gcry_mpi_t c;
131  gcry_mpi_t n;
132  gcry_mpi_t tmp1;
133  gcry_mpi_t tmp2;
134  unsigned int highbit;
135 
136  /* determine how many operations we could allow, if the other number
137  has the same length. */
138  GNUNET_assert (NULL != (tmp1 = gcry_mpi_set_ui (NULL, 1)));
139  GNUNET_assert (NULL != (tmp2 = gcry_mpi_set_ui (NULL, 2)));
140  gcry_mpi_mul_2exp (tmp1, tmp1, GNUNET_CRYPTO_PAILLIER_BITS);
141 
142  /* count number of possible operations
143  this would be nicer with gcry_mpi_get_nbits, however it does not return
144  the BITLENGTH of the given MPI's value, but the bits required
145  to represent the number as MPI. */
146  for (possible_opts = -2; gcry_mpi_cmp (tmp1, m) > 0; possible_opts++)
147  gcry_mpi_div (tmp1, NULL, tmp1, tmp2, 0);
148  gcry_mpi_release (tmp1);
149  gcry_mpi_release (tmp2);
150 
151  if (possible_opts < 1)
152  possible_opts = 0;
153  /* soft-cap by caller */
154  possible_opts = (desired_ops < possible_opts) ? desired_ops : possible_opts;
155 
156  ciphertext->remaining_ops = htonl (possible_opts);
157 
159  public_key,
160  sizeof(struct
162  highbit = GNUNET_CRYPTO_PAILLIER_BITS - 1;
163  while ((! gcry_mpi_test_bit (n, highbit)) &&
164  (0 != highbit))
165  highbit--;
166  if (0 == highbit)
167  {
168  /* invalid public key */
169  GNUNET_break_op (0);
170  gcry_mpi_release (n);
171  return GNUNET_SYSERR;
172  }
173  GNUNET_assert (0 != (n_square = gcry_mpi_new (0)));
174  GNUNET_assert (0 != (r = gcry_mpi_new (0)));
175  GNUNET_assert (0 != (c = gcry_mpi_new (0)));
176  gcry_mpi_mul (n_square, n, n);
177 
178  /* generate r < n (without bias) */
179  do
180  {
181  gcry_mpi_randomize (r, highbit + 1, GCRY_STRONG_RANDOM);
182  }
183  while (gcry_mpi_cmp (r, n) >= 0);
184 
185  /* c = (n+1)^m mod n^2 */
186  /* c = n + 1 */
187  gcry_mpi_add_ui (c, n, 1);
188  /* c = (n+1)^m mod n^2 */
189  gcry_mpi_powm (c, c, m, n_square);
190  /* r <- r^n mod n^2 */
191  gcry_mpi_powm (r, r, n, n_square);
192  /* c <- r*c mod n^2 */
193  gcry_mpi_mulm (c, r, c, n_square);
194 
196  sizeof ciphertext->bits,
197  c);
198 
199  gcry_mpi_release (n_square);
200  gcry_mpi_release (n);
201  gcry_mpi_release (r);
202  gcry_mpi_release (c);
203 
204  return possible_opts;
205 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val)
Output the given MPI value to the given buffer in network byte order.
Definition: crypto_mpi.c:78
int32_t remaining_ops
Guaranteed minimum number of homomorphic operations with this ciphertext, in network byte order (NBO)...
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
unsigned char bits[2048 *2/8]
The bits of the ciphertext.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, const void *data, size_t size)
Convert data buffer into MPI value.
Definition: crypto_mpi.c:131
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
#define GNUNET_CRYPTO_PAILLIER_BITS
Size of paillier plain texts and public keys.
Here is the call graph for this function:

◆ GNUNET_CRYPTO_paillier_encrypt()

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.

Parameters
public_keyPublic key to use.
mPlaintext to encrypt.
desired_opsHow many homomorphic ops the caller intends to use
[out]ciphertextEncrytion of plaintext with public_key.
Returns
guaranteed number of supported homomorphic operations >= 1, or desired_ops, in case that is lower, or -1 if less than one homomorphic operation is possible

Definition at line 220 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_MIN, GNUNET_SYSERR, and GNUNET_CRYPTO_PaillierCiphertext::remaining_ops.

Referenced by compute_service_response(), and send_alices_cryptodata_message().

226 {
227  int possible_opts;
228  gcry_mpi_t n_square;
229  gcry_mpi_t r;
230  gcry_mpi_t rn;
231  gcry_mpi_t g;
232  gcry_mpi_t gm;
233  gcry_mpi_t c;
234  gcry_mpi_t n;
235  gcry_mpi_t max_num;
236  unsigned int highbit;
237 
238  /* set max_num = 2^{GNUNET_CRYPTO_PAILLIER_BITS}, the largest
239  number we can have as a result */
240  GNUNET_assert (NULL != (max_num = gcry_mpi_set_ui (NULL, 1)));
241  gcry_mpi_mul_2exp (max_num,
242  max_num,
244 
245  /* Determine how many operations we could allow, assuming the other
246  number has the same length (or is smaller), by counting the
247  number of possible operations. We essentially divide max_num by
248  2 until the result is no longer larger than 'm', incrementing the
249  maximum number of operations in each round, starting at -2 */for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++)
250  gcry_mpi_div (max_num,
251  NULL,
252  max_num,
253  GCRYMPI_CONST_TWO,
254  0);
255  gcry_mpi_release (max_num);
256 
257  if (possible_opts < 1)
258  possible_opts = 0;
259  /* Enforce soft-cap by caller */
260  possible_opts = GNUNET_MIN (desired_ops, possible_opts);
261  ciphertext->remaining_ops = htonl (possible_opts);
262 
264  public_key,
265  sizeof(struct
267 
268  /* check public key for number of bits, bail out if key is all zeros */
269  highbit = GNUNET_CRYPTO_PAILLIER_BITS - 1;
270  while ((! gcry_mpi_test_bit (n, highbit)) &&
271  (0 != highbit))
272  highbit--;
273  if (0 == highbit)
274  {
275  /* invalid public key */
276  GNUNET_break_op (0);
277  gcry_mpi_release (n);
278  return GNUNET_SYSERR;
279  }
280 
281  /* generate r < n (without bias) */
282  GNUNET_assert (NULL != (r = gcry_mpi_new (0)));
283  do
284  {
285  gcry_mpi_randomize (r, highbit + 1, GCRY_STRONG_RANDOM);
286  }
287  while (gcry_mpi_cmp (r, n) >= 0);
288 
289  /* g = n + 1 */
290  GNUNET_assert (0 != (g = gcry_mpi_new (0)));
291  gcry_mpi_add_ui (g, n, 1);
292 
293  /* n_square = n^2 */
294  GNUNET_assert (0 != (n_square = gcry_mpi_new (0)));
295  gcry_mpi_mul (n_square,
296  n,
297  n);
298 
299  /* gm = g^m mod n^2 */
300  GNUNET_assert (0 != (gm = gcry_mpi_new (0)));
301  gcry_mpi_powm (gm, g, m, n_square);
302  gcry_mpi_release (g);
303 
304  /* rn <- r^n mod n^2 */
305  GNUNET_assert (0 != (rn = gcry_mpi_new (0)));
306  gcry_mpi_powm (rn, r, n, n_square);
307  gcry_mpi_release (r);
308  gcry_mpi_release (n);
309 
310  /* c <- rn * gm mod n^2 */
311  GNUNET_assert (0 != (c = gcry_mpi_new (0)));
312  gcry_mpi_mulm (c, rn, gm, n_square);
313  gcry_mpi_release (n_square);
314  gcry_mpi_release (gm);
315  gcry_mpi_release (rn);
316 
318  sizeof(ciphertext->bits),
319  c);
320  gcry_mpi_release (c);
321 
322  return possible_opts;
323 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val)
Output the given MPI value to the given buffer in network byte order.
Definition: crypto_mpi.c:78
int32_t remaining_ops
Guaranteed minimum number of homomorphic operations with this ciphertext, in network byte order (NBO)...
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
unsigned char bits[2048 *2/8]
The bits of the ciphertext.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_MIN(a, b)
Definition: gnunet_common.h:80
void GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, const void *data, size_t size)
Convert data buffer into MPI value.
Definition: crypto_mpi.c:131
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
#define GNUNET_CRYPTO_PAILLIER_BITS
Size of paillier plain texts and public keys.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_paillier_decrypt()

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.

Parameters
private_keyPrivate key to use for decryption.
public_keyPublic key to use for encryption.
ciphertextCiphertext to decrypt.
[out]mDecryption of ciphertext with .

Definition at line 335 of file crypto_paillier.c.

References GNUNET_CRYPTO_PaillierCiphertext::bits, GNUNET_assert, GNUNET_CRYPTO_mpi_scan_unsigned(), GNUNET_CRYPTO_PaillierPrivateKey::lambda, and GNUNET_CRYPTO_PaillierPrivateKey::mu.

Referenced by compute_scalar_product(), and keygen_round2_new_element().

342 {
343  gcry_mpi_t mu;
344  gcry_mpi_t lambda;
345  gcry_mpi_t n;
346  gcry_mpi_t n_square;
347  gcry_mpi_t c;
348  gcry_mpi_t cmu;
349  gcry_mpi_t cmum1;
350  gcry_mpi_t mod;
351 
353  private_key->lambda,
354  sizeof(private_key->lambda));
356  private_key->mu,
357  sizeof(private_key->mu));
359  public_key,
360  sizeof(struct
363  ciphertext->bits,
364  sizeof(ciphertext->bits));
365 
366  /* n_square = n * n */
367  GNUNET_assert (0 != (n_square = gcry_mpi_new (0)));
368  gcry_mpi_mul (n_square, n, n);
369 
370  /* cmu = c^lambda mod n^2 */
371  GNUNET_assert (0 != (cmu = gcry_mpi_new (0)));
372  gcry_mpi_powm (cmu,
373  c,
374  lambda,
375  n_square);
376  gcry_mpi_release (n_square);
377  gcry_mpi_release (lambda);
378  gcry_mpi_release (c);
379 
380  /* cmum1 = cmu - 1 */
381  GNUNET_assert (0 != (cmum1 = gcry_mpi_new (0)));
382  gcry_mpi_sub_ui (cmum1, cmu, 1);
383  gcry_mpi_release (cmu);
384 
385  /* mod = cmum1 / n (mod n) */
386  GNUNET_assert (0 != (mod = gcry_mpi_new (0)));
387  gcry_mpi_div (mod, NULL, cmum1, n, 0);
388  gcry_mpi_release (cmum1);
389 
390  /* m = mod * mu mod n */
391  gcry_mpi_mulm (m, mod, mu, n);
392  gcry_mpi_release (mod);
393  gcry_mpi_release (mu);
394  gcry_mpi_release (n);
395 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
unsigned char lambda[2048/8]
Lambda-component of the private key.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
unsigned char bits[2048 *2/8]
The bits of the ciphertext.
unsigned char mu[2048/8]
Mu-component of the private key.
void GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, const void *data, size_t size)
Convert data buffer into MPI value.
Definition: crypto_mpi.c:131
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_paillier_hom_add()

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.

Compute a ciphertext that represents the sum of the plaintext in x1 and x2.

Note that this operation can only be done a finite number of times before an overflow occurs.

Parameters
public_keyPublic key to use for encryption.
c1Paillier cipher text.
c2Paillier cipher text.
[out]resultResult of the homomorphic operation.
Returns
GNUNET_OK if the result could be computed, GNUNET_SYSERR if no more homomorphic operations are remaining.

Definition at line 413 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_MIN, GNUNET_SYSERR, and GNUNET_CRYPTO_PaillierCiphertext::remaining_ops.

Referenced by compute_service_response().

420 {
421  gcry_mpi_t a;
422  gcry_mpi_t b;
423  gcry_mpi_t c;
424  gcry_mpi_t n;
425  gcry_mpi_t n_square;
426  int32_t o1;
427  int32_t o2;
428 
429  o1 = (int32_t) ntohl (c1->remaining_ops);
430  o2 = (int32_t) ntohl (c2->remaining_ops);
431  if ((0 >= o1) || (0 >= o2))
432  {
433  GNUNET_break_op (0);
434  return GNUNET_SYSERR;
435  }
436 
438  c1->bits,
439  sizeof(c1->bits));
441  c2->bits,
442  sizeof(c2->bits));
444  public_key,
445  sizeof(struct
447 
448  /* n_square = n * n */
449  GNUNET_assert (0 != (n_square = gcry_mpi_new (0)));
450  gcry_mpi_mul (n_square, n, n);
451  gcry_mpi_release (n);
452 
453  /* c = a * b mod n_square */
454  GNUNET_assert (0 != (c = gcry_mpi_new (0)));
455  gcry_mpi_mulm (c, a, b, n_square);
456  gcry_mpi_release (n_square);
457  gcry_mpi_release (a);
458  gcry_mpi_release (b);
459 
460  result->remaining_ops = htonl (GNUNET_MIN (o1, o2) - 1);
462  sizeof(result->bits),
463  c);
464  gcry_mpi_release (c);
465  return ntohl (result->remaining_ops);
466 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val)
Output the given MPI value to the given buffer in network byte order.
Definition: crypto_mpi.c:78
int32_t remaining_ops
Guaranteed minimum number of homomorphic operations with this ciphertext, in network byte order (NBO)...
unsigned char bits[2048 *2/8]
The bits of the ciphertext.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_MIN(a, b)
Definition: gnunet_common.h:80
void GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, const void *data, size_t size)
Convert data buffer into MPI value.
Definition: crypto_mpi.c:131
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_paillier_hom_get_remaining()

int GNUNET_CRYPTO_paillier_hom_get_remaining ( const struct GNUNET_CRYPTO_PaillierCiphertext c)

Get the number of remaining supported homomorphic operations.

Parameters
cPaillier cipher text.
Returns
the number of remaining homomorphic operations

Definition at line 476 of file crypto_paillier.c.

References GNUNET_assert, and GNUNET_CRYPTO_PaillierCiphertext::remaining_ops.

478 {
479  GNUNET_assert (NULL != c);
480  return ntohl (c->remaining_ops);
481 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
int32_t remaining_ops
Guaranteed minimum number of homomorphic operations with this ciphertext, in network byte order (NBO)...