Commit graph

12 commits

Author SHA1 Message Date
Legrandin
c22fa18c0d Merged from upstream (py3k support) and modified so that all unit tests pass. 2011-10-18 23:20:26 +02:00
Legrandin
897b75983c Added Lorenz Quack's native C implementation of all SHA-2 algorithm
(as submitted here https://bugs.launchpad.net/pycrypto/+bug/544792)
so that they are available also in Python 2.1, 2.2, 2.3 and 2.4.

Regardless where the implementation comes from (Python standard
library or our native modules, depending on the Python version),
all Crypto.Hash objects are always used as front-ends.
2011-10-16 22:41:21 +02:00
Dwayne C. Litzenberger
25a055334e Don't abuse __builtins__
According to Jean-Paul Calderone at https://bugs.launchpad.net/pycrypto/+bug/785150:

    `__builtins__` is an implementation detail of CPython. It takes on
    inconsistent values at various times. The use in `common.py` happens to
    work on recent version of CPython, but it doesn't work on PyPy. The only
    thing you should ever do, when you're doing this sort of thing, is "import
    __builtin__; __builtin__.foo".
2011-10-10 23:59:37 -04:00
Dwayne C. Litzenberger
1bd6ef6294 Py3k compatibility: tests 2011-10-10 16:05:23 -04:00
Anders Sundman
28f8bd25da Unwraping byte conversion on test vectors.
Doing the wraping later, at the point of use instead.
2011-04-24 17:35:12 +02:00
Legrandin
07e9e97e9d Add new() method to all remaining hash algorithms, so as to make them to work with PKCS#1 PSS. Add also test cases for it for every hash. 2011-02-07 22:32:49 +01:00
Legrandin
b2c5880538 Make tests compatible to Python 2.1 2011-02-03 19:34:47 +01:00
Legrandin
3082d19c39 Add test routines to validate OID in hash algorithms. 2011-02-03 01:35:58 +01:00
Thorsten Behrens
cb48387f66 PY3K _fastmath support
o _fastmath now builds and runs on PY3K
o Changes to setup.py to allow /usr/include for gmp.h
o Changes to setup.py to allow linking fastmath w/ static mpir
  on Windows without warning messages
o Changes to test_DSA/test_RSA to throw an exception if _fastmath
  is present but cannot be imported (due to an issue building
  _fastmath or the shared gmp/mpir libraries not being reachable)
o number.py has the code to flag a failing _fastmath, but that
  code is commented out for a better runtime experience
o Clean up the if for py21compat import - should have been == not is
o Clean up some '== None' occurences, now 'is None' instead
2010-12-29 13:21:05 -05:00
Thorsten Behrens
295ce314d9 Changes to allow pycrpyto to work on Python 3.x as well as 2.1 through 2.7 2010-12-28 16:26:52 -05:00
Dwayne C. Litzenberger
386de1947b Legal: Dedicate my files to the public domain.
In an attempt to simplify the copyright status of PyCrypto, I'm placing my
code into the public domain, and encouraging other contributors to do the
same.

I have used a public domain dedication that was recommended in a book on FOSS legal
issues[1], followed by the warranty disclaimer boilerplate from the MIT license.

[1] _Intellectual Property and Open Source: A Practical Guide to Protecting
    Code_, a book written by Van Lindberg and published by O'Reilly Media.
    (ISBN 978-0-596-51796-0)
2009-03-01 10:22:51 -05:00
Dwayne C. Litzenberger
ff8a657a8d cleanup: Move modules to "lib/Crypto" subdirectory.
This will avoid the previous situation where scripts like the old "test.py"
get included accidentally in a release.  It also frees us to put additional
build scripts in the top-level directory of the source tree.
2009-02-28 13:14:53 -05:00
Renamed from SelfTest/Hash/common.py (Browse further)