69 size_t outputlen = 33;
72 unsigned char msg[32];
73 unsigned char sig[74];
74 unsigned char spubkey[33];
75#ifdef ENABLE_MODULE_RECOVERY
79#ifdef ENABLE_MODULE_EXTRAKEYS
83 for (i = 0; i < 32; i++) {
88 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
91 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
96 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
99 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
103#ifdef ENABLE_MODULE_ECDH
105 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
107 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
111#ifdef ENABLE_MODULE_RECOVERY
113 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
115 VALGRIND_MAKE_MEM_DEFINED(&recoverable_signature,
sizeof(recoverable_signature));
116 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
119 CHECK(recid >= 0 && recid <= 3);
122 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
124 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
127 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
129 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
132 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
133 VALGRIND_MAKE_MEM_UNDEFINED(msg, 32);
135 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
138 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
139 VALGRIND_MAKE_MEM_UNDEFINED(msg, 32);
141 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
145#ifdef ENABLE_MODULE_EXTRAKEYS
146 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
148 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
152 VALGRIND_MAKE_MEM_DEFINED(msg, 32);
154 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
157 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
158 VALGRIND_MAKE_MEM_UNDEFINED(&keypair,
sizeof(keypair));
160 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
164#ifdef ENABLE_MODULE_SCHNORRSIG
165 VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
167 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
170 VALGRIND_MAKE_MEM_DEFINED(&
ret,
sizeof(
ret));
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)
SECP256K1_API int secp256k1_ecdsa_sign(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const unsigned char *msghash32, 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)
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)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(const secp256k1_context *ctx, unsigned char *output, const secp256k1_pubkey *pubkey, const unsigned char *seckey, secp256k1_ecdh_hash_function hashfp, void *data) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
SECP256K1_API int secp256k1_ecdsa_recoverable_signature_serialize_compact(const secp256k1_context *ctx, unsigned char *output64, int *recid, const secp256k1_ecdsa_recoverable_signature *sig) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
SECP256K1_API int secp256k1_ecdsa_sign_recoverable(const secp256k1_context *ctx, secp256k1_ecdsa_recoverable_signature *sig, const unsigned char *msghash32, 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)
SECP256K1_API int secp256k1_schnorrsig_sign32(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msg32, const secp256k1_keypair *keypair, const unsigned char *aux_rand32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)