aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-17 14:45:46 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-17 14:46:08 +0200
commit6f2ee9eb3c3642147fe381976ffeb88d0c3288e5 (patch)
tree26a66a4d123c667aa88d2aa5595add21390d53a8 /src/include
parentf6acda6d3299bda2e6ea6e38bef5cabfb01b8ab9 (diff)
downloadgnunet-6f2ee9eb3c3642147fe381976ffeb88d0c3288e5.tar.gz
gnunet-6f2ee9eb3c3642147fe381976ffeb88d0c3288e5.zip
clean up GNUNET_CRYPTO_pow_hash API
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_crypto_lib.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index f8eef5406..6d3725aa0 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -50,6 +50,7 @@ extern "C" {
50#endif 50#endif
51#endif 51#endif
52 52
53#include <sodium.h>
53 54
54/** 55/**
55 * The identity of the host (wraps the signing key of the peer). 56 * The identity of the host (wraps the signing key of the peer).
@@ -668,6 +669,15 @@ GNUNET_CRYPTO_hash (const void *block,
668 669
669 670
670/** 671/**
672 * Value for a salt for #GNUNET_CRYPTO_pow_hash().
673 */
674struct GNUNET_CRYPTO_PowSalt
675{
676 uint8_t salt[crypto_pwhash_argon2id_SALTBYTES];
677};
678
679
680/**
671 * Calculate the 'proof-of-work' hash (an expensive hash). 681 * Calculate the 'proof-of-work' hash (an expensive hash).
672 * 682 *
673 * @param salt salt for the hash. Must be crypto_pwhash_argon2id_SALTBYTES long. 683 * @param salt salt for the hash. Must be crypto_pwhash_argon2id_SALTBYTES long.
@@ -676,7 +686,7 @@ GNUNET_CRYPTO_hash (const void *block,
676 * @param result where to write the resulting hash 686 * @param result where to write the resulting hash
677 */ 687 */
678void 688void
679GNUNET_CRYPTO_pow_hash (const char *salt, 689GNUNET_CRYPTO_pow_hash (const struct GNUNET_CRYPTO_PowSalt *salt,
680 const void *buf, 690 const void *buf,
681 size_t buf_len, 691 size_t buf_len,
682 struct GNUNET_HashCode *result); 692 struct GNUNET_HashCode *result);