File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ valgrind_ctime_test
9
9
ecdh_example
10
10
ecdsa_example
11
11
schnorr_example
12
+ batch_example
12
13
* .exe
13
14
* .so
14
15
* .a
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ noinst_HEADERS += src/assumptions.h
50
50
noinst_HEADERS += src/util.h
51
51
noinst_HEADERS += src/scratch.h
52
52
noinst_HEADERS += src/scratch_impl.h
53
+ noinst_HEADERS += src/batch_impl.h
53
54
noinst_HEADERS += src/selftest.h
54
55
noinst_HEADERS += src/testrand.h
55
56
noinst_HEADERS += src/testrand_impl.h
@@ -150,6 +151,15 @@ if BUILD_WINDOWS
150
151
ecdsa_example_LDFLAGS += -lbcrypt
151
152
endif
152
153
TESTS += ecdsa_example
154
+ noinst_PROGRAMS += batch_example
155
+ batch_example_SOURCES = examples/batch.c
156
+ batch_example_CPPFLAGS = -I$(top_srcdir ) /include
157
+ batch_example_LDADD = libsecp256k1.la
158
+ batch_example_LDFLAGS = -static
159
+ if BUILD_WINDOWS
160
+ ecdsa_example_LDFLAGS += -lbcrypt
161
+ endif
162
+ TESTS += batch_example
153
163
if ENABLE_MODULE_ECDH
154
164
noinst_PROGRAMS += ecdh_example
155
165
ecdh_example_SOURCES = examples/ecdh.c
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+ #include <assert.h>
3
+ #include <string.h>
4
+
5
+ #include <secp256k1.h>
6
+
7
+ int main (void ) {
8
+ /* batch_context uses secp256k1_context only for the error callback function*/
9
+ secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_NONE );
10
+
11
+ secp256k1_batch_context * batch_ctx = secp256k1_batch_context_create (ctx , 3 );
12
+ assert (batch_ctx != NULL );
13
+ secp256k1_batch_context_destroy (ctx , batch_ctx );
14
+
15
+ secp256k1_context_destroy (ctx );
16
+
17
+ printf ("Batch example completed...\n" );
18
+ return 0 ;
19
+ }
You can’t perform that action at this time.
0 commit comments