aboutsummaryrefslogtreecommitdiff
path: root/src/util/perf_crypto_hash.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-23 19:51:12 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-23 19:51:12 +0000
commit9eba16d41ea69bb3a2ea990efe7739c174d99387 (patch)
tree8a8ea0b1af6dd1d63898e8ef61cb6dc0a5383dad /src/util/perf_crypto_hash.c
parent05ac77fefc694bb3bdf507c4836f9c41e874f1f7 (diff)
downloadgnunet-9eba16d41ea69bb3a2ea990efe7739c174d99387.tar.gz
gnunet-9eba16d41ea69bb3a2ea990efe7739c174d99387.zip
-simplify
Diffstat (limited to 'src/util/perf_crypto_hash.c')
-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