Bitcoin ABC
0.26.3
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
{
23
unsigned
char
data[64];
24
}
secp256k1_xonly_pubkey
;
25
33
typedef
struct
{
34
unsigned
char
data[96];
35
}
secp256k1_keypair
;
36
48
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_parse
(
49
const
secp256k1_context
*
ctx
,
50
secp256k1_xonly_pubkey
* pubkey,
51
const
unsigned
char
*input32
52
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
53
64
SECP256K1_API
int
secp256k1_xonly_pubkey_serialize
(
65
const
secp256k1_context
*
ctx
,
66
unsigned
char
*output32,
67
const
secp256k1_xonly_pubkey
* pubkey
68
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
69
83
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_from_pubkey
(
84
const
secp256k1_context
*
ctx
,
85
secp256k1_xonly_pubkey
*xonly_pubkey,
86
int
*pk_parity,
87
const
secp256k1_pubkey
*pubkey
88
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(4);
89
114
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_tweak_add
(
115
const
secp256k1_context
*
ctx
,
116
secp256k1_pubkey
*output_pubkey,
117
const
secp256k1_xonly_pubkey
*internal_pubkey,
118
const
unsigned
char
*tweak32
119
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3)
SECP256K1_ARG_NONNULL
(4);
120
146
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_xonly_pubkey_tweak_add_check
(
147
const
secp256k1_context
*
ctx
,
148
const
unsigned
char
*tweaked_pubkey32,
149
int
tweaked_pk_parity,
150
const
secp256k1_xonly_pubkey
*internal_pubkey,
151
const
unsigned
char
*tweak32
152
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(4)
SECP256K1_ARG_NONNULL
(5);
153
162
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_create
(
163
const
secp256k1_context
*
ctx
,
164
secp256k1_keypair
*keypair,
165
const
unsigned
char
*seckey
166
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
167
175
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_sec
(
176
const
secp256k1_context
*
ctx
,
177
unsigned
char
*seckey,
178
const
secp256k1_keypair
*keypair
179
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
180
190
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_pub
(
191
const
secp256k1_context
*
ctx
,
192
secp256k1_pubkey
*pubkey,
193
const
secp256k1_keypair
*keypair
194
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
195
211
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_xonly_pub
(
212
const
secp256k1_context
*
ctx
,
213
secp256k1_xonly_pubkey
*pubkey,
214
int
*pk_parity,
215
const
secp256k1_keypair
*keypair
216
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(4);
217
239
SECP256K1_API
SECP256K1_WARN_UNUSED_RESULT
int
secp256k1_keypair_xonly_tweak_add
(
240
const
secp256k1_context
*
ctx
,
241
secp256k1_keypair
*keypair,
242
const
unsigned
char
*tweak32
243
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_ARG_NONNULL
(3);
244
245
#ifdef __cplusplus
246
}
247
#endif
248
249
#endif
/* SECP256K1_EXTRAKEYS_H */
ctx
secp256k1_context * ctx
Definition:
bench_multiset.c:12
secp256k1.h
SECP256K1_ARG_NONNULL
#define SECP256K1_ARG_NONNULL(_x)
Definition:
secp256k1.h:155
SECP256K1_API
#define SECP256K1_API
Definition:
secp256k1.h:140
SECP256K1_WARN_UNUSED_RESULT
#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:150
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:199
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:189
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:43
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:109
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 secret key.
Definition:
main_impl.h:171
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:72
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:230
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:91
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:209
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:21
secp256k1_context_struct
Definition:
secp256k1.c:69
secp256k1_keypair
Opaque data structure that holds a keypair consisting of a secret and a public key.
Definition:
secp256k1_extrakeys.h:33
secp256k1_pubkey
Opaque data structure that holds a parsed and valid public key.
Definition:
secp256k1.h:67
secp256k1_xonly_pubkey
Opaque data structure that holds a parsed and valid "x-only" public key.
Definition:
secp256k1_extrakeys.h:22
Generated on Sat Apr 1 2023 02:36:49 for Bitcoin ABC by
1.9.1