diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-08-18 11:08:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-08-18 11:08:39 +0200 |
commit | 5570a5d03703c9e864544febe9fbaa6ccfef83ee (patch) | |
tree | 23b770538a53fb1c9dd09c1a36ee25bf435c6652 /src/include | |
parent | 53cc51e0df6bcf1417ef058e0d5843c7f89933d5 (diff) | |
parent | 2bce42e5b3630f3835f401e5eeed23a56b7bd875 (diff) | |
download | gnunet-5570a5d03703c9e864544febe9fbaa6ccfef83ee.tar.gz gnunet-5570a5d03703c9e864544febe9fbaa6ccfef83ee.zip |
Merge branch 'master' of git+ssh://gnunet.org/gnunet
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 12 |
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..8c3f4f058 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 | */ | ||
674 | struct GNUNET_CRYPTO_PowSalt | ||
675 | { | ||
676 | char 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 | */ |
678 | void | 688 | void |
679 | GNUNET_CRYPTO_pow_hash (const char *salt, | 689 | GNUNET_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); |