Metadata-Version: 2.1
Name: py-trezor-crypto-ph4
Version: 0.0.3
Summary: Trezor-crypto python binding
Home-page: https://github.com/ph4r05/py-trezor-crypto
Author: Dusan Klinec
Author-email: dusan.klinec@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Security
Provides-Extra: docs
Provides-Extra: dev
Requires-Dist: cffi (>=1.1)
Requires-Dist: cython (>=0.23)
Requires-Dist: shlib
Requires-Dist: ctypeslib2
Requires-Dist: pycparser
Provides-Extra: dev
Requires-Dist: nose; extra == 'dev'
Requires-Dist: pep8; extra == 'dev'
Requires-Dist: tox; extra == 'dev'
Requires-Dist: aiounittest; extra == 'dev'
Requires-Dist: requests; extra == 'dev'
Requires-Dist: pympler; extra == 'dev'
Requires-Dist: pypandoc; extra == 'dev'
Requires-Dist: pandoc; extra == 'dev'
Provides-Extra: docs
Requires-Dist: Sphinx (>=1.0); extra == 'docs'
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
Requires-Dist: sphinxcontrib-programoutput; extra == 'docs'

Trezor-crypto python binding
============================

This is the ctypes and cffi python binding for
`trezor-crypto <https://github.com/ph4r05/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 <https://github.com/ph4r05/trezor-crypto>`__ header files
using `ctypeslib2 <https://github.com/trolldbois/ctypeslib>`__ and
`pycparser <https://github.com/eliben/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``.

.. code:: bash

    sudo apt-get install libsodium-dev

Dev Requirements:
-----------------

In order to generate bindings from the
`trezor-crypto <https://github.com/ph4r05/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 <https://github.com/ph4r05/trezor-crypto>`__ header
files run

.. code:: bash

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

Refresh CFFI bindings
---------------------

In order to refresh ``data/cffi.h`` from
`trezor-crypto <https://github.com/ph4r05/trezor-crypto>`__ header files
run:

.. code:: bash

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



