git: padlock - Properly align data

Alex Hornung alexh at
Sat Aug 21 06:29:33 PDT 2010

commit a702ec91d1960a1d75cebedfe310096377682ff8
Author: Alex Hornung <ahornung at>
Date:   Sat Aug 21 11:46:17 2010 +0100

    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@)

Summary of changes:
 sys/crypto/via/padlock.c |   14 +++++++++++---
 sys/crypto/via/padlock.h |    3 ++-
 2 files changed, 13 insertions(+), 4 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list