diff options
author | Legrandin <helderijs@gmail.com> | 2013-05-28 23:57:56 +0200 |
---|---|---|
committer | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-10-20 13:30:21 -0700 |
commit | 5d7ab24c513fb43a604ad23b23d040a53069c4db (patch) | |
tree | b024034c16e14454e94756690c88b9acb52e0422 /setup.py | |
parent | 199a9741a1849066d070b114333fcf90bc73c55a (diff) | |
download | pycrypto-5d7ab24c513fb43a604ad23b23d040a53069c4db.tar.gz |
Add support for GCM mode (AES only).
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"]
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -477,6 +477,9 @@ kw = {'name':"pycrypto", Extension("Crypto.Util.cpuid", include_dirs=['src/'], sources=['src/cpuid.c']), + Extension("Crypto.Util.galois", + include_dirs=['src/'], + sources=['src/galois.c']), # Counter modules Extension("Crypto.Util._counter", |