aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/crypto_cs.c')
-rw-r--r--src/util/crypto_cs.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/util/crypto_cs.c b/src/util/crypto_cs.c
index c89ba5d83..c4bc3380a 100644
--- a/src/util/crypto_cs.c
+++ b/src/util/crypto_cs.c
@@ -205,11 +205,16 @@ cs_full_domain_hash (const struct GNUNET_CRYPTO_CsRPublic *r_dash,
205 memcpy (r_m_concat, r_dash, sizeof(struct GNUNET_CRYPTO_CsRPublic)); 205 memcpy (r_m_concat, r_dash, sizeof(struct GNUNET_CRYPTO_CsRPublic));
206 memcpy (r_m_concat + sizeof(struct GNUNET_CRYPTO_CsRPublic), msg, msg_len); 206 memcpy (r_m_concat + sizeof(struct GNUNET_CRYPTO_CsRPublic), msg, msg_len);
207 struct GNUNET_HashCode prehash; 207 struct GNUNET_HashCode prehash;
208 GNUNET_CRYPTO_hash (r_m_concat, r_m_concat_len, &prehash); 208
209 GNUNET_CRYPTO_hash (r_m_concat,
210 r_m_concat_len,
211 &prehash);
209 212
210 // modulus converted to MPI representation 213 // modulus converted to MPI representation
211 gcry_mpi_t l_mpi; 214 gcry_mpi_t l_mpi;
212 GNUNET_CRYPTO_mpi_scan_unsigned (&l_mpi, L_BIG_ENDIAN, sizeof(L_BIG_ENDIAN)); 215 GNUNET_CRYPTO_mpi_scan_unsigned (&l_mpi,
216 L_BIG_ENDIAN,
217 sizeof(L_BIG_ENDIAN));
213 218
214 // calculate full domain hash 219 // calculate full domain hash
215 gcry_mpi_t c_mpi; 220 gcry_mpi_t c_mpi;
@@ -224,7 +229,9 @@ cs_full_domain_hash (const struct GNUNET_CRYPTO_CsRPublic *r_dash,
224 229
225 // convert c from mpi 230 // convert c from mpi
226 unsigned char c_big_endian[256 / 8]; 231 unsigned char c_big_endian[256 / 8];
227 GNUNET_CRYPTO_mpi_print_unsigned (c_big_endian, sizeof(c_big_endian), c_mpi); 232 GNUNET_CRYPTO_mpi_print_unsigned (c_big_endian,
233 sizeof(c_big_endian),
234 c_mpi);
228 gcry_mpi_release (c_mpi); 235 gcry_mpi_release (c_mpi);
229 for (size_t i = 0; i<32; i++) 236 for (size_t i = 0; i<32; i++)
230 c->scalar.d[i] = c_big_endian[31 - i]; 237 c->scalar.d[i] = c_big_endian[31 - i];