]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commit
sparc64: Fix bugs in unrolled 256-bit loops.
authorDavid S. Miller <davem@davemloft.net>
Sun, 2 Sep 2012 06:05:43 +0000 (23:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Sep 2012 06:05:43 +0000 (23:05 -0700)
commit699871bc943be418be13208526bc613d68017fab
treed65e584a1b7d71601a8acfae81262237c402b5e1
parent7cff82f5f42a938a1b633e121a41d29c81de18bb
sparc64: Fix bugs in unrolled 256-bit loops.

Some dm-crypt testing revealed several bugs in the 256-bit unrolled
loops.

The DECRYPT_256_2() macro had two errors:

1) Missing reload of KEY registers %f60 and %f62

2) Missing "\" in penultimate line of definition.

In aes_sparc64_ecb_decrypt_256, we were storing the second half of the
encryption result from the wrong source registers.

In aes_sparc64_ctr_crypt_256 we have to be careful when we fall out of
the 32-byte-at-a-time loop and handle a trailing 16-byte chunk.  In
that case we've clobbered the final key holding registers and have to
restore them before executing the ENCRYPT_256() macro.  Inside of the
32-byte-at-a-time loop things are OK, because we do this key register
restoring during the first few rounds of the ENCRYPT_256_2() macro.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/crypto/aes_asm.S