gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35439 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r35439 - gnunet/src/util
Date: Mon, 23 Mar 2015 23:07:38 +0100

Author: grothoff
Date: 2015-03-23 23:07:37 +0100 (Mon, 23 Mar 2015)
New Revision: 35439

Modified:
   gnunet/src/util/perf_crypto_asymmetric.c
Log:
-fix bad array init

Modified: gnunet/src/util/perf_crypto_asymmetric.c
===================================================================
--- gnunet/src/util/perf_crypto_asymmetric.c    2015-03-23 21:47:34 UTC (rev 
35438)
+++ gnunet/src/util/perf_crypto_asymmetric.c    2015-03-23 22:07:37 UTC (rev 
35439)
@@ -27,17 +27,21 @@
 #include "gnunet_util_lib.h"
 #include <gauger.h>
 
-struct GNUNET_TIME_Absolute start;
-const int l = 50;
+static struct GNUNET_TIME_Absolute start;
 
-struct TestSig {
+#define l 50
+
+struct TestSig
+{
   struct GNUNET_CRYPTO_EccSignaturePurpose purp;
   struct GNUNET_HashCode h;
   struct GNUNET_CRYPTO_EddsaSignature sig;
 };
 
+
 static void
-log_duration (const char *system, const char *description)
+log_duration (const char *system,
+              const char *description)
 {
   struct GNUNET_TIME_Relative t;
   char s[64];
@@ -45,12 +49,15 @@
   sprintf (s, "%6s %15s", system, description);
   t = GNUNET_TIME_absolute_get_duration (start);
   t = GNUNET_TIME_relative_divide (t, l);
-  FPRINTF (stdout, "%s: %10s\n", s,
-           GNUNET_STRINGS_relative_time_to_string(t, GNUNET_NO));
-
+  FPRINTF (stdout,
+           "%s: %10s\n",
+           s,
+           GNUNET_STRINGS_relative_time_to_string (t,
+                                                   GNUNET_NO));
   GAUGER ("UTIL", s, t.rel_value_us, "us");
 }
 
+
 int
 main (int argc, char *argv[])
 {
@@ -103,7 +110,7 @@
   log_duration ("ECDH", "get public");
 
   start = GNUNET_TIME_absolute_get();
-  for (i = 0; i < l; i+=2)
+  for (i = 0; i < l - 1; i+=2)
   {
     GNUNET_CRYPTO_ecc_ecdh (ecdhe[i], &dhpub[i+1], &sig[i].h);
     GNUNET_CRYPTO_ecc_ecdh (ecdhe[i+1], &dhpub[i], &sig[i+i].h);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]