Skip to content

Commit

Permalink
FIX: windows package fails with: AttributeError: SECP256K1_CONTEXT_SI…
Browse files Browse the repository at this point in the history
…GN (#137)
  • Loading branch information
MementoRC authored Jan 26, 2024
1 parent 8bfb756 commit dcceac2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
33 changes: 14 additions & 19 deletions coincurve/_windows_libsecp256k1.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,22 @@
unsigned int attempt
);
#define SECP256K1_FLAGS_TYPE_MASK ...
#define SECP256K1_FLAGS_TYPE_CONTEXT ...
#define SECP256K1_FLAGS_TYPE_COMPRESSION ...
#define SECP256K1_FLAGS_BIT_CONTEXT_VERIFY ...
#define SECP256K1_FLAGS_BIT_CONTEXT_SIGN ...
#define SECP256K1_FLAGS_BIT_CONTEXT_DECLASSIFY ...
#define SECP256K1_FLAGS_BIT_COMPRESSION ...
#define SECP256K1_FLAGS_TYPE_MASK 255
#define SECP256K1_FLAGS_TYPE_CONTEXT 1
#define SECP256K1_FLAGS_TYPE_COMPRESSION 2
#define SECP256K1_FLAGS_BIT_CONTEXT_VERIFY 256
#define SECP256K1_FLAGS_BIT_CONTEXT_SIGN 512
#define SECP256K1_FLAGS_BIT_CONTEXT_DECLASSIFY 1024
#define SECP256K1_FLAGS_BIT_COMPRESSION 256
#define SECP256K1_TAG_PUBKEY_EVEN 2
#define SECP256K1_TAG_PUBKEY_ODD 3
#define SECP256K1_TAG_PUBKEY_UNCOMPRESSED 4
#define SECP256K1_CONTEXT_NONE ...
#define SECP256K1_CONTEXT_NONE 1
#define SECP256K1_CONTEXT_DECLASSIFY 1025
#define SECP256K1_EC_COMPRESSED 258
#define SECP256K1_EC_UNCOMPRESSED 2
#define SECP256K1_CONTEXT_VERIFY ...
#define SECP256K1_CONTEXT_SIGN ...
#define SECP256K1_CONTEXT_DECLASSIFY ...
#define SECP256K1_EC_COMPRESSED ...
#define SECP256K1_EC_UNCOMPRESSED ...
#define SECP256K1_TAG_PUBKEY_EVEN ...
#define SECP256K1_TAG_PUBKEY_ODD ...
#define SECP256K1_TAG_PUBKEY_UNCOMPRESSED ...
extern const secp256k1_context *secp256k1_context_static;
extern void secp256k1_selftest(void);
extern secp256k1_context *secp256k1_context_create(
Expand Down
4 changes: 2 additions & 2 deletions coincurve/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def combine_keys(cls, public_keys, context: Context = GLOBAL_CONTEXT):

return PublicKey(public_key, context)

def format(self, compressed: bool = True) -> bytes: # noqa: A003
def format(self, compressed: bool = True) -> bytes:
"""
Format the public key.
Expand Down Expand Up @@ -579,7 +579,7 @@ def from_valid_secret(cls, secret: bytes, context: Context = GLOBAL_CONTEXT):

return cls(xonly_pubkey, parity=not not pk_parity[0], context=context)

def format(self) -> bytes: # noqa: A003
def format(self) -> bytes:
"""Serialize the public key.
:return: The public key serialized as 32 bytes.
Expand Down

0 comments on commit dcceac2

Please sign in to comment.