padlock - Properly align data
authorAlex Hornung <ahornung@gmail.com>
Sat, 21 Aug 2010 10:46:17 +0000 (11:46 +0100)
committerAlex Hornung <ahornung@gmail.com>
Sat, 21 Aug 2010 13:12:28 +0000 (14:12 +0100)
commita702ec91d1960a1d75cebedfe310096377682ff8
tree40ad8267b9a628948015ce9c49315befb75209eb
parent1f26af6e4b0512d444bd50fe484b8aaf2ab93e6f
padlock - Properly align data

* Most parameters to the xcrypt instruction need to be aligned to 16
  bytes. So far we haven't been aligning some of the data such as the
  key, iv and control structure. Refer to the "VIA PadLock Programming
  Guide" for more details.

* Address this by allocating a bit more
  space and setting stuff up at 16-byte boundaries and ensuring gcc
  aligns the whole structure 16-bytish. While this wastes some memory,
  it is negligible.

* This fixes the issue with encryption and decryption with padlock
  causing general protection faults.

Reported-by: Jan Lentfer (lentferj@)
sys/crypto/via/padlock.c
sys/crypto/via/padlock.h