Skip to content

Commit

Permalink
Merge branch '2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Sep 21, 2016
2 parents 4c6f188 + 4687fcf commit 7366f96
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions sites/www/installing-1.x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@ Tools on the Mac, or the ``build-essential`` package on Ubuntu or Debian Linux
-- basically, anything with ``gcc``, ``make`` and so forth) as well as the
Python development libraries, often named ``python-dev`` or similar.

Slow vs fast crypto math
~~~~~~~~~~~~~~~~~~~~~~~~

PyCrypto attempts to use the ``gmp`` C math library if it is present on your
system, which enables what it internally calls "fastmath" (``_fastmath.so``).
When those headers are not available, it falls back to "slowmath"
(``_slowmath.py``) which is a pure-Python implementation.

Real-world tests have shown significant benefits to using the C version of this
code; thus we strongly recommend you install the ``gmp`` development headers
**before** installing Paramiko/PyCrypto. E.g.::

$ apt-get install libgmp-dev # or just apt
$ yum install gmp-devel # or dnf
$ brew install gmp

If you're unsure which version of math you've ended up with, a quick way to
check is to examine whether ``_fastmath.so`` or ``_slowmath.py`` appears in the
output of::

from Crypto.PublicKey import RSA
print(RSA._impl._math)

Windows
~~~~~~~

For **Windows** users we recommend using :ref:`pypm`, installing a C
development environment such as `Cygwin <http://cygwin.com>`_ or obtaining a
precompiled Win32 PyCrypto package from `voidspace's Python modules page
Expand Down

0 comments on commit 7366f96

Please sign in to comment.