tecnovert
4 years ago
No known key found for this signature in database
GPG Key ID: 6C1A887B4701EAE3
3 changed files with
11 additions and
0 deletions
-
.gitignore
-
_cffi_build/secp256k1_ed25519.h
-
coincurve/ed25519.py
|
|
@ -14,3 +14,4 @@ |
|
|
|
|
|
|
|
/coincurve/_libsecp256k1.py |
|
|
|
/coincurve/libsecp256k1.dll |
|
|
|
libsecp256k1 |
|
|
|
|
|
@ -1,2 +1,4 @@ |
|
|
|
extern const unsigned char ed25519_gen[32]; |
|
|
|
extern const unsigned char ed25519_gen2[32]; |
|
|
|
|
|
|
|
int crypto_scalarmult_ed25519_base_noclamp(unsigned char *q, const unsigned char *n); |
|
|
|
|
|
@ -25,6 +25,14 @@ def get_valid_secret(): |
|
|
|
return secret |
|
|
|
|
|
|
|
|
|
|
|
def ed25519_get_pubkey(privkey): |
|
|
|
pubkey_output = ffi.new('unsigned char[{}]'.format(32)) |
|
|
|
privkey_le = privkey[::-1] |
|
|
|
rv = lib.crypto_scalarmult_ed25519_base_noclamp(pubkey_output, privkey_le) |
|
|
|
assert(rv == 0) |
|
|
|
return bytes(ffi.buffer(pubkey_output, 32)) |
|
|
|
|
|
|
|
|
|
|
|
class Ed25519PrivateKey: |
|
|
|
def __init__(self, secret=None, context=GLOBAL_CONTEXT): |
|
|
|
self.context = context |
|
|
|