Commit graph

14 commits

Author SHA1 Message Date
Legrandin
c85dfa7953 Add Crypto.Signature.pkcs1_v1_5 module with NIST test vectors
Crypto.Signature.PKCS1_v1_5 is reverted to old behavior it
had in PyCrypto (verify raises no exception; it only returns
True or False).
2015-07-10 19:19:13 +00:00
Legrandin
d83380a048 Removed support for Python<2.4 2014-06-16 20:36:35 +02:00
Dwayne Litzenberger
fd398a28e3 Hash: Speed up initialization by removing pure-Python wrappers
The pure Python wrappers around Crypto.Hash.* were convenient, but they
slowed down hash initialization by 4-7x.

There is a speed trade-off here: The MD5 and SHA1 objects are just
wrapped hashlib objects (or old-style md5/sha objects).  To maintain API
compatibility with the rest of PyCrypto, we still have to wrap them, so
they're slower to initialize than the rest of the hash functions.  If
hashlib ever adds a .new() method, we will automatically use hashlib
directly and gain the initialization speed-up.
2013-02-17 20:07:02 -08:00
Dwayne Litzenberger
59018ff99c Hash: Remove "oid" attributes; add "name" attribute
In PyCrypto v2.5, the "oid" attribute was added to hash objects.  In
retrospect, this was not a good idea, since the OID is not really a
property of the hash algorithm, it's a protocol-specific identifer for
the hash functions.  PKCS#1 v1.5 uses it, but other protocols (e.g.
OpenPGP, DNSSEC, SSH, etc.) use different identifiers, and it doesn't make
sense to add these to Crypto.Hash.* every time a new algorithm is added.

This also has the benefit of being compatible with the Python standard
library's "hashlib" objects, which also have a name attribute.
2013-02-17 19:00:50 -08:00
Dwayne C. Litzenberger
6ca6d21540 Fix typos in docs 2012-05-23 22:15:53 -04:00
Legrandin
2f8a86bd83 Added documentation for all hash algorithms
(including for HMAC which, strictly speaking, does not belong with them).
2012-05-05 23:37:19 +02:00
Legrandin
c22fa18c0d Merged from upstream (py3k support) and modified so that all unit tests pass. 2011-10-18 23:20:26 +02:00
Legrandin
dd3f0007c5 Simplify wrapper, as digest_size is known in advance each time. 2011-02-07 23:18:12 +01:00
Legrandin
4b43790a88 Fixed typo 2011-02-06 23:14:57 +01:00
Legrandin
6d7eb4f0f3 First fully tested version of Crypto.Signature.PKCS1_PSS 2011-02-06 23:07:58 +01:00
Legrandin
0d14809acd Add OID to each hash algorithm. 2011-02-03 01:35:46 +01: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
494cad8bc9 Legal: Add PD dedication to __init__.py files and hash stubs
From what I can tell, the authors of these files are:

 - Andrew Kuchling (who has dedicated his contributions to the public domain);
   and/or
 - Dwayne Litzenberger (myself).
2009-03-01 10:23:08 -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 Hash/MD5.py (Browse further)