summaryrefslogtreecommitdiff
path: root/pct-speedtest.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix speedtest run for ECB modes.Richard Mitchell2014-06-221-0/+2
|
* Add key setup speed benchmark for all AEAD modes.Legrandin2013-10-201-6/+27
|
* Add support for GCM mode (AES only).Legrandin2013-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change done by this commit is adding support for MODE_GCM (NIST SP 800 38D). Test vectors are included. The mode uses a C extension (Crypto.Util.galois._ghash) to compute the GHASH step. The C implementation is the most basic one and it is still significantly (5x times) slower than CTR. Optimizations can be introduced using tables (CPU/memory trade-off) or even AES NI instructions on newer x86 CPUs. This patch also simplifies Crypto.Cipher.blockalgo.py by: * removing duplicated code previously shared by digest() and verify(). * removing duplicated code previously shared by Crypto.Hash.CMAC and Crypto.Cipher.block_algo (management of internal buffers for MACs that can only operate on block aligned data, like CMAC, CBCMAC, and now also GHASH). [dlitz@dlitz.net: Included changes from the following commits from the author's pull request:] - [9c13f9c] Rename 'IV' parameter to 'nonce' for AEAD modes. - [ca460a7] Made blockalgo.py more PEP-8 compliant; The second parameter of the _GHASH constructor is now the length of the block (block_size) and not the full module. [dlitz@dlitz.net: Replaced MacMismatchError with ValueError] [dlitz@dlitz.net: Replaced ApiUsageError with TypeError] [dlitz@dlitz.net: Replaced renamed variable `ht` with original `h`] [dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
* Add EAX authenticated encryption modeLegrandin2013-10-201-0/+2
| | | | | | | | | [dlitz@dlitz.net: Included changes from the following commits from the author's pull request:] - [9c13f9c] Rename 'IV' parameter to 'nonce' for AEAD modes. - [ca460a7] Made blockalgo.py more PEP-8 compliant; The second parameter of the _GHASH constructor is now the length of the block (block_size) and not the full module. [dlitz@dlitz.net: Fixed unresolved conflict in lib/Crypto/Cipher/blockalgo.py]
* Add support for CCM mode (AES only).Legrandin2013-10-201-0/+4
| | | | | | | | | | | | | | [dlitz@dlitz.net: Included changes from the following commits from the author's pull request:] - [5306cf3] Added support for CCM mode (AES cipher only) - [9abe301] Added CCM tests - [f0c1395] Add MacMismatchError and ApiUsageError - [fb62fae] ApiUsageError becomes TypeError - [9c13f9c] Rename 'IV' parameter to 'nonce' for AEAD modes. - [4ec64d8] Removed last references to ApiUsageError - [80bfd35] Corrected AES-CCM examples [dlitz@dlitz.net: Removed unrelated documentation change] [dlitz@dlitz.net: Renamed 'targs' back to 'args'] [dlitz@dlitz.net: Whitespace fixed with "git rebase --whitespace=fix"]
* Add support for CMACLegrandin2013-10-201-1/+19
| | | | | | | 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"]
* Add CTR mode benchmarkLegrandin2013-10-201-0/+8
|
* pct-speedtest.py: Add CTR-mode testsDwayne Litzenberger2013-07-141-0/+8
|
* pct-speedtest.py: Test the random moduleDwayne Litzenberger2013-04-211-0/+19
|
* pct-speedtest.py: Add PKCS#1 signing and verificationDwayne Litzenberger2013-02-171-0/+71
|
* Hash: Rename SHA->SHA1 and RIPEMD->RIPEMD160 (pct-speedtest.py)Dwayne Litzenberger2013-02-171-2/+7
| | | | Oops, I missed this one.
* Hash: Rename SHA->SHA1 and RIPEMD->RIPEMD160 (1/2)Dwayne Litzenberger2013-02-161-5/+10
| | | | | | | | | These algorithm names were confusing, because there are actually algorithms called "SHA" (a.k.a. SHA-0) and "RIPEMD" (the original version). This commit just renames the modules, with no backward-compatibility support.
* pct-speedtest.py: Test HMAC modulesDwayne Litzenberger2013-02-161-1/+23
|
* pct-speedtest.py: Add some commentsDwayne Litzenberger2013-02-161-0/+5
|
* pct-speedtest.py: Also test the standard hashlib modules, if possibleDwayne Litzenberger2013-02-161-8/+28
| | | | | On my machine, hashlib is about 5x faster than PyCrypto for single-block inputs. :( (It's about the same for long inputs.)
* pct-speedtest.py: Add tests for SHA224/SHA384/SHA512Dwayne Litzenberger2013-02-161-1/+4
|
* pct-speedtest.py: Python 3 compatibilityDwayne Litzenberger2013-02-161-4/+4
|
* pct-speedtest.py: Python 2.1-2.3 compatibilityDwayne Litzenberger2013-02-161-1/+8
| | | | They don't have os.urandom, so use Crypto.Random.get_random_bytes
* Performance test: display CFB-8 as CFB mode being testLegrandin2012-05-181-1/+1
|
* Added OPENPGP speed testLegrandin2012-05-171-0/+1
|
* Removed PGP mode from block ciphersLegrandin2012-05-141-1/+0
|
* add MODE_ECB testwindwiny2012-01-131-0/+1
|
* getStrongPrime() implementationLorenz Quack2010-06-101-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From http://lists.dlitz.net/pipermail/pycrypto/2009q4/000167.html, with the following explanation included in the email: === snip === Hi there! Here comes my monster patch. It includes a python and C version of getStrongPrime, rabinMillerTest and isPrime. there are also two small unit tests and some helper functions. They all take a randfunc and propagate them (or so I hope). The Rabin-Miller-Test uses random bases (non-deterministic). getStrongPrime and isPrime take an optional parameter "false_positive_prob" where one can specify the maximum probability that the prime is actually composite. Internally the functions calculate the Rabin-Miller rounds from this. It defaults to 1e-6 (1:1000000) which results in 10 rounds of Rabin-Miller testing. Please review this carefully. Even though I tried hard to get things right some bugs always slip through. maybe you could also review the way I acquire and release the GIL. It felt kind of ugly the way I did it but I don't see a better way just now. Concerning the public exponent e: I now know why it needs to be coprime to p-1 and q-1. The private exponent d is the inverse of e mod ((p-1)(q-1)). If e is not coprime to ((p-1)(q-1)) then the inverse does not exist [1]. The getStrongPrime take an optional argument e. if provided the function will make sure p-1 and e are coprime. if e is even (p-1)/2 will be coprime. if e is even then there is a additional constraint: p =/= q mod 8. I can't check for that in getStrongPrime of course but since we hardcoded e to be odd in _RSA.py this should pose no problem. The Baillie-PSW-Test is not included. I tried hard not to use any functionality new than 2.1 but if you find anything feel free to criticize. Also if I didn't get the coding style right either tell me or feel free to correct it yourself. have fun. //Lorenz [1] http://mathworld.wolfram.com/ModularInverse.html === snip ===
* Add support for the XOR cipher to pct-speedtest.pyDwayne C. Litzenberger2009-08-021-1/+3
|
* Add pct-speedtest.pyDwayne C. Litzenberger2009-03-111-0/+198