diff options
author | Micah Anderson <micah@riseup.net> | 2013-08-22 16:39:52 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-08-22 16:39:52 -0400 |
commit | 5e60e0e3af85f22aa0afe8bf0ecf85619afacfeb (patch) | |
tree | 6a91a3de86fa8de0b4167cc947ab72991bf8da31 /pycryptopp/test/test_from_Nikratio.py | |
parent | 30e9097985656920f01a72efc1088caa2b8d41b3 (diff) |
Imported Upstream version 0.6.0.12upstream/0.6.0.12
Diffstat (limited to 'pycryptopp/test/test_from_Nikratio.py')
-rw-r--r-- | pycryptopp/test/test_from_Nikratio.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/pycryptopp/test/test_from_Nikratio.py b/pycryptopp/test/test_from_Nikratio.py deleted file mode 100644 index a991415..0000000 --- a/pycryptopp/test/test_from_Nikratio.py +++ /dev/null @@ -1,32 +0,0 @@ -import unittest - -# This was reported as triggering a "Use of uninitialised value of -# size 4" under valgrind by Nikratio in pycryptopp-0.5.17 and Crypto++ -# 5.6.0. See http://tahoe-lafs.org/trac/pycryptopp/ticket/67 - -class T(unittest.TestCase): - def test_t(self): - import hmac - import pycryptopp - try: - import hashlib - except ImportError: - # Oh nevermind. - return - import struct - - def encrypt(buf, passphrase, nonce): - - key = hashlib.sha256(passphrase + nonce).digest() - cipher = pycryptopp.cipher.aes.AES(key) - hmac_ = hmac.new(key, digestmod=hashlib.sha256) - - hmac_.update(buf) - buf = cipher.process(buf) - hash_ = cipher.process(hmac_.digest()) - - return ''.join( - (struct.pack('<B', len(nonce)), - nonce, hash_, buf)) - - encrypt('foobar', 'passphrase', 'nonce') |