Be more consistent with spaces and tabs

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Add block_finalize to clean up block_state from ALGdealloc

This is the counterpart to block_init which is called from ALGnew.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Make sure that ek and dk are aligned at 16 byte boundaries

ek and dk are used as operands in instructions that require 16 byte alignment.

Thanks to Greg Price for finding this issue.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Add a wrapper for posix_memalign and friends

This also fixes the order of arguments passed to _aligned_malloc.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Sign the hash in the the PKCS1_PSS doctest, not the key

As it stood before this commit, the hash was never used in the signing
process.  It looks like the bug was introduced by e053629 (Restructure
both PKCS#1 signature schemes as objects, 2011-10-16), which changed:

-    >>> signature = PKCS1_PSS.sign(h, key)
+    >>> signer = PKCS1_PSS.new(key)
+    >>> signature = PKCS1_PSS.sign(key)
Throw exception when IV is used with ECB or CTR

The IV parameter is currently ignored when initializing
a cipher in ECB or CTR mode.

For CTR mode, it is confusing: it takes some time to see
that a different parameter is needed (the counter).

For ECB mode, it is outright dangerous.

This patch forces an exception to be raised.
Fix exception string for incorrect key length (DES)
Better example (with nonce) for Counter object
Fixed sentence in CCM example
Fix typo in error string
Add wrapper for free

For _aligned_malloc calling free is illegal. We need to use_aligned_free
instead.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Check return value of posix_memalign

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Prefer C11's aligned_alloc if it is available

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Use different method for getting ext_suffix

```
ext_suffix = get_config_var("EXT_SUFFIX") or get_config_var("SO")
```

because `get_config_var("SO")` returns None in Python 3.4.0a4 because the "SO"
variable is deprecated and "EXT_SUFFIX" is the new way to get this information
(see: http://bugs.python.org/issue19555)

This fixes `TypeError: Can't convert 'NoneType' object to str implicitly`
errors when running the tests on Python 3.4.0a4.
Refactor 3 places handling fastmath ImportError

so that they call `Crypto.SelfTest.st_common.handle_fastmath_import_error`,
thereby eliminiating duplicate code.
Fix handle_fastmath_import_error (broken due to incorrect path in the previous commit)

Tested on py21-py33 by force-uninstalling libgmp10 after building.
Merge pull request #62 (Fixes AESNI alignment bug)
Clean up AESNI aligned malloc() wrappers

- Set errno properly when using posix_memalign
- Rename to aligned_malloc_wrapper / aligned_free_wrapper
- Use a single set of #if blocks, to avoid the possibility of
  mismatching them.
Regenerate autoconf files
Add Python 3.4.0rc1 to tools/create-pythons.sh