aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-10-05 01:24:24 +0000
committerChristian Grothoff <christian@grothoff.org>2014-10-05 01:24:24 +0000
commite59741c428ee24eb70c59a5f569bbd118102d609 (patch)
tree0c58a679ec5a14d0c5c59ba0e5e14628995965e6 /src/scalarproduct
parentbaf6ff252d87b4f2558013c1caedfea6501e6753 (diff)
downloadgnunet-e59741c428ee24eb70c59a5f569bbd118102d609.tar.gz
gnunet-e59741c428ee24eb70c59a5f569bbd118102d609.zip
-init rand
Diffstat (limited to 'src/scalarproduct')
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct.c b/src/scalarproduct/gnunet-service-scalarproduct.c
index 99146622e..fb0d856a8 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct.c
@@ -1036,7 +1036,7 @@ compute_service_response (struct ServiceSession *session)
1036 unsigned int * p; 1036 unsigned int * p;
1037 unsigned int * q; 1037 unsigned int * q;
1038 uint32_t count; 1038 uint32_t count;
1039 gcry_mpi_t * rand = NULL; 1039 gcry_mpi_t *rand;
1040 gcry_mpi_t tmp; 1040 gcry_mpi_t tmp;
1041 gcry_mpi_t * b; 1041 gcry_mpi_t * b;
1042 struct GNUNET_CRYPTO_PaillierCiphertext * a; 1042 struct GNUNET_CRYPTO_PaillierCiphertext * a;
@@ -1050,7 +1050,7 @@ compute_service_response (struct ServiceSession *session)
1050 b = session->sorted_elements; 1050 b = session->sorted_elements;
1051 q = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK, count); 1051 q = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK, count);
1052 p = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK, count); 1052 p = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK, count);
1053 1053 rand = GNUNET_malloc (sizeof (struct gcry_mpi_t) * count);
1054 for (i = 0; i < count; i++) 1054 for (i = 0; i < count; i++)
1055 GNUNET_assert (NULL != (rand[i] = gcry_mpi_new (0))); 1055 GNUNET_assert (NULL != (rand[i] = gcry_mpi_new (0)));
1056 r = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_PaillierCiphertext) * count); 1056 r = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_PaillierCiphertext) * count);
@@ -1133,7 +1133,8 @@ compute_service_response (struct ServiceSession *session)
1133 session->s_prime = s_prime; 1133 session->s_prime = s_prime;
1134 1134
1135 // release rand, b and a 1135 // release rand, b and a
1136 for (i = 0; i < count; i++) { 1136 for (i = 0; i < count; i++)
1137 {
1137 gcry_mpi_release (rand[i]); 1138 gcry_mpi_release (rand[i]);
1138 gcry_mpi_release (b[i]); 1139 gcry_mpi_release (b[i]);
1139 } 1140 }