File tree Expand file tree Collapse file tree 7 files changed +33
-23
lines changed Expand file tree Collapse file tree 7 files changed +33
-23
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ noinst_PROGRAMS =
105105if USE_BENCHMARK
106106noinst_PROGRAMS += bench bench_internal bench_ecmult
107107bench_SOURCES = src/bench.c
108- bench_LDADD = libsecp256k1.la
108+ bench_LDADD = $( COMMON_LIB ) $( PRECOMPUTED_LIB )
109109bench_CPPFLAGS = $(SECP_CONFIG_DEFINES )
110110bench_internal_SOURCES = src/bench_internal.c
111111bench_internal_LDADD = $(COMMON_LIB ) $(PRECOMPUTED_LIB )
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ unset(${PROJECT_NAME}_soversion)
126126
127127if (SECP256K1_BUILD_BENCHMARK)
128128 add_executable (bench bench.c)
129- target_link_libraries (bench secp256k1 )
129+ target_link_libraries (bench secp256k1_precomputed secp256k1_asm )
130130 add_executable (bench_internal bench_internal.c)
131131 target_link_libraries (bench_internal secp256k1_precomputed secp256k1_asm)
132132 add_executable (bench_ecmult bench_ecmult.c)
Original file line number Diff line number Diff line change 77#include <stdio.h>
88#include <stdlib.h>
99#include <string.h>
10+ #include <time.h>
1011
12+ #include "secp256k1.c"
1113#include "../include/secp256k1.h"
1214#include "util.h"
15+ #include "field_impl.h"
16+ #include "testrand_impl.h"
1317#include "bench.h"
1418
1519static void help (int default_iters ) {
Original file line number Diff line number Diff line change 1212#include <stdio.h>
1313#include <string.h>
1414
15- #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
16- # include <time.h>
17- #else
18- # include <sys/time.h>
19- #endif
20-
21- static int64_t gettime_i64 (void ) {
22- #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
23- /* C11 way to get wallclock time */
24- struct timespec tv ;
25- if (!timespec_get (& tv , TIME_UTC )) {
26- fputs ("timespec_get failed!" , stderr );
27- exit (EXIT_FAILURE );
28- }
29- return (int64_t )tv .tv_nsec / 1000 + (int64_t )tv .tv_sec * 1000000LL ;
30- #else
31- struct timeval tv ;
32- gettimeofday (& tv , NULL );
33- return (int64_t )tv .tv_usec + (int64_t )tv .tv_sec * 1000000LL ;
34- #endif
35- }
15+ #include "testutil.h"
3616
3717#define FP_EXP (6)
3818#define FP_MULT (1000000LL)
Original file line number Diff line number Diff line change 55 ***********************************************************************/
66#include <stdio.h>
77#include <stdlib.h>
8+ #include <time.h>
89
910#include "secp256k1.c"
1011#include "../include/secp256k1.h"
1516#include "group_impl.h"
1617#include "scalar_impl.h"
1718#include "ecmult_impl.h"
19+ #include "testrand_impl.h"
1820#include "bench.h"
1921
2022#define POINTS 32768
Original file line number Diff line number Diff line change 55 ***********************************************************************/
66#include <stdio.h>
77#include <stdlib.h>
8+ #include <time.h>
89
910#include "secp256k1.c"
1011#include "../include/secp256k1.h"
1617#include "group_impl.h"
1718#include "scalar_impl.h"
1819#include "ecmult_impl.h"
20+ #include "testrand_impl.h"
1921#include "bench.h"
2022
2123static void help (int default_iters ) {
Original file line number Diff line number Diff line change 1111#include "testrand.h"
1212#include "util.h"
1313
14+ #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
15+ # include <time.h>
16+ #else
17+ # include <sys/time.h>
18+ #endif
19+
20+ static int64_t gettime_i64 (void ) {
21+ #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
22+ /* C11 way to get wallclock time */
23+ struct timespec tv ;
24+ if (!timespec_get (& tv , TIME_UTC )) {
25+ fputs ("timespec_get failed!" , stderr );
26+ exit (EXIT_FAILURE );
27+ }
28+ return (int64_t )tv .tv_nsec / 1000 + (int64_t )tv .tv_sec * 1000000LL ;
29+ #else
30+ struct timeval tv ;
31+ gettimeofday (& tv , NULL );
32+ return (int64_t )tv .tv_usec + (int64_t )tv .tv_sec * 1000000LL ;
33+ #endif
34+ }
35+
1436static void testutil_random_fe (secp256k1_fe * x ) {
1537 unsigned char bin [32 ];
1638 do {
You can’t perform that action at this time.
0 commit comments