7 #ifndef SECP256K1_MODULE_RECOVERY_MAIN_H 8 #define SECP256K1_MODULE_RECOVERY_MAIN_H 24 *recid = sig->
data[64];
35 sig->
data[64] = recid;
55 memset(sig, 0,
sizeof(*sig));
88 unsigned char brx[32];
134 if (noncefp == NULL) {
141 unsigned char nonce32[32];
142 unsigned int count = 0;
145 ret = noncefp(nonce32, msg32, seckey, NULL, (
void*)noncedata,
count);
157 memset(nonce32, 0, 32);
165 memset(signature, 0,
sizeof(*signature));
188 memset(pubkey, 0,
sizeof(*pubkey));
static void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b)
static int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context *ctx)
#define VERIFY_CHECK(cond)
Definition: util.h:67
static int secp256k1_gej_is_infinity(const secp256k1_gej *a)
Definition: field_10x26.h:12
SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_default
Definition: secp256k1.c:367
static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar *r, secp256k1_scalar *s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid)
static void secp256k1_ecdsa_recoverable_signature_load(const secp256k1_context *ctx, secp256k1_scalar *r, secp256k1_scalar *s, int *recid, const secp256k1_ecdsa_recoverable_signature *sig)
Definition: main_impl.h:12
static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a)
Definition: group_impl.h:113
int secp256k1_ecdsa_recoverable_signature_convert(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const secp256k1_ecdsa_recoverable_signature *sigin)
Definition: main_impl.h:74
Definition: secp256k1_recovery.h:24
int secp256k1_ecdsa_recoverable_signature_serialize_compact(const secp256k1_context *ctx, unsigned char *output64, int *recid, const secp256k1_ecdsa_recoverable_signature *sig)
Definition: main_impl.h:60
static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a)
static int secp256k1_scalar_is_zero(const secp256k1_scalar *a)
static void secp256k1_pubkey_save(secp256k1_pubkey *pubkey, secp256k1_ge *ge)
Definition: secp256k1.c:157
static void secp256k1_ecmult(const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng)
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *bin, int *overflow)
Definition: secp256k1.c:52
static const secp256k1_fe secp256k1_ecdsa_const_order_as_fe
Definition: ecdsa_impl.h:31
static void secp256k1_ecdsa_signature_save(secp256k1_ecdsa_signature *sig, const secp256k1_scalar *r, const secp256k1_scalar *s)
Definition: secp256k1.c:223
int secp256k1_ecdsa_recoverable_signature_parse_compact(const secp256k1_context *ctx, secp256k1_ecdsa_recoverable_signature *sig, const unsigned char *input64, int recid)
Definition: main_impl.h:38
static void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a)
m
Definition: linearize-data.py:266
secp256k1_ecmult_gen_context ecmult_gen_ctx
Definition: secp256k1.c:54
#define ARG_CHECK(cond)
Definition: secp256k1.c:22
static secp256k1_context * ctx
Definition: tests.c:46
int secp256k1_ecdsa_recover(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msg32)
Definition: main_impl.h:170
secp256k1_ecmult_context ecmult_ctx
Definition: secp256k1.c:53
static void secp256k1_scalar_clear(secp256k1_scalar *r)
Definition: secp256k1.h:79
Definition: scalar_4x64.h:13
static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar *a)
static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd)
int secp256k1_ecdsa_sign_recoverable(const secp256k1_context *ctx, secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void *noncedata)
Definition: main_impl.h:123
static int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a)
static int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b)
int(* secp256k1_nonce_function)(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int attempt)
Definition: secp256k1.h:99
static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *a)
unsigned char data[65]
Definition: secp256k1_recovery.h:25
void * memcpy(void *a, const void *b, size_t c)
Definition: glibc_compat.cpp:18
static int count
Definition: tests.c:45
static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a)
static int secp256k1_ecdsa_sig_recover(const secp256k1_ecmult_context *ctx, const secp256k1_scalar *sigr, const secp256k1_scalar *sigs, secp256k1_ge *pubkey, const secp256k1_scalar *message, int recid)
Definition: main_impl.h:87
static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context *ctx)
static void secp256k1_ecdsa_recoverable_signature_save(secp256k1_ecdsa_recoverable_signature *sig, const secp256k1_scalar *r, const secp256k1_scalar *s, int recid)
Definition: main_impl.h:27
static const secp256k1_fe secp256k1_ecdsa_const_p_minus_order
Definition: ecdsa_impl.h:45
Definition: secp256k1.h:66