7 #ifndef SECP256K1_MODULE_SCHNORR_MAIN 8 #define SECP256K1_MODULE_SCHNORR_MAIN 27 unsigned int count = 0;
33 if (noncefp == NULL) {
39 unsigned char nonce32[32];
45 memset(nonce32, 0, 32);
86 memset(pubkey, 0,
sizeof(*pubkey));
105 if (noncefp == NULL) {
128 memset(pubnonce, 0,
sizeof(*pubnonce));
static int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context *ctx)
#define VERIFY_CHECK(cond)
static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *a)
SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_default
static int secp256k1_scalar_is_zero(const secp256k1_scalar *a)
static void secp256k1_pubkey_save(secp256k1_pubkey *pubkey, secp256k1_ge *ge)
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *bin, int *overflow)
static void secp256k1_schnorr_msghash_sha256(unsigned char *h32, const unsigned char *r32, const unsigned char *msg32)
int secp256k1_schnorr_recover(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *sig64, const unsigned char *msg32)
int secp256k1_schnorr_generate_nonce_pair(const secp256k1_context *ctx, secp256k1_pubkey *pubnonce, unsigned char *privnonce32, const unsigned char *sec32, const unsigned char *msg32, secp256k1_nonce_function noncefp, const void *noncedata)
static void secp256k1_sha256_finalize(secp256k1_sha256_t *hash, unsigned char *out32)
static void secp256k1_sha256_write(secp256k1_sha256_t *hash, const unsigned char *data, size_t size)
secp256k1_ecmult_gen_context ecmult_gen_ctx
static secp256k1_context * ctx
static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a)
int secp256k1_schnorr_partial_sign(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msg32, const unsigned char *sec32, const secp256k1_pubkey *pubnonce_others, const unsigned char *secnonce32)
static void secp256k1_sha256_initialize(secp256k1_sha256_t *hash)
secp256k1_ecmult_context ecmult_ctx
static void secp256k1_scalar_clear(secp256k1_scalar *r)
static int secp256k1_schnorr_sig_combine(unsigned char *sig64, size_t n, const unsigned char *const *sig64ins)
int secp256k1_schnorr_verify(const secp256k1_context *ctx, const unsigned char *sig64, const unsigned char *msg32, const secp256k1_pubkey *pubkey)
static int secp256k1_schnorr_sig_sign(const secp256k1_ecmult_gen_context *ctx, unsigned char *sig64, const secp256k1_scalar *key, const secp256k1_scalar *nonce, const secp256k1_ge *pubnonce, secp256k1_schnorr_msghash hash, const unsigned char *msg32)
int secp256k1_schnorr_partial_combine(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *const *sig64sin, size_t n)
int secp256k1_schnorr_sign(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void *noncedata)
int(* secp256k1_nonce_function)(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int attempt)
static int secp256k1_pubkey_load(const secp256k1_context *ctx, secp256k1_ge *ge, const secp256k1_pubkey *pubkey)
static int secp256k1_schnorr_sig_verify(const secp256k1_ecmult_context *ctx, const unsigned char *sig64, const secp256k1_ge *pubkey, secp256k1_schnorr_msghash hash, const unsigned char *msg32)
static int secp256k1_schnorr_sig_recover(const secp256k1_ecmult_context *ctx, const unsigned char *sig64, secp256k1_ge *pubkey, secp256k1_schnorr_msghash hash, const unsigned char *msg32)
static const unsigned char secp256k1_schnorr_algo16[17]
static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context *ctx)