aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac11
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/util/Makefile.am8
-rw-r--r--src/util/crypto_ecc.c7
4 files changed, 26 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index d37c2cb5f..10991e574 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1388,6 +1388,17 @@ fi
1388AC_SUBST(MONKEYPREFIX) 1388AC_SUBST(MONKEYPREFIX)
1389 1389
1390 1390
1391AC_MSG_CHECKING([whether to compile in benchmarks (currently for http and crypto)])
1392AC_ARG_ENABLE([benchmark],
1393 [AS_HELP_STRING([--enable-benchmark], [enable benchmarking])],
1394 [enable_benchmark=${enableval}],
1395 [enable_benchmark=no])
1396AC_MSG_RESULT($enable_benchmark)
1397AS_IF([test "x$enable_benchmark" = "xyes"],
1398 [AC_DEFINE_UNQUOTED(ENABLE_BENCHMARK,1,[Benchmarks are enabled])])
1399AM_CONDITIONAL([ENABLE_BENCHMARK], [test "x$enable_benchmark" = "xyes"])
1400
1401
1391# should expensive tests be run? 1402# should expensive tests be run?
1392AC_MSG_CHECKING(whether to run expensive tests) 1403AC_MSG_CHECKING(whether to run expensive tests)
1393AC_ARG_ENABLE([expensivetests], 1404AC_ARG_ENABLE([expensivetests],
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0dd50e62b..45471731c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -445,6 +445,7 @@ src/transport/transport-testing-loggers.c
445src/transport/transport-testing-main.c 445src/transport/transport-testing-main.c
446src/transport/transport-testing-send.c 446src/transport/transport-testing-send.c
447src/util/bandwidth.c 447src/util/bandwidth.c
448src/util/benchmark.c
448src/util/bio.c 449src/util/bio.c
449src/util/client.c 450src/util/client.c
450src/util/common_allocation.c 451src/util/common_allocation.c
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 4ae073c2c..b0f45b1da 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -40,6 +40,11 @@ if USE_COVERAGE
40 XLIB = -lgcov 40 XLIB = -lgcov
41endif 41endif
42 42
43if ENABLE_BENCHMARK
44 BENCHMARK = benchmark.c
45 PTHREAD = -lpthread
46endif
47
43w32cat_SOURCES = w32cat.c 48w32cat_SOURCES = w32cat.c
44 49
45gnunet_helper_w32_console_SOURCES = \ 50gnunet_helper_w32_console_SOURCES = \
@@ -60,6 +65,7 @@ test_common_logging_dummy_LDADD = \
60 65
61libgnunetutil_la_SOURCES = \ 66libgnunetutil_la_SOURCES = \
62 bandwidth.c \ 67 bandwidth.c \
68 $(BENCHMARK) \
63 bio.c \ 69 bio.c \
64 client.c \ 70 client.c \
65 common_allocation.c \ 71 common_allocation.c \
@@ -121,7 +127,7 @@ libgnunetutil_la_LIBADD = \
121 $(LIBGCRYPT_LIBS) \ 127 $(LIBGCRYPT_LIBS) \
122 $(LTLIBICONV) \ 128 $(LTLIBICONV) \
123 $(LTLIBINTL) \ 129 $(LTLIBINTL) \
124 -lltdl -lidn $(Z_LIBS) -lunistring $(XLIB) 130 -lltdl -lidn $(Z_LIBS) -lunistring $(XLIB) $(PTHREAD)
125 131
126libgnunetutil_la_LDFLAGS = \ 132libgnunetutil_la_LDFLAGS = \
127 $(GN_LIB_LDFLAGS) \ 133 $(GN_LIB_LDFLAGS) \
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index 07782b181..ed20fa2c8 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -25,6 +25,7 @@
25#include <gcrypt.h> 25#include <gcrypt.h>
26#include "gnunet_crypto_lib.h" 26#include "gnunet_crypto_lib.h"
27#include "gnunet_strings_lib.h" 27#include "gnunet_strings_lib.h"
28#include "benchmark.h"
28 29
29#define EXTRA_CHECKS 0 30#define EXTRA_CHECKS 0
30 31
@@ -873,6 +874,12 @@ GNUNET_CRYPTO_eddsa_sign (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
873 int rc; 874 int rc;
874 gcry_mpi_t rs[2]; 875 gcry_mpi_t rs[2];
875 876
877#if ENABLE_BENCHMARK
878 struct BenchmarkData *bd = get_benchmark_data ();
879 bd->eddsa_sign_count++;
880 printf("crypto eddsa sign\n");
881#endif
882
876 priv_sexp = decode_private_eddsa_key (priv); 883 priv_sexp = decode_private_eddsa_key (priv);
877 data = data_to_eddsa_value (purpose); 884 data = data_to_eddsa_value (purpose);
878 if (0 != (rc = gcry_pk_sign (&sig_sexp, data, priv_sexp))) 885 if (0 != (rc = gcry_pk_sign (&sig_sexp, data, priv_sexp)))