README.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. wolfcrypt: the wolfSSL Crypto Engine
  2. ====================================
  3. **wolfCrypt Python**, a.k.a. ``wolfcrypt`` is a Python library that encapsulates
  4. **wolfSSL's wolfCrypt API**.
  5. `wolfCrypt <https://wolfssl.com/wolfSSL/Products-wolfcrypt.html>`_ is a
  6. lightweight, portable, C-language-based crypto library
  7. targeted at IoT, embedded, and RTOS environments primarily because of its size,
  8. speed, and feature set. It works seamlessly in desktop, enterprise, and cloud
  9. environments as well. It is the crypto engine behind `wolfSSl's embedded ssl
  10. library <https://wolfssl.com/wolfSSL/Products-wolfssl.html>`_.
  11. Installation
  12. ------------
  13. In order to use ``wolfcrypt``, first you'll need to install ``wolfssl`` C
  14. embedded ssl library.
  15. Installing ``wolfssl`` :
  16. ~~~~~~~~~~~~~~~~~~~~~~~~
  17. **Mac OSX**
  18. .. code-block:: console
  19. brew install wolfssl
  20. or
  21. .. code-block:: console
  22. git clone https://github.com/wolfssl/wolfssl.git
  23. cd wolfssl/
  24. ./autogen.sh
  25. ./configure --enable-sha512
  26. make
  27. sudo make install
  28. **Ubuntu**
  29. .. code-block:: console
  30. sudo apt-get update
  31. sudo apt-get install -y git autoconf libtool
  32. git clone https://github.com/wolfssl/wolfssl.git
  33. cd wolfssl/
  34. ./autogen.sh
  35. ./configure --enable-sha512
  36. make
  37. sudo make install
  38. sudo ldconfig
  39. **CentOS**
  40. .. code-block:: console
  41. sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
  42. sudo yum update
  43. sudo yum install -y git autoconf libtool
  44. git clone git@github.com:wolfssl/wolfssl.git
  45. cd wolfssl
  46. ./autogen.sh
  47. ./configure --enable-sha512
  48. make
  49. sudo make install
  50. echo /usr/local/lib > wolfssl.conf
  51. sudo mv wolfssl.conf /etc/ld.so.conf
  52. sudo ldconfig
  53. Installing ``wolfcrypt`` :
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. **Mac OSX**
  56. .. code-block:: console
  57. sudo -H pip install wolfcrypt
  58. **Ubuntu**
  59. .. code-block:: console
  60. sudo apt-get install -y python-dev python3-dev python-pip libffi-dev
  61. sudo -H pip install wolfcrypt
  62. **CentOS**
  63. .. code-block:: console
  64. sudo yum install -y python-devel python3-devel python-pip libffi-devel
  65. sudo -H pip install wolfcrypt
  66. Testing ``wolfcrypt`` :
  67. ~~~~~~~~~~~~~~~~~~~~~~~
  68. .. code-block:: console
  69. python -c "from wolfcrypt.hashes import Sha; print Sha().hexdigest()"
  70. expected output: **da39a3ee5e6b4b0d3255bfef95601890afd80709**
  71. Testing ``wolfcrypt``'s source code with ``tox`` :
  72. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  73. To run the unit tests in the source code, you'll need ``tox`` and a few other
  74. requirements. The source code relies at 'WOLFSSL_DIR/wrapper/python/wolfcrypt'
  75. where WOLFSSL_DIR is the path of ``wolfssl``'s source code.
  76. 1. Make sure that the testing requirements are installed:
  77. .. code-block:: console
  78. $ sudo -H pip install -r requirements-testing.txt
  79. 2. Run ``tox``:
  80. .. code-block:: console
  81. $ tox
  82. ...
  83. _________________________________ summary _________________________________
  84. py27: commands succeeded
  85. SKIPPED: py34: InterpreterNotFound: python3.4
  86. py35: commands succeeded
  87. congratulations :)
  88. Note: the test is performed using multiple versions of python. If you are
  89. missing a version the test will be skipped with an **InterpreterNotFound
  90. error**.