Bitcoin Core
28.99.0
P2P Digital Currency
src
secp256k1
include
secp256k1_extrakeys.h
Go to the documentation of this file.
1
#ifndef SECP256K1_EXTRAKEYS_H
2
#define SECP256K1_EXTRAKEYS_H
3
4
#include "
secp256k1.h
"
5
6
#ifdef __cplusplus
7
extern
"C"
{
8
#endif
9
22
typedef
struct
secp256k1_xonly_pubkey
{
23
unsigned
char
data
[64];
24
}
secp256k1_xonly_pubkey
;
25
33
typedef
struct
secp256k1_keypair
{
34
unsigned
char
data
[96];
35
}
secp256k1_keypair
;
36
47
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_parse
(
48
const
secp256k1_context
*ctx,
49
secp256k1_xonly_pubkey
*pubkey,
50
const
unsigned
char
*input32
51
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
52
61
SECP256K1_API
int
secp256k1_xonly_pubkey_serialize
(
62
const
secp256k1_context
*ctx,
63
unsigned
char
*output32,
64
const
secp256k1_xonly_pubkey
*pubkey
65
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
66
76
SECP256K1_API
int
secp256k1_xonly_pubkey_cmp
(
77
const
secp256k1_context
*ctx,
78
const
secp256k1_xonly_pubkey
*pk1,
79
const
secp256k1_xonly_pubkey
*pk2
80
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
81
93
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_from_pubkey
(
94
const
secp256k1_context
*ctx,
95
secp256k1_xonly_pubkey
*xonly_pubkey,
96
int
*pk_parity,
97
const
secp256k1_pubkey
*pubkey
98
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(4);
99
120
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_tweak_add
(
121
const
secp256k1_context
*ctx,
122
secp256k1_pubkey
*output_pubkey,
123
const
secp256k1_xonly_pubkey
*internal_pubkey,
124
const
unsigned
char
*tweak32
125
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3)
SECP256K1_ARG_NONNULL
(4);
126
150
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_tweak_add_check
(
151
const
secp256k1_context
*ctx,
152
const
unsigned
char
*tweaked_pubkey32,
153
int
tweaked_pk_parity,
154
const
secp256k1_xonly_pubkey
*internal_pubkey,
155
const
unsigned
char
*tweak32
156
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(4)
SECP256K1_ARG_NONNULL
(5);
157
169
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_create
(
170
const
secp256k1_context
*ctx,
171
secp256k1_keypair
*keypair,
172
const
unsigned
char
*seckey
173
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
174
182
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_sec
(
183
const
secp256k1_context
*ctx,
184
unsigned
char
*seckey,
185
const
secp256k1_keypair
*keypair
186
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
187
195
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_pub
(
196
const
secp256k1_context
*ctx,
197
secp256k1_pubkey
*pubkey,
198
const
secp256k1_keypair
*keypair
199
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
200
214
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_xonly_pub
(
215
const
secp256k1_context
*ctx,
216
secp256k1_xonly_pubkey
*pubkey,
217
int
*pk_parity,
218
const
secp256k1_keypair
*keypair
219
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(4);
220
240
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_xonly_tweak_add
(
241
const
secp256k1_context
*ctx,
242
secp256k1_keypair
*keypair,
243
const
unsigned
char
*tweak32
244
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
245
246
#ifdef __cplusplus
247
}
248
#endif
249
250
#endif
/* SECP256K1_EXTRAKEYS_H */
secp256k1.h
SECP256K1_ARG_NONNULL
#define SECP256K1_ARG_NONNULL(_x)
Definition:
secp256k1.h:176
SECP256K1_API
#define SECP256K1_API
Definition:
secp256k1.h:161
SECP256K1_WARN_UNUSED_RESULT
#define SECP256K1_WARN_UNUSED_RESULT
Definition:
secp256k1.h:171
secp256k1_xonly_pubkey_cmp
SECP256K1_API int secp256k1_xonly_pubkey_cmp(const secp256k1_context *ctx, const secp256k1_xonly_pubkey *pk1, const secp256k1_xonly_pubkey *pk2) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Compare two x-only public keys using lexicographic order.
Definition:
main_impl.h:59
secp256k1_xonly_pubkey
struct secp256k1_xonly_pubkey secp256k1_xonly_pubkey
Opaque data structure that holds a parsed and valid "x-only" public key.
secp256k1_keypair_pub
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_pub(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const secp256k1_keypair *keypair) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Get the public key from a keypair.
Definition:
main_impl.h:224
secp256k1_keypair_sec
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_sec(const secp256k1_context *ctx, unsigned char *seckey, const secp256k1_keypair *keypair) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Get the secret key from a keypair.
Definition:
main_impl.h:214
secp256k1_xonly_pubkey_serialize
SECP256K1_API int secp256k1_xonly_pubkey_serialize(const secp256k1_context *ctx, unsigned char *output32, const secp256k1_xonly_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Serialize an xonly_pubkey object into a 32-byte sequence.
Definition:
main_impl.h:44
secp256k1_xonly_pubkey_tweak_add_check
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_xonly_pubkey_tweak_add_check(const secp256k1_context *ctx, const unsigned char *tweaked_pubkey32, int tweaked_pk_parity, const secp256k1_xonly_pubkey *internal_pubkey, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5)
Checks that a tweaked pubkey is the result of calling secp256k1_xonly_pubkey_tweak_add with internal_...
Definition:
main_impl.h:135
secp256k1_keypair_create
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_create(const secp256k1_context *ctx, secp256k1_keypair *keypair, const unsigned char *seckey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Compute the keypair for a valid secret key.
Definition:
main_impl.h:196
secp256k1_xonly_pubkey_from_pubkey
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_xonly_pubkey_from_pubkey(const secp256k1_context *ctx, secp256k1_xonly_pubkey *xonly_pubkey, int *pk_parity, const secp256k1_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4)
Converts a secp256k1_pubkey into a secp256k1_xonly_pubkey.
Definition:
main_impl.h:99
secp256k1_keypair_xonly_tweak_add
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_xonly_tweak_add(const secp256k1_context *ctx, secp256k1_keypair *keypair, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Tweak a keypair by adding tweak32 to the secret key and updating the public key accordingly.
Definition:
main_impl.h:255
secp256k1_xonly_pubkey_tweak_add
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_xonly_pubkey_tweak_add(const secp256k1_context *ctx, secp256k1_pubkey *output_pubkey, const secp256k1_xonly_pubkey *internal_pubkey, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Tweak an x-only public key by adding the generator multiplied with tweak32 to it.
Definition:
main_impl.h:118
secp256k1_keypair_xonly_pub
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_xonly_pub(const secp256k1_context *ctx, secp256k1_xonly_pubkey *pubkey, int *pk_parity, const secp256k1_keypair *keypair) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4)
Get the x-only public key from a keypair.
Definition:
main_impl.h:234
secp256k1_keypair
struct secp256k1_keypair secp256k1_keypair
Opaque data structure that holds a keypair consisting of a secret and a public key.
secp256k1_xonly_pubkey_parse
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_xonly_pubkey_parse(const secp256k1_context *ctx, secp256k1_xonly_pubkey *pubkey, const unsigned char *input32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a 32-byte sequence into a xonly_pubkey object.
Definition:
main_impl.h:22
secp256k1_context_struct
Definition:
secp256k1.c:61
secp256k1_keypair
Opaque data structure that holds a keypair consisting of a secret and a public key.
Definition:
secp256k1_extrakeys.h:33
secp256k1_keypair::data
unsigned char data[96]
Definition:
secp256k1_extrakeys.h:34
secp256k1_pubkey
Opaque data structure that holds a parsed and valid public key.
Definition:
secp256k1.h:61
secp256k1_xonly_pubkey
Opaque data structure that holds a parsed and valid "x-only" public key.
Definition:
secp256k1_extrakeys.h:22
secp256k1_xonly_pubkey::data
unsigned char data[64]
Definition:
secp256k1_extrakeys.h:23
Generated on Wed Dec 18 2024 20:00:11 for Bitcoin Core by
1.9.4