23 const unsigned char **
pk;
24 const unsigned char **
sigs;
25 const unsigned char **
msgs;
31 unsigned char msg[
MSGLEN] = {0};
32 unsigned char sig[64];
34 for (i = 0; i <
iters; i++) {
45 for (i = 0; i <
iters; i++) {
59 data.
pk = (
const unsigned char **)
malloc(
iters *
sizeof(
unsigned char *));
60 data.
msgs = (
const unsigned char **)
malloc(
iters *
sizeof(
unsigned char *));
61 data.
sigs = (
const unsigned char **)
malloc(
iters *
sizeof(
unsigned char *));
64 for (i = 0; i <
iters; i++) {
67 unsigned char *
sig = (
unsigned char *)
malloc(64);
72 msg[1] =
sk[1] = i >> 8;
73 msg[2] =
sk[2] = i >> 16;
74 msg[3] =
sk[3] = i >> 24;
92 for (i = 0; i <
iters; i++) {
94 free((
void *)data.
pk[i]);
95 free((
void *)data.
msgs[i]);
96 free((
void *)data.
sigs[i]);
static void run_benchmark(char *name, void(*benchmark)(void *), void(*setup)(void *), void(*teardown)(void *), void *data, int count, int iter)
void bench_schnorrsig_sign(void *arg, int iters)
void bench_schnorrsig_verify(void *arg, int iters)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
int get_iters(int default_iters)
#define SECP256K1_CONTEXT_SIGN
SECP256K1_API secp256k1_context * secp256k1_context_create(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
Create a secp256k1 context object (in dynamically allocated memory).
#define SECP256K1_CONTEXT_VERIFY
Flags to pass to secp256k1_context_create, secp256k1_context_preallocated_size, and secp256k1_context...
SECP256K1_API void secp256k1_context_destroy(secp256k1_context *ctx)
Destroy a secp256k1 context object (created in dynamically allocated memory).
SECP256K1_API int secp256k1_schnorrsig_sign_custom(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msg, size_t msglen, const secp256k1_keypair *keypair, secp256k1_schnorrsig_extraparams *extraparams) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(5)
Create a Schnorr signature with a more flexible API.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorrsig_verify(const secp256k1_context *ctx, const unsigned char *sig64, const unsigned char *msg, size_t msglen, const secp256k1_xonly_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(5)
Verify a Schnorr signature.
const unsigned char ** sigs
const unsigned char ** pk
const unsigned char ** msgs
const secp256k1_keypair ** keypairs
Opaque data structure that holds a keypair consisting of a secret and a public key.
Opaque data structure that holds a parsed and valid "x-only" public key.