diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-05-26 08:52:28 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-05-26 08:52:28 +0200 |
commit | 669aa594e6a4d06e2d77cdba5365f6992695f547 (patch) | |
tree | e0d90613b2038e17c0c801444a1ad9c20163b59d /src/include | |
parent | f5d7449313757e4a7360d7ca48292ecc4647911b (diff) | |
download | gnunet-669aa594e6a4d06e2d77cdba5365f6992695f547.tar.gz gnunet-669aa594e6a4d06e2d77cdba5365f6992695f547.zip |
fix bit counting mess
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index a5a50e749..e880bd887 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -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 | */ |
880 | int | 881 | int |
881 | GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, | 882 | GNUNET_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 | */ | ||
893 | int | ||
894 | GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code, | ||
895 | unsigned int bit); | ||
883 | 896 | ||
884 | 897 | ||
885 | /** | 898 | /** |