summaryrefslogtreecommitdiffstats
path: root/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-01 22:03:43 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-01 22:03:43 +0200
commit181715c5bc6e74f87fe284b063ca301a300ad098 (patch)
treed8fd0089df6521cb69d12971efba5d8e90c611cf /src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c
parent1a30018711528fe51fb17c70b8c1d9300c925c1c (diff)
downloadfastd-181715c5bc6e74f87fe284b063ca301a300ad098.tar
fastd-181715c5bc6e74f87fe284b063ca301a300ad098.zip
Add alloc helpers for aligned allocations
Diffstat (limited to 'src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c')
-rw-r--r--src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c b/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c
index 6117735..040ce14 100644
--- a/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c
+++ b/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c
@@ -31,7 +31,7 @@
#include "ghash_pclmulqdq.h"
-#include "../../../../log.h"
+#include "../../../../alloc.h"
#include <wmmintrin.h>
#include <emmintrin.h>
@@ -79,9 +79,7 @@ static inline __m128i byteswap(__m128i v) {
/** Initializes the state used by this GHASH implementation */
fastd_mac_state_t * fastd_ghash_pclmulqdq_init(const uint8_t *key) {
- fastd_mac_state_t *state;
- if (posix_memalign((void **)&state, 16, sizeof(fastd_mac_state_t)))
- abort();
+ fastd_mac_state_t *state = fastd_new_aligned(fastd_mac_state_t, 16);
memcpy(&state->H, key, sizeof(__m128i));
state->H.v = byteswap(state->H.v);