<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pycrypto.git/lib/Crypto/SelfTest/Hash, branch master</title>
<subtitle>github.com: dlitz/pycrypto.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/'/>
<entry>
<title>Fix tests when running under "python -OO" (PYTHONOPTIMIZE set to 1 or 2)</title>
<updated>2014-06-22T11:07:24+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2014-06-22T10:32:46+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=54f2bc5b81124bfff8fa7f1b7cd6287a1fee1152'/>
<id>54f2bc5b81124bfff8fa7f1b7cd6287a1fee1152</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix BytesWarning when running with "python3 -bb"</title>
<updated>2014-06-22T11:07:24+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2014-06-22T10:06:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=0ac94701bb52fef566f96ce43eb8db6befee9b60'/>
<id>0ac94701bb52fef566f96ce43eb8db6befee9b60</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>hexverify: Fix handling unicode strings on Python 3.2</title>
<updated>2013-10-21T00:36:06+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2013-09-30T00:41:13+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=141eee1093bc9adbbdc3b3b3e90bde868d46eeec'/>
<id>141eee1093bc9adbbdc3b3b3e90bde868d46eeec</id>
<content type='text'>
We were getting this error on Python 3.2:

    ERROR: runTest (Crypto.SelfTest.Hash.common.MACSelfTest)
    CMAC #17: NIST SP 800 38B D.7 Example 17
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "build/lib.linux-x86_64-3.2/Crypto/SelfTest/Hash/common.py", line 199, in runTest
        self.assertRaises(ValueError, h.hexverify, "4556")
      File "/home/dwon/py/pythons/python3.2/lib/python3.2/unittest/case.py", line 557, in assertRaises
        callableObj(*args, **kwargs)
      File "build/lib.linux-x86_64-3.2/Crypto/Hash/CMAC.py", line 323, in hexverify
        self.verify(unhexlify(hex_mac_tag))
    TypeError: 'str' does not support the buffer interface
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were getting this error on Python 3.2:

    ERROR: runTest (Crypto.SelfTest.Hash.common.MACSelfTest)
    CMAC #17: NIST SP 800 38B D.7 Example 17
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "build/lib.linux-x86_64-3.2/Crypto/SelfTest/Hash/common.py", line 199, in runTest
        self.assertRaises(ValueError, h.hexverify, "4556")
      File "/home/dwon/py/pythons/python3.2/lib/python3.2/unittest/case.py", line 557, in assertRaises
        callableObj(*args, **kwargs)
      File "build/lib.linux-x86_64-3.2/Crypto/Hash/CMAC.py", line 323, in hexverify
        self.verify(unhexlify(hex_mac_tag))
    TypeError: 'str' does not support the buffer interface
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for CMAC</title>
<updated>2013-10-20T20:30:21+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2013-05-13T06:40:46+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=da79b781af41ff815b812c49d9be434f5de52aa4'/>
<id>da79b781af41ff815b812c49d9be434f5de52aa4</id>
<content type='text'>
This patch adds support for CMAC (RFC4493, NIST SP800-38B).

