diff options
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 75aabe75f..6e37266a2 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -407,12 +407,25 @@ GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, | |||
407 | 407 | ||
408 | /** | 408 | /** |
409 | * Convert ASCII encoding back to GNUNET_CRYPTO_hash | 409 | * Convert ASCII encoding back to GNUNET_CRYPTO_hash |
410 | * | ||
410 | * @param enc the encoding | 411 | * @param enc the encoding |
412 | * @param enclen number of characters in 'enc' (without 0-terminator, which can be missing) | ||
411 | * @param result where to store the GNUNET_CRYPTO_hash code | 413 | * @param result where to store the GNUNET_CRYPTO_hash code |
412 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding | 414 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding |
413 | */ | 415 | */ |
414 | int | 416 | int |
415 | GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | 417 | GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, |
418 | GNUNET_HashCode * result); | ||
419 | |||
420 | |||
421 | /** | ||
422 | * Convert ASCII encoding back to GNUNET_CRYPTO_hash | ||
423 | * @param enc the encoding | ||
424 | * @param result where to store the GNUNET_CRYPTO_hash code | ||
425 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding | ||
426 | */ | ||
427 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ | ||
428 | GNUNET_CRYPTO_hash_from_string2 (enc, strlen(enc), result) | ||
416 | 429 | ||
417 | 430 | ||
418 | /** | 431 | /** |