![tecnovert@tecnovert.net](/assets/img/avatar_default.png)
22 changed files with 568 additions and 46 deletions
@ -0,0 +1,78 @@ |
|||
typedef struct { |
|||
unsigned char data[64]; |
|||
} secp256k1_xonly_pubkey; |
|||
|
|||
typedef struct { |
|||
unsigned char data[96]; |
|||
} secp256k1_keypair; |
|||
|
|||
int secp256k1_xonly_pubkey_parse( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_xonly_pubkey* pubkey, |
|||
const unsigned char *input32 |
|||
); |
|||
|
|||
int secp256k1_xonly_pubkey_serialize( |
|||
const secp256k1_context* ctx, |
|||
unsigned char *output32, |
|||
const secp256k1_xonly_pubkey* pubkey |
|||
); |
|||
|
|||
int secp256k1_xonly_pubkey_cmp( |
|||
const secp256k1_context* ctx, |
|||
const secp256k1_xonly_pubkey* pk1, |
|||
const secp256k1_xonly_pubkey* pk2 |
|||
); |
|||
|
|||
int secp256k1_xonly_pubkey_from_pubkey( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_xonly_pubkey *xonly_pubkey, |
|||
int *pk_parity, |
|||
const secp256k1_pubkey *pubkey |
|||
); |
|||
|
|||
int secp256k1_xonly_pubkey_tweak_add( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_pubkey *output_pubkey, |
|||
const secp256k1_xonly_pubkey *internal_pubkey, |
|||
const unsigned char *tweak32 |
|||
); |
|||
|
|||
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 |
|||
); |
|||
|
|||
int secp256k1_keypair_create( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_keypair *keypair, |
|||
const unsigned char *seckey |
|||
); |
|||
|
|||
int secp256k1_keypair_sec( |
|||
const secp256k1_context* ctx, |
|||
unsigned char *seckey, |
|||
const secp256k1_keypair *keypair |
|||
); |
|||
|
|||
int secp256k1_keypair_pub( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_pubkey *pubkey, |
|||
const secp256k1_keypair *keypair |
|||
); |
|||
|
|||
int secp256k1_keypair_xonly_pub( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_xonly_pubkey *pubkey, |
|||
int *pk_parity, |
|||
const secp256k1_keypair *keypair |
|||
); |
|||
|
|||
int secp256k1_keypair_xonly_tweak_add( |
|||
const secp256k1_context* ctx, |
|||
secp256k1_keypair *keypair, |
|||
const unsigned char *tweak32 |
|||
); |
@ -0,0 +1,51 @@ |
|||
typedef 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 |
|||
); |
|||
|
|||
extern const secp256k1_nonce_function_hardened secp256k1_nonce_function_bip340; |
|||
|
|||
typedef struct { |
|||
unsigned char magic[4]; |
|||
secp256k1_nonce_function_hardened noncefp; |
|||
void* ndata; |
|||
} secp256k1_schnorrsig_extraparams; |
|||
|
|||
int secp256k1_schnorrsig_sign( |
|||
const secp256k1_context* ctx, |
|||
unsigned char *sig64, |
|||
const unsigned char *msg32, |
|||
const secp256k1_keypair *keypair, |
|||
const unsigned char *aux_rand32 |
|||
); |
|||
|
|||
int secp256k1_schnorrsig_sign32( |
|||
const secp256k1_context* ctx, |
|||
unsigned char *sig64, |
|||
const unsigned char *msg32, |
|||
const secp256k1_keypair *keypair, |
|||
const unsigned char *aux_rand32 |
|||
); |
|||
|
|||
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 |
|||
); |
|||
|
|||
int secp256k1_schnorrsig_verify( |
|||
const secp256k1_context* ctx, |
|||
const unsigned char *sig64, |
|||
const unsigned char *msg, |
|||
size_t msglen, |
|||
const secp256k1_xonly_pubkey *pubkey |
|||
); |
@ -1,4 +1,12 @@ |
|||
from coincurve.context import GLOBAL_CONTEXT, Context |
|||
from coincurve.keys import PrivateKey, PublicKey |
|||
from coincurve.keys import PrivateKey, PublicKey, PublicKeyXOnly |
|||
from coincurve.utils import verify_signature |
|||
|
|||
__all__ = [ |
|||
'GLOBAL_CONTEXT', |
|||
'Context', |
|||
'PrivateKey', |
|||
'PublicKey', |
|||
'PublicKeyXOnly', |
|||
'verify_signature', |
|||
] |
|||
|
Loading…
Reference in new issue