gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r32186 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r32186 - gnunet/src/util
Date: Tue, 4 Feb 2014 11:24:40 +0100

Author: cfuchs
Date: 2014-02-04 11:24:40 +0100 (Tue, 04 Feb 2014)
New Revision: 32186

Modified:
   gnunet/src/util/crypto_paillier.c
   gnunet/src/util/test_crypto_paillier.c
Log:
- added caller-hom-ops soft-cap logics

Modified: gnunet/src/util/crypto_paillier.c
===================================================================
--- gnunet/src/util/crypto_paillier.c   2014-02-04 10:15:29 UTC (rev 32185)
+++ gnunet/src/util/crypto_paillier.c   2014-02-04 10:24:40 UTC (rev 32186)
@@ -131,6 +131,9 @@
   
   if (possible_opts < 1)
     possible_opts = 0;
+  //soft-cap by caller
+  possible_opts = (desired_ops < possible_opts)? desired_ops : possible_opts;
+  
   ciphertext->remaining_ops = htonl (possible_opts);
 
   GNUNET_assert (0 != (n_square = gcry_mpi_new (0)));

Modified: gnunet/src/util/test_crypto_paillier.c
===================================================================
--- gnunet/src/util/test_crypto_paillier.c      2014-02-04 10:15:29 UTC (rev 
32185)
+++ gnunet/src/util/test_crypto_paillier.c      2014-02-04 10:24:40 UTC (rev 
32186)
@@ -88,11 +88,11 @@
   gcry_mpi_mul_2exp(m2,m2,GNUNET_CRYPTO_PAILLIER_BITS-3);
   gcry_mpi_add(result,m1,m2);
 
-  if (1 != (ret = GNUNET_CRYPTO_paillier_encrypt (&public_key, m1, 0, &c1))){
+  if (1 != (ret = GNUNET_CRYPTO_paillier_encrypt (&public_key, m1, 2, &c1))){
     printf ("GNUNET_CRYPTO_paillier_encrypt 1 failed, should return 1 allowed 
operation, got %d!\n", ret);
     return 1;
   }
-  if (1 != (ret = GNUNET_CRYPTO_paillier_encrypt (&public_key, m2, 0, &c2))){
+  if (1 != (ret = GNUNET_CRYPTO_paillier_encrypt (&public_key, m2, 2, &c2))){
     printf ("GNUNET_CRYPTO_paillier_encrypt 2 failed, should return 1 allowed 
operation, got %d!\n", ret);
     return 1;
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]