aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_mpi.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-19 13:12:47 +0000
committerChristian Grothoff <christian@grothoff.org>2015-03-19 13:12:47 +0000
commit56af9c4ba537faf4c0a4a3acf8447a49673eec64 (patch)
tree1a98bea2666fb86bef94d361199c3d01fde93db9 /src/util/crypto_mpi.c
parentd86130ceeb0e9f7ef7adf192b8f44bf94398b466 (diff)
downloadgnunet-56af9c4ba537faf4c0a4a3acf8447a49673eec64.tar.gz
gnunet-56af9c4ba537faf4c0a4a3acf8447a49673eec64.zip
-get test to work, but with ecdsa instead of eddsa
Diffstat (limited to 'src/util/crypto_mpi.c')
-rw-r--r--src/util/crypto_mpi.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c
index 65896584d..806a35da8 100644
--- a/src/util/crypto_mpi.c
+++ b/src/util/crypto_mpi.c
@@ -77,6 +77,7 @@ GNUNET_CRYPTO_mpi_print_unsigned (void *buf,
77 gcry_mpi_t val) 77 gcry_mpi_t val)
78{ 78{
79 size_t rsize; 79 size_t rsize;
80 int rc;
80 81
81 if (gcry_mpi_get_flag (val, GCRYMPI_FLAG_OPAQUE)) 82 if (gcry_mpi_get_flag (val, GCRYMPI_FLAG_OPAQUE))
82 { 83 {
@@ -98,9 +99,17 @@ GNUNET_CRYPTO_mpi_print_unsigned (void *buf,
98 /* Store regular MPIs as unsigned integers right aligned into 99 /* Store regular MPIs as unsigned integers right aligned into
99 the buffer. */ 100 the buffer. */
100 rsize = size; 101 rsize = size;
101 GNUNET_assert (0 == 102 if (0 !=
102 gcry_mpi_print (GCRYMPI_FMT_USG, buf, rsize, &rsize, 103 (rc = gcry_mpi_print (GCRYMPI_FMT_USG,
103 val)); 104 buf,
105 rsize, &rsize,
106 val)))
107 {
108 LOG_GCRY (GNUNET_ERROR_TYPE_ERROR,
109 "gcry_mpi_print",
110 rc);
111 GNUNET_assert (0);
112 }
104 adjust (buf, rsize, size); 113 adjust (buf, rsize, size);
105 } 114 }
106} 115}
@@ -126,7 +135,9 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result,
126 GCRYMPI_FMT_USG, 135 GCRYMPI_FMT_USG,
127 data, size, &size))) 136 data, size, &size)))
128 { 137 {
129 LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc); 138 LOG_GCRY (GNUNET_ERROR_TYPE_ERROR,
139 "gcry_mpi_scan",
140 rc);
130 GNUNET_assert (0); 141 GNUNET_assert (0);
131 } 142 }
132} 143}