Browse Source

forget about der/pem for now

tb
ofek 7 years ago
parent
commit
4d98dfaa46
  1. 1
      _cffi_build/build.py
  2. 14
      _cffi_build/lax_der_privatekey_parsing.h
  3. 18
      coincurve/_windows_libsecp256k1.py
  4. 10
      setup.py

1
_cffi_build/build.py

@ -27,7 +27,6 @@ modules = [
Source('secp256k1.h', '#include <secp256k1.h>'),
Source('secp256k1_ecdh.h', '#include <secp256k1_ecdh.h>'),
Source('secp256k1_recovery.h', '#include <secp256k1_recovery.h>'),
Source('lax_der_privatekey_parsing.h', '#include <lax_der_privatekey_parsing.h>'),
]
ffi = _mk_ffi(modules, libraries=['secp256k1'])

14
_cffi_build/lax_der_privatekey_parsing.h

@ -1,14 +0,0 @@
int ec_privkey_export_der(
const secp256k1_context* ctx,
unsigned char *privkey,
size_t *privkeylen,
const unsigned char *seckey,
int compressed
);
int ec_privkey_import_der(
const secp256k1_context* ctx,
unsigned char *seckey,
const unsigned char *privkey,
size_t privkeylen
);

18
coincurve/_windows_libsecp256k1.py

@ -227,29 +227,11 @@ int secp256k1_ecdh(
);
"""
DER_DEFINITIONS = """
int ec_privkey_export_der(
const secp256k1_context* ctx,
unsigned char *privkey,
size_t *privkeylen,
const unsigned char *seckey,
int compressed
);
int ec_privkey_import_der(
const secp256k1_context* ctx,
unsigned char *seckey,
const unsigned char *privkey,
size_t privkeylen
);
"""
ffi = FFI()
ffi.cdef(BASE_DEFINITIONS)
ffi.cdef(RECOVERY_DEFINITIONS)
ffi.cdef(ECDH_DEFINITIONS)
ffi.cdef(DER_DEFINITIONS)
here = os.path.dirname(os.path.abspath(__file__))
lib = ffi.dlopen(os.path.join(here, 'libsecp256k1.dll'))

10
setup.py

@ -73,16 +73,6 @@ def download_library(command):
except URLError as ex:
raise SystemExit('Unable to download secp256k1 library: %s',
ex.message)
shutil.copy(
os.path.join(libdir, 'contrib', 'lax_der_privatekey_parsing.c'),
os.path.join(libdir, 'src'),
)
shutil.copy(
os.path.join(libdir, 'contrib', 'lax_der_privatekey_parsing.h'),
os.path.join(libdir, 'include'),
)
print(os.listdir(os.path.join(libdir, 'src')))
print(os.listdir(os.path.join(libdir, 'include')))
class egg_info(_egg_info):

Loading…
Cancel
Save