100 unsigned char *nonce32,
101 const unsigned char *msg32,
102 const unsigned char *key32,
103 const unsigned char *algo16,
108 # if !defined(SECP256K1_GNUC_PREREQ) 109 # if defined(__GNUC__)&&defined(__GNUC_MINOR__) 110 # define SECP256K1_GNUC_PREREQ(_maj,_min) \ 111 ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) 113 # define SECP256K1_GNUC_PREREQ(_maj,_min) 0 117 # if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) 118 # if SECP256K1_GNUC_PREREQ(2,7) 119 # define SECP256K1_INLINE __inline__ 120 # elif (defined(_MSC_VER)) 121 # define SECP256K1_INLINE __inline 123 # define SECP256K1_INLINE 126 # define SECP256K1_INLINE inline 129 #ifndef SECP256K1_API 131 # ifdef SECP256K1_BUILD 132 # define SECP256K1_API __declspec(dllexport) 134 # define SECP256K1_API 136 # elif defined(__GNUC__) && defined(SECP256K1_BUILD) 137 # define SECP256K1_API __attribute__ ((visibility ("default"))) 139 # define SECP256K1_API 146 # if defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4) 147 # define SECP256K1_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) 149 # define SECP256K1_WARN_UNUSED_RESULT 151 # if !defined(SECP256K1_BUILD) && defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4) 152 # define SECP256K1_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) 154 # define SECP256K1_ARG_NONNULL(_x) 158 #define SECP256K1_FLAGS_TYPE_MASK ((1 << 8) - 1) 159 #define SECP256K1_FLAGS_TYPE_CONTEXT (1 << 0) 160 #define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1) 162 #define SECP256K1_FLAGS_BIT_CONTEXT_VERIFY (1 << 8) 163 #define SECP256K1_FLAGS_BIT_CONTEXT_SIGN (1 << 9) 164 #define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8) 167 #define SECP256K1_CONTEXT_VERIFY (SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_VERIFY) 168 #define SECP256K1_CONTEXT_SIGN (SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_SIGN) 169 #define SECP256K1_CONTEXT_NONE (SECP256K1_FLAGS_TYPE_CONTEXT) 172 #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION) 173 #define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION) 176 #define SECP256K1_TAG_PUBKEY_EVEN 0x02 177 #define SECP256K1_TAG_PUBKEY_ODD 0x03 178 #define SECP256K1_TAG_PUBKEY_UNCOMPRESSED 0x04 179 #define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06 180 #define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07 240 void (*fun)(const
char* message,
void*
data),
262 void (*fun)(const
char* message,
void*
data),
303 const
unsigned char *input,
324 unsigned char *output,
348 const
unsigned char *input64
369 const
unsigned char *input,
386 unsigned char *output,
402 unsigned char *output64,
427 const
unsigned char *msg32,
505 const
unsigned char *msg32,
506 const
unsigned char *seckey,
520 const
unsigned char *seckey
534 const
unsigned char *seckey
545 unsigned char *seckey
570 unsigned char *seckey,
571 const
unsigned char *tweak
587 const
unsigned char *tweak
599 unsigned char *seckey,
600 const
unsigned char *tweak
614 const
unsigned char *tweak
643 const
unsigned char *seed32
void * data[SECP256K1_SCRATCH_MAX_FRAMES]
Definition: scratch.h:15
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:501
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(const secp256k1_context *ctx, unsigned char *seckey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:525
SECP256K1_API void secp256k1_context_set_illegal_callback(secp256k1_context *ctx, void(*fun)(const char *message, void *data), const void *data) SECP256K1_ARG_NONNULL(1)
Definition: secp256k1.c:111
SECP256K1_API int secp256k1_ecdsa_signature_serialize_compact(const secp256k1_context *ctx, unsigned char *output64, const secp256k1_ecdsa_signature *sig) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:282
#define SECP256K1_WARN_UNUSED_RESULT
Definition: secp256k1.h:149
SECP256K1_API int secp256k1_ecdsa_signature_normalize(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sigout, const secp256k1_ecdsa_signature *sigin) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:295
SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_default
Definition: secp256k1.c:367
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(secp256k1_context *ctx, const unsigned char *seed32) SECP256K1_ARG_NONNULL(1)
Definition: secp256k1.c:571
SECP256K1_API int secp256k1_ec_pubkey_serialize(const secp256k1_context *ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey *pubkey, unsigned int flags) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Definition: secp256k1.c:186
Definition: secp256k1.c:52
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(const secp256k1_context *ctx, unsigned char *seckey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:478
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_negate(const secp256k1_context *ctx, unsigned char *seckey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Definition: secp256k1.c:451
SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_rfc6979
Definition: secp256k1.c:366
SECP256K1_API void secp256k1_context_destroy(secp256k1_context *ctx)
Definition: secp256k1.c:101
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:428
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(const secp256k1_context *ctx, const unsigned char *seckey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Definition: secp256k1.c:415
static secp256k1_context * ctx
Definition: tests.c:46
SECP256K1_API int secp256k1_ecdsa_sign(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void *ndata) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Definition: secp256k1.c:369
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:547
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *input, size_t inputlen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:171
Definition: secp256k1.h:79
SECP256K1_API void secp256k1_context_set_error_callback(secp256k1_context *ctx, void(*fun)(const char *message, void *data), const void *data) SECP256K1_ARG_NONNULL(1)
Definition: secp256k1.c:120
SECP256K1_API int secp256k1_ecdsa_signature_parse_der(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const unsigned char *input, size_t inputlen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:233
#define SECP256K1_ARG_NONNULL(_x)
Definition: secp256k1.h:154
int flags
Definition: bitcoin-tx.cpp:507
std::vector< uint8_t > data
Definition: bech32.cpp:10
SECP256K1_API secp256k1_context * secp256k1_context_clone(const secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
Definition: secp256k1.c:92
SECP256K1_API int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context *ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature *sig) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Definition: secp256k1.c:270
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_negate(const secp256k1_context *ctx, secp256k1_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Definition: secp256k1.c:463
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
SECP256K1_API int secp256k1_ecdsa_signature_parse_compact(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const unsigned char *input64) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:249
SECP256K1_API const secp256k1_context * secp256k1_context_no_precomp
Definition: secp256k1.c:65
#define SECP256K1_API
Definition: secp256k1.h:139
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(const secp256k1_context *ctx, secp256k1_pubkey *out, const secp256k1_pubkey *const *ins, size_t n) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition: secp256k1.c:579
SECP256K1_API void secp256k1_scratch_space_destroy(secp256k1_scratch_space *scratch)
Definition: secp256k1.c:134
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space * secp256k1_scratch_space_create(const secp256k1_context *ctx, size_t max_size) SECP256K1_ARG_NONNULL(1)
Definition: secp256k1.c:129
SECP256K1_API secp256k1_context * secp256k1_context_create(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
Definition: secp256k1.c:67
Definition: secp256k1.h:66
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(const secp256k1_context *ctx, const secp256k1_ecdsa_signature *sig, const unsigned char *msg32, const secp256k1_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Definition: secp256k1.c:314