aesni: Align all class instances to 16 byte boundaries

While the required members are aligned in the struct as required, on 32-bit
platforms the allocator aligns the structures itself to 8 bytes only. This
results in non-aligned struct members, and invalid memory accesses.
This commit is contained in:
Martin Willi
2015-04-15 13:44:40 +02:00
parent 0c83225883
commit 93f0080265
7 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -244,7 +244,7 @@ METHOD(aesni_key_t, destroy, void,
private_aesni_key_t *this)
{
memwipe(this, sizeof(*this) + (this->public.rounds + 1) * AES_BLOCK_SIZE);
free(this);
free_align(this);
}
/**
@@ -270,7 +270,7 @@ aesni_key_t *aesni_key_create(bool encrypt, chunk_t key)
return NULL;
}
INIT_EXTRA(this, (rounds + 1) * AES_BLOCK_SIZE,
INIT_EXTRA_ALIGN(this, (rounds + 1) * AES_BLOCK_SIZE, sizeof(__m128i),
.public = {
.destroy = _destroy,
.rounds = rounds,