summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2014-02-22 15:04:18 -0800
committerDwayne Litzenberger <dlitz@dlitz.net>2014-02-22 15:04:21 -0800
commit6e16b1720f31e8803658aedd793b27929b04dc8f (patch)
treef3e3976d49a592f3b283415c1a69aa80036a63a5
parenta159be91e140b3e8c80baa016034d2f9a228312f (diff)
downloadpycrypto-6e16b1720f31e8803658aedd793b27929b04dc8f.tar.gz
AESNI: Fix order of alignment & size args in _aligned_malloc
-rw-r--r--src/AESNI.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/AESNI.c b/src/AESNI.c
index 6a200ab..50f0cd6 100644
--- a/src/AESNI.c
+++ b/src/AESNI.c
@@ -63,7 +63,11 @@ static void* aligned_malloc_wrapper(size_t alignment, size_t size)
}
# define aligned_free_wrapper free
#elif defined(HAVE__ALIGNED_MALLOC) /* _aligned_malloc is available on Windows */
-# define aligned_malloc_wrapper _aligned_malloc
+static void* aligned_malloc_wrapper(size_t alignment, size_t size)
+{
+ /* NB: _aligned_malloc takes its args in the opposite order from aligned_alloc */
+ return _aligned_malloc(size, alignment);
+}
# define aligned_free_wrapper _aligned_free
#else
# error "No function to allocate/free aligned memory is available."