mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-08 09:58:46 +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
|
test-openssl
|
||||||
tests
|
tests
|
||||||
build-*/
|
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
|
from libc.stdint cimport uint32_t, uint8_t
|
||||||
|
|
||||||
cdef extern from "../bip32.h":
|
cdef extern from "bip32.h":
|
||||||
|
|
||||||
ctypedef struct HDNode:
|
ctypedef struct HDNode:
|
||||||
uint8_t public_key[33]
|
uint8_t public_key[33]
|
||||||
@ -17,6 +17,6 @@ cdef extern from "../bip32.h":
|
|||||||
|
|
||||||
int hdnode_deserialize(const char *str, HDNode *node)
|
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)
|
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.core import setup
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
from Cython.Distutils import build_ext
|
from Cython.Distutils import build_ext
|
||||||
|
|
||||||
crypto_srcs = [
|
srcs = [
|
||||||
'base58.c',
|
'base58',
|
||||||
'bignum.c',
|
'bignum',
|
||||||
'bip32.c',
|
'bip32',
|
||||||
'ecdsa.c',
|
'ecdsa',
|
||||||
'hmac.c',
|
'hmac',
|
||||||
'rand.c',
|
'rand',
|
||||||
'ripemd160.c',
|
'ripemd160',
|
||||||
'secp256k1.c',
|
'secp256k1',
|
||||||
'sha2.c',
|
'sha2',
|
||||||
]
|
]
|
||||||
|
|
||||||
crypto_srcs = [ '../%s' % x for x in crypto_srcs ]
|
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
Extension('TrezorCrypto',
|
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'],
|
extra_compile_args = ['-DUSE_PUBKEY_VALIDATE=0'],
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'TrezorCrypto',
|
name = 'TrezorCrypto',
|
||||||
version = '0',
|
version = '0.0.0',
|
||||||
description = 'Cython wrapper around trezor-crypto library',
|
description = 'Cython wrapper around trezor-crypto library',
|
||||||
author = 'Pavol Rusnak',
|
author = 'Pavol Rusnak',
|
||||||
author_email = 'stick@satoshilabs.com',
|
author_email = 'stick@satoshilabs.com',
|
Loading…
Reference in New Issue
Block a user