aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_crypto_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r--src/include/gnunet_crypto_lib.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index a5a50e749..d11c6b58c 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -659,7 +659,7 @@ GNUNET_CRYPTO_hash (const void *block,
659/** 659/**
660 * Calculate the 'proof-of-work' hash (an expensive hash). 660 * Calculate the 'proof-of-work' hash (an expensive hash).
661 * 661 *
662 * @param salt salt to use in pow calculation 662 * @param salt salt for the hash. Must be crypto_pwhash_argon2id_SALTBYTES long.
663 * @param buf data to hash 663 * @param buf data to hash
664 * @param buf_len number of bytes in @a buf 664 * @param buf_len number of bytes in @a buf
665 * @param result where to write the resulting hash 665 * @param result where to write the resulting hash
@@ -874,12 +874,25 @@ GNUNET_CRYPTO_hash_to_aes_key (
874 * Obtain a bit from a hashcode. 874 * Obtain a bit from a hashcode.
875 * 875 *
876 * @param code the `struct GNUNET_HashCode` to index bit-wise 876 * @param code the `struct GNUNET_HashCode` to index bit-wise
877 * @param bit index into the hashcode, [0...159] 877 * @param bit index into the hashcode, [0...159] where 0 is the leftmost bit
878 * (bytes in code interpreted big endian)
878 * @return Bit \a bit from hashcode \a code, -1 for invalid index 879 * @return Bit \a bit from hashcode \a code, -1 for invalid index
879 */ 880 */
880int 881int
881GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, 882GNUNET_CRYPTO_hash_get_bit_ltr (const struct GNUNET_HashCode *code,
882 unsigned int bit); 883 unsigned int bit);
884
885
886/**
887 * Obtain a bit from a hashcode.
888 * @param code the GNUNET_CRYPTO_hash to index bit-wise
889 * @param bit index into the hashcode, [0...511] where 0 is the rightmost bit
890 * (bytes in code interpreted little endian)
891 * @return Bit \a bit from hashcode \a code, -1 for invalid index
892 */
893int
894GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code,
895 unsigned int bit);
883 896
884 897
885/** 898/**
@@ -2147,8 +2160,8 @@ GNUNET_CRYPTO_rsa_public_key_dup (const struct GNUNET_CRYPTO_RsaPublicKey *key);
2147 * @return 0 if the two are equal 2160 * @return 0 if the two are equal
2148 */ 2161 */
2149int 2162int
2150GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_RsaSignature *s1, 2163GNUNET_CRYPTO_rsa_signature_cmp (const struct GNUNET_CRYPTO_RsaSignature *s1,
2151 struct GNUNET_CRYPTO_RsaSignature *s2); 2164 const struct GNUNET_CRYPTO_RsaSignature *s2);
2152 2165
2153/** 2166/**
2154 * Compare the values of two private keys. 2167 * Compare the values of two private keys.
@@ -2158,8 +2171,8 @@ GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_RsaSignature *s1,
2158 * @return 0 if the two are equal 2171 * @return 0 if the two are equal
2159 */ 2172 */
2160int 2173int
2161GNUNET_CRYPTO_rsa_private_key_cmp (struct GNUNET_CRYPTO_RsaPrivateKey *p1, 2174GNUNET_CRYPTO_rsa_private_key_cmp (const struct GNUNET_CRYPTO_RsaPrivateKey *p1,
2162 struct GNUNET_CRYPTO_RsaPrivateKey *p2); 2175 const struct GNUNET_CRYPTO_RsaPrivateKey *p2);
2163 2176
2164 2177
2165/** 2178/**
@@ -2170,8 +2183,8 @@ GNUNET_CRYPTO_rsa_private_key_cmp (struct GNUNET_CRYPTO_RsaPrivateKey *p1,
2170 * @return 0 if the two are equal 2183 * @return 0 if the two are equal
2171 */ 2184 */
2172int 2185int
2173GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_RsaPublicKey *p1, 2186GNUNET_CRYPTO_rsa_public_key_cmp (const struct GNUNET_CRYPTO_RsaPublicKey *p1,
2174 struct GNUNET_CRYPTO_RsaPublicKey *p2); 2187 const struct GNUNET_CRYPTO_RsaPublicKey *p2);
2175 2188
2176 2189
2177/** 2190/**