aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/test_gnsrecord_crypto.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-10 01:19:34 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-10 01:19:34 +0200
commitb3bb9dcb3225fbbd9f04cb8d97f2b876b35104fd (patch)
tree1ed00a65b47197696623f0f4fe3c892b3e47c20f /src/gnsrecord/test_gnsrecord_crypto.c
parente1431b294bf72d436f2e36ea21adea0dc432ab75 (diff)
downloadgnunet-b3bb9dcb3225fbbd9f04cb8d97f2b876b35104fd.tar.gz
gnunet-b3bb9dcb3225fbbd9f04cb8d97f2b876b35104fd.zip
add gnscrypto benchmark
Diffstat (limited to 'src/gnsrecord/test_gnsrecord_crypto.c')
-rw-r--r--src/gnsrecord/test_gnsrecord_crypto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gnsrecord/test_gnsrecord_crypto.c b/src/gnsrecord/test_gnsrecord_crypto.c
index 1df3f3730..9ba303e66 100644
--- a/src/gnsrecord/test_gnsrecord_crypto.c
+++ b/src/gnsrecord/test_gnsrecord_crypto.c
@@ -54,7 +54,7 @@ create_record (int count)
54{ 54{
55 struct GNUNET_GNSRECORD_Data *rd; 55 struct GNUNET_GNSRECORD_Data *rd;
56 56
57 rd = GNUNET_malloc (count * sizeof (struct GNUNET_GNSRECORD_Data)); 57 rd = GNUNET_new_array (count, struct GNUNET_GNSRECORD_Data);
58 for (unsigned int c = 0; c < count; c++) 58 for (unsigned int c = 0; c < count; c++)
59 { 59 {
60 rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000; 60 rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000;
@@ -103,11 +103,10 @@ run (void *cls,
103 struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; 103 struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
104 struct GNUNET_HashCode query_pub; 104 struct GNUNET_HashCode query_pub;
105 struct GNUNET_HashCode query_priv; 105 struct GNUNET_HashCode query_priv;
106 struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get();
106 107
107 privkey = GNUNET_CRYPTO_ecdsa_key_create (); 108 privkey = GNUNET_CRYPTO_ecdsa_key_create ();
108 GNUNET_assert (NULL != privkey); 109 GNUNET_assert (NULL != privkey);
109 struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get();
110
111 /* get public key */ 110 /* get public key */
112 GNUNET_CRYPTO_ecdsa_key_get_public (privkey, 111 GNUNET_CRYPTO_ecdsa_key_get_public (privkey,
113 &pubkey); 112 &pubkey);
@@ -142,6 +141,7 @@ run (void *cls,
142 &rd_decrypt_cb, 141 &rd_decrypt_cb,
143 s_name)); 142 s_name));
144 GNUNET_free (block); 143 GNUNET_free (block);
144 GNUNET_free (privkey);
145} 145}
146 146
147 147