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/util/test_crypto_hash.c | |
parent | f5d7449313757e4a7360d7ca48292ecc4647911b (diff) | |
download | gnunet-669aa594e6a4d06e2d77cdba5365f6992695f547.tar.gz gnunet-669aa594e6a4d06e2d77cdba5365f6992695f547.zip |
fix bit counting mess
Diffstat (limited to 'src/util/test_crypto_hash.c')
-rw-r--r-- | src/util/test_crypto_hash.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/util/test_crypto_hash.c b/src/util/test_crypto_hash.c index 12e1324dd..d22e1f5d3 100644 --- a/src/util/test_crypto_hash.c +++ b/src/util/test_crypto_hash.c | |||
@@ -91,10 +91,15 @@ testArithmetic () | |||
91 | return 1; | 91 | return 1; |
92 | if (1 != GNUNET_CRYPTO_hash_xorcmp (&h1, &h2, &h2)) | 92 | if (1 != GNUNET_CRYPTO_hash_xorcmp (&h1, &h2, &h2)) |
93 | return 1; | 93 | return 1; |
94 | memset (&d, 0xF0, sizeof(d)); | 94 | memset (&d, 0x40, sizeof(d)); |
95 | if (0 != GNUNET_CRYPTO_hash_get_bit (&d, 3)) | 95 | if (0 != GNUNET_CRYPTO_hash_get_bit_rtl (&d, 3)) |
96 | return 1; | 96 | return 1; |
97 | if (1 != GNUNET_CRYPTO_hash_get_bit (&d, 6)) | 97 | if (1 != GNUNET_CRYPTO_hash_get_bit_rtl (&d, 6)) |
98 | return 1; | ||
99 | memset (&d, 0x02, sizeof(d)); | ||
100 | if (0 != GNUNET_CRYPTO_hash_get_bit_ltr (&d, 3)) | ||
101 | return 1; | ||
102 | if (1 != GNUNET_CRYPTO_hash_get_bit_ltr (&d, 6)) | ||
98 | return 1; | 103 | return 1; |
99 | memset (&d, 0, sizeof(d)); | 104 | memset (&d, 0, sizeof(d)); |
100 | GNUNET_CRYPTO_hash_to_aes_key (&d, &skey, &iv); | 105 | GNUNET_CRYPTO_hash_to_aes_key (&d, &skey, &iv); |