Trezor-crypto python binding
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
src @ 2434d48
tools
trezor_crypto
trezor_crypto_tests
.gitignore
.gitmodules
.travis.yml
LICENSE
MANIFEST.in
README.md
setup.cfg
setup.py
test-travis.sh
travis-install-libsodium.sh

README.md

Trezor-crypto python binding

This is the ctypes and cffi python binding for trezor-crypto used in Monero implementation.

The python module builds trezor-crypto as a shared library. Currently only ctypes is fully supported. CFFI module is built but the python method wrappers are not implemented yet (no the roadmap).

The module automatically generates the bindings from the trezor-crypto header files using ctypeslib2 and pycparser.

Note the forked version of the original trezor-crypto is used in order to support library mode (for now).

Requirements:

  • gcc / clang
  • pkg-config
  • libsodium

In order to use this module please install libsodium.

sudo apt-get install libsodium-dev

Pypi

pip install py_trezor_crypto_ph4

Dev Requirements:

In order to generate bindings from the trezor-crypto header files the following tools are needed:

  • clang
  • ctypeslib2
  • pycparser
  • libclang.so / libclang.dylib

Roadmap

  • Code generate CFFI wrappers in the similar manner as ctype wrappers.

Refresh Ctype bindings

In order to refresh method definitions and regenerate ctype wrappers from trezor-crypto header files run

python trezor_crypto/cffi_build.py -a ctypes --debug

Refresh CFFI bindings

In order to refresh data/cffi.h from trezor-crypto header files run:

python trezor_crypto/cffi_build.py -a cffi_h --debug