Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit b3db979

Browse files
committed
Fix alignment in gfmul_generic (closes #334)
This fixes a test-suite segfault on Darwin with -O0. Before this change: $ cabal run -O0 test-cryptonite -- -p AE1 Segmentation fault: 11 with Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 test-cryptonite 0x0000000108f7f61f gfmul_generic + 47 1 test-cryptonite 0x0000000108f76f17 ghash_add + 71 2 test-cryptonite 0x0000000108f743b4 cryptonite_aesni_gcm_encrypt128 + 2244 3 test-cryptonite 0x0000000108f97f20 cryptonite_aes_gcm_encrypt + 96 4 test-cryptonite 0x0000000108eeadf5 Lc8Pq_info + 197
1 parent 8698c9f commit b3db979

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cbits/aes/x86ni.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static __m128i gfmulx(__m128i v)
165165
TARGET_AESNI
166166
static __m128i gfmul_generic(__m128i tag, const table_4bit htable)
167167
{
168-
aes_block _t;
168+
aes_block _t ALIGNMENT(16);
169169
_mm_store_si128((__m128i *) &_t, tag);
170170
cryptonite_aes_generic_gf_mul(&_t, htable);
171171
tag = _mm_load_si128((__m128i *) &_t);

0 commit comments

Comments
 (0)