diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-01-20 19:08:47 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-01-20 19:08:47 +0000 |
commit | 29517cf1e5cb2e2a92c97f458ba4d3fe6716b1ee (patch) | |
tree | 1cd922f43818800d7279f16f8b9496a6016338f0 /src/include/gnunet_crypto_lib.h | |
parent | 95b657e52e52523cc7080406221896ed31327052 (diff) | |
download | gnunet-29517cf1e5cb2e2a92c97f458ba4d3fe6716b1ee.tar.gz gnunet-29517cf1e5cb2e2a92c97f458ba4d3fe6716b1ee.zip |
- make mpi scan/print public
- secretsharing key generation and decryption fixed
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index a82b2fdd6..a5ee98092 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -55,6 +55,7 @@ struct GNUNET_PeerIdentity; | |||
55 | 55 | ||
56 | #include "gnunet_common.h" | 56 | #include "gnunet_common.h" |
57 | #include "gnunet_scheduler_lib.h" | 57 | #include "gnunet_scheduler_lib.h" |
58 | #include <gcrypt.h> | ||
58 | 59 | ||
59 | 60 | ||
60 | /** | 61 | /** |
@@ -1232,6 +1233,35 @@ GNUNET_CRYPTO_ecdsa_public_key_derive (const struct GNUNET_CRYPTO_EcdsaPublicKey | |||
1232 | struct GNUNET_CRYPTO_EcdsaPublicKey *result); | 1233 | struct GNUNET_CRYPTO_EcdsaPublicKey *result); |
1233 | 1234 | ||
1234 | 1235 | ||
1236 | /** | ||
1237 | * Output the given MPI value to the given buffer in network | ||
1238 | * byte order. The MPI @a val may not be negative. | ||
1239 | * | ||
1240 | * @param buf where to output to | ||
1241 | * @param size number of bytes in @a buf | ||
1242 | * @param val value to write to @a buf | ||
1243 | */ | ||
1244 | void | ||
1245 | GNUNET_CRYPTO_mpi_print_unsigned (void *buf, | ||
1246 | size_t size, | ||
1247 | gcry_mpi_t val); | ||
1248 | |||
1249 | |||
1250 | /** | ||
1251 | * Convert data buffer into MPI value. | ||
1252 | * The buffer is interpreted as network | ||
1253 | * byte order, unsigned integer. | ||
1254 | * | ||
1255 | * @param result where to store MPI value (allocated) | ||
1256 | * @param data raw data (GCRYMPI_FMT_USG) | ||
1257 | * @param size number of bytes in @a data | ||
1258 | */ | ||
1259 | void | ||
1260 | GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result, | ||
1261 | const void *data, | ||
1262 | size_t size); | ||
1263 | |||
1264 | |||
1235 | #if 0 /* keep Emacsens' auto-indent happy */ | 1265 | #if 0 /* keep Emacsens' auto-indent happy */ |
1236 | { | 1266 | { |
1237 | #endif | 1267 | #endif |