Bitcoin ABC 0.30.5
P2P Digital Currency
secp256k1_schnorrsig.h
Go to the documentation of this file.
1#ifndef SECP256K1_SCHNORRSIG_H
2#define SECP256K1_SCHNORRSIG_H
3
4#include "secp256k1.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
42 unsigned char *nonce32,
43 const unsigned char *msg,
44 size_t msglen,
45 const unsigned char *key32,
46 const unsigned char *xonly_pk32,
47 const unsigned char *algo,
48 size_t algolen,
49 void *data
50);
51
65
82typedef struct {
83 unsigned char magic[4];
85 void* ndata;
87
88#define SECP256K1_SCHNORRSIG_EXTRAPARAMS_MAGIC { 0xda, 0x6f, 0xb3, 0x8c }
89#define SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT {\
90 SECP256K1_SCHNORRSIG_EXTRAPARAMS_MAGIC,\
91 NULL,\
92 NULL\
93}
94
119 const secp256k1_context* ctx,
120 unsigned char *sig64,
121 const unsigned char *msg32,
122 const secp256k1_keypair *keypair,
123 unsigned char *aux_rand32
125
140 const secp256k1_context* ctx,
141 unsigned char *sig64,
142 const unsigned char *msg,
143 size_t msglen,
144 const secp256k1_keypair *keypair,
147
159 const secp256k1_context* ctx,
160 const unsigned char *sig64,
161 const unsigned char *msg,
162 size_t msglen,
163 const secp256k1_xonly_pubkey *pubkey
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* SECP256K1_SCHNORRSIG_H */
secp256k1_context * ctx
#define SECP256K1_ARG_NONNULL(_x)
Definition: secp256k1.h:158
#define SECP256K1_API
Definition: secp256k1.h:143
#define SECP256K1_WARN_UNUSED_RESULT
Warning attributes NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out...
Definition: secp256k1.h:153
int(* secp256k1_nonce_function_hardened)(unsigned char *nonce32, const unsigned char *msg, size_t msglen, const unsigned char *key32, const unsigned char *xonly_pk32, const unsigned char *algo, size_t algolen, void *data)
This module implements a variant of Schnorr signatures compliant with Bitcoin Improvement Proposal 34...
SECP256K1_API int secp256k1_schnorrsig_sign(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msg32, const secp256k1_keypair *keypair, unsigned char *aux_rand32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Create a Schnorr signature.
Definition: main_impl.h:188
SECP256K1_API const secp256k1_nonce_function_hardened secp256k1_nonce_function_bip340
An implementation of the nonce generation function as defined in Bitcoin Improvement Proposal 340 "Sc...
Definition: main_impl.h:92
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.
Definition: main_impl.h:192
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.
Definition: main_impl.h:207
Opaque data structure that holds a keypair consisting of a secret and a public key.
Data structure that contains additional arguments for schnorrsig_sign_custom.
secp256k1_nonce_function_hardened noncefp
Opaque data structure that holds a parsed and valid "x-only" public key.