mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
prepare cython-TrezorCrypto for pip release
This commit is contained in:
parent
5cd4531312
commit
fb747384a0
4
.gitignore
vendored
4
.gitignore
vendored
@ -4,3 +4,7 @@
|
||||
test-openssl
|
||||
tests
|
||||
build-*/
|
||||
build/
|
||||
dist/
|
||||
MANIFEST
|
||||
TrezorCrypto.c
|
||||
|
2
MANIFEST.in
Normal file
2
MANIFEST.in
Normal file
@ -0,0 +1,2 @@
|
||||
include *.h
|
||||
include *.pyx
|
@ -1,6 +1,6 @@
|
||||
from libc.stdint cimport uint32_t, uint8_t
|
||||
|
||||
cdef extern from "../bip32.h":
|
||||
cdef extern from "bip32.h":
|
||||
|
||||
ctypedef struct HDNode:
|
||||
uint8_t public_key[33]
|
||||
@ -17,6 +17,6 @@ cdef extern from "../bip32.h":
|
||||
|
||||
int hdnode_deserialize(const char *str, HDNode *node)
|
||||
|
||||
cdef extern from "../ecdsa.h":
|
||||
cdef extern from "ecdsa.h":
|
||||
|
||||
void ecdsa_get_address(const uint8_t *pub_key, uint8_t version, char *addr, int addrsize)
|
2
cython/.gitignore
vendored
2
cython/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
build/
|
||||
*.c
|
27
cython/setup.py → setup.py
Normal file → Executable file
27
cython/setup.py → setup.py
Normal file → Executable file
@ -1,32 +1,31 @@
|
||||
#!/usr/bin/python
|
||||
from distutils.core import setup
|
||||
from distutils.extension import Extension
|
||||
from Cython.Build import cythonize
|
||||
from Cython.Distutils import build_ext
|
||||
|
||||
crypto_srcs = [
|
||||
'base58.c',
|
||||
'bignum.c',
|
||||
'bip32.c',
|
||||
'ecdsa.c',
|
||||
'hmac.c',
|
||||
'rand.c',
|
||||
'ripemd160.c',
|
||||
'secp256k1.c',
|
||||
'sha2.c',
|
||||
srcs = [
|
||||
'base58',
|
||||
'bignum',
|
||||
'bip32',
|
||||
'ecdsa',
|
||||
'hmac',
|
||||
'rand',
|
||||
'ripemd160',
|
||||
'secp256k1',
|
||||
'sha2',
|
||||
]
|
||||
|
||||
crypto_srcs = [ '../%s' % x for x in crypto_srcs ]
|
||||
|
||||
extensions = [
|
||||
Extension('TrezorCrypto',
|
||||
sources = ['TrezorCrypto.pyx', 'c.pxd'] + crypto_srcs,
|
||||
sources = ['TrezorCrypto.pyx', 'c.pxd'] + [ x + '.c' for x in srcs ],
|
||||
extra_compile_args = ['-DUSE_PUBKEY_VALIDATE=0'],
|
||||
)
|
||||
]
|
||||
|
||||
setup(
|
||||
name = 'TrezorCrypto',
|
||||
version = '0',
|
||||
version = '0.0.0',
|
||||
description = 'Cython wrapper around trezor-crypto library',
|
||||
author = 'Pavol Rusnak',
|
||||
author_email = 'stick@satoshilabs.com',
|
Loading…
Reference in New Issue
Block a user