[dlitz@dlitz.net: Replaced MacMismatchError with ValueError]
[dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for CMAC (RFC4493, NIST SP800-38B).

[dlitz@dlitz.net: Replaced MacMismatchError with ValueError]
[dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
</pre>
</div>
</content>
</entry>
<entry>
<title>MAC unit tests become independent of hashes</title>
<updated>2013-10-20T20:30:21+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2013-05-16T21:09:27+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=af392459f6a1962e676830ddf81e7b6d2667aa8b'/>
<id>af392459f6a1962e676830ddf81e7b6d2667aa8b</id>
<content type='text'>
The MAC unit tests assume that the MAC algorithm is
based on hash functions (HMAC).
Additionally, a single test vector is quite complex
in that it includes result for multiple tests (each
performed on the same data, but with different
hashes).

This patch simplifies the MAC unit test so that it does
not depend on hashes and a test vector is simply made up by:
* 1 input
* 1 result
* All parameters to pass to the new() function

[dlitz@dlitz.net: Replaced custom MacMismatchError with ValueError.]
[dlitz@dlitz.net: Replaced 'import *' with appropriate imports.]
[dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The MAC unit tests assume that the MAC algorithm is
based on hash functions (HMAC).
Additionally, a single test vector is quite complex
in that it includes result for multiple tests (each
performed on the same data, but with different
hashes).

This patch simplifies the MAC unit test so that it does
not depend on hashes and a test vector is simply made up by:
* 1 input
* 1 result
* All parameters to pass to the new() function

[dlitz@dlitz.net: Replaced custom MacMismatchError with ValueError.]
[dlitz@dlitz.net: Replaced 'import *' with appropriate imports.]
[dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
</pre>
</div>
</content>
</entry>
<entry>
<title>Add HMAC.verify() and HMAC.hexverify() with constant-time comparison</title>
<updated>2013-10-20T20:30:21+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2013-05-14T17:00:43+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=77b0b9123c32b181f7f7a0072b2baa6312620f66'/>
<id>77b0b9123c32b181f7f7a0072b2baa6312620f66</id>
<content type='text'>
In the current implementation, it is left up to the caller
to assess if the locally computed MAC matches the MAC associated
to the received message.

However, the most natural way to do that (use == operator)
is also deepy unsecure, see here:

http://seb.dbzteam.org/crypto/python-oauth-timing-hmac.pdf

With this patch, the new HMAC.verify() method accepts
the given MAC and perform the check on behalf of the caller.
The method will use constant-time code (still dependent on the length
of the MAC, but not on the actual content).

[dlitz@dlitz.net: Modified commit message subject line.]
[dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the current implementation, it is left up to the caller
to assess if the locally computed MAC matches the MAC associated
to the received message.

However, the most natural way to do that (use == operator)
is also deepy unsecure, see here:

http://seb.dbzteam.org/crypto/python-oauth-timing-hmac.pdf

With this patch, the new HMAC.verify() method accepts
the given MAC and perform the check on behalf of the caller.
The method will use constant-time code (still dependent on the length
of the MAC, but not on the actual content).

[dlitz@dlitz.net: Modified commit message subject line.]
[dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
</pre>
</div>
</content>
</entry>
<entry>
<title>Added support for PKCS#8-encrypted private keys.</title>
<updated>2013-07-15T04:16:46+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2013-06-15T21:25:49+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=90d6d3dbcfb02fc441edafe6fafe6e6800009e35'/>
<id>90d6d3dbcfb02fc441edafe6fafe6e6800009e35</id>
<content type='text'>
The patch contains the following changes:

- Private RSA keys can be imported/exported in encrypted form,
  protected according to PKCS#8 and:

  * PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC.
  * PBKDF2WithHMAC-SHA1AndAES128-CBC
  * PBKDF2WithHMAC-SHA1AndAES192-CBC
  * PBKDF2WithHMAC-SHA1AndAES256-CBC

  In addition to that, it is possible to import keys i the
  following weak formats:

  * pbeWithMD5AndDES-CBC
  * pbeWithSHA1AndRC2-CBC
  * pbeWithMD5AndRC2-CBC
  * pbeWithSHA1AndDES-CBC

- The following new module (and 1 new package) are added:

  * Crypto.Util.Padding for simple padding/unpadding logic
  * Crypto.IO._PBES for PBE-related PKCS#5 logic
  * Crypto.IO.PEM for PEM wrapping/unwrapping
  * Crypto.IO.PKCS8 for PKCS#8 wrapping/unwrapping

- All Object ID (OIDs) are now in dotted form to increase
  readability.

- Add AES support to PEM format (decode only).
  The PEM module can decrypt messages protected with AES-CBC.

- Update RSA import test cases.

- Updated to PKCS8 test cases
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The patch contains the following changes:

- Private RSA keys can be imported/exported in encrypted form,
  protected according to PKCS#8 and:

  * PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC.
  * PBKDF2WithHMAC-SHA1AndAES128-CBC
  * PBKDF2WithHMAC-SHA1AndAES192-CBC
  * PBKDF2WithHMAC-SHA1AndAES256-CBC

  In addition to that, it is possible to import keys i the
  following weak formats:

  * pbeWithMD5AndDES-CBC
  * pbeWithSHA1AndRC2-CBC
  * pbeWithMD5AndRC2-CBC
  * pbeWithSHA1AndDES-CBC

- The following new module (and 1 new package) are added:

  * Crypto.Util.Padding for simple padding/unpadding logic
  * Crypto.IO._PBES for PBE-related PKCS#5 logic
  * Crypto.IO.PEM for PEM wrapping/unwrapping
  * Crypto.IO.PKCS8 for PKCS#8 wrapping/unwrapping

- All Object ID (OIDs) are now in dotted form to increase
  readability.

- Add AES support to PEM format (decode only).
  The PEM module can decrypt messages protected with AES-CBC.

- Update RSA import test cases.

- Updated to PKCS8 test cases
</pre>
</div>
</content>
</entry>
<entry>
<title>Hash: Speed up initialization by removing pure-Python wrappers</title>
<updated>2013-02-18T04:07:02+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2013-02-17T19:21:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=fd398a28e3a227a539b264a9f1e11287b904c7da'/>
<id>fd398a28e3a227a539b264a9f1e11287b904c7da</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Hash: Generic Crypto.Hash.new(algo, [data]) function</title>
<updated>2013-02-18T03:18:29+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2013-02-17T19:21:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=0d8ea5ff1607a3d7ae544667bff99229954484ff'/>
<id>0d8ea5ff1607a3d7ae544667bff99229954484ff</id>
<content type='text'>
This allows us to instantiate a new hash given only an existing hash
object.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows us to instantiate a new hash given only an existing hash
object.
</pre>
</div>
</content>
</entry>
<entry>
<title>Hash: Remove "oid" attributes; add "name" attribute</title>
<updated>2013-02-18T03:00:50+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2013-02-17T19:21:28+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=59018ff99c97261f9bbaee33f919938871e05118'/>
<id>59018ff99c97261f9bbaee33f919938871e05118</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
