aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/Makefile.am8
-rw-r--r--src/util/crypto_ecc.c7
2 files changed, 14 insertions, 1 deletions
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)))