diff options
Diffstat (limited to 'src/util/test_crypto_hash_context.c')
-rw-r--r-- | src/util/test_crypto_hash_context.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/util/test_crypto_hash_context.c b/src/util/test_crypto_hash_context.c index 778b70eec..d744b52b4 100644 --- a/src/util/test_crypto_hash_context.c +++ b/src/util/test_crypto_hash_context.c | |||
@@ -27,23 +27,22 @@ | |||
27 | 27 | ||
28 | #define LEN 1234 | 28 | #define LEN 1234 |
29 | 29 | ||
30 | int main() | 30 | int main () |
31 | { | 31 | { |
32 | char data[1234]; | 32 | char data[1234]; |
33 | struct GNUNET_HashCode hc1; | 33 | struct GNUNET_HashCode hc1; |
34 | struct GNUNET_HashCode hc2; | 34 | struct GNUNET_HashCode hc2; |
35 | struct GNUNET_HashContext *hctx; | 35 | struct GNUNET_HashContext *hctx; |
36 | 36 | ||
37 | memset(data, 42, LEN); | 37 | memset (data, 42, LEN); |
38 | 38 | ||
39 | hctx = GNUNET_CRYPTO_hash_context_start(); | 39 | hctx = GNUNET_CRYPTO_hash_context_start (); |
40 | GNUNET_CRYPTO_hash_context_read(hctx, data, LEN); | 40 | GNUNET_CRYPTO_hash_context_read (hctx, data, LEN); |
41 | GNUNET_CRYPTO_hash_context_finish(hctx, &hc1); | 41 | GNUNET_CRYPTO_hash_context_finish (hctx, &hc1); |
42 | 42 | ||
43 | GNUNET_CRYPTO_hash(data, LEN, &hc2); | 43 | GNUNET_CRYPTO_hash (data, LEN, &hc2); |
44 | 44 | ||
45 | if (0 == memcmp(&hc1, &hc2, sizeof(struct GNUNET_HashCode))) | 45 | if (0 == memcmp (&hc1, &hc2, sizeof(struct GNUNET_HashCode))) |
46 | return 0; | 46 | return 0; |
47 | return 1; | 47 | return 1; |
48 | } | 48 | } |
49 | |||