aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/perf_crypto_hash.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/util/perf_crypto_hash.c b/src/util/perf_crypto_hash.c
index 8cf7f8748..930e99844 100644
--- a/src/util/perf_crypto_hash.c
+++ b/src/util/perf_crypto_hash.c
@@ -32,22 +32,13 @@
32static void 32static void
33perfHash () 33perfHash ()
34{ 34{
35 struct GNUNET_HashCode hc1; 35 struct GNUNET_HashCode hc;
36 struct GNUNET_HashCode hc2; 36 unsigned int i;
37 struct GNUNET_HashCode hc3; 37 char buf[64 * 1024];
38 int i;
39 char *buf;
40 38
41 buf = GNUNET_malloc (1024 * 64); 39 memset (buf, 1, sizeof (buf));
42 memset (buf, 1, 1024 * 64);
43 GNUNET_CRYPTO_hash ("foo", 3, &hc1);
44 for (i = 0; i < 1024; i++) 40 for (i = 0; i < 1024; i++)
45 { 41 GNUNET_CRYPTO_hash (buf, sizeof (buf), &hc);
46 GNUNET_CRYPTO_hash (&hc1, sizeof (struct GNUNET_HashCode), &hc2);
47 GNUNET_CRYPTO_hash (&hc2, sizeof (struct GNUNET_HashCode), &hc1);
48 GNUNET_CRYPTO_hash (buf, 1024 * 64, &hc3);
49 }
50 GNUNET_free (buf);
51} 42}
52 43
53 44