]> git.baikalelectronics.ru Git - kernel.git/commit
sparc64: Fix unrolled AES 256-bit key loops.
authorDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2012 23:19:11 +0000 (15:19 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2012 23:19:11 +0000 (15:19 -0800)
commit7333ee74142489fb9ad80432a8372b4a34ba5c1f
tree5d65df3dacd78570469a5c1183359595015fdd9b
parent5065c94ba9b52853672c842eae7df966fa4f6f7e
sparc64: Fix unrolled AES 256-bit key loops.

The basic scheme of the block mode assembler is that we start by
enabling the FPU, loading the key into the floating point registers,
then iterate calling the encrypt/decrypt routine for each block.

For the 256-bit key cases, we run short on registers in the unrolled
loops.

So the {ENCRYPT,DECRYPT}_256_2() macros reload the key registers that
get clobbered.

The unrolled macros, {ENCRYPT,DECRYPT}_256(), are not mindful of this.

So if we have a mix of multi-block and single-block calls, the
single-block unrolled 256-bit encrypt/decrypt can run with some
of the key registers clobbered.

Handle this by always explicitly loading those registers before using
the non-unrolled 256-bit macro.

This was discovered thanks to all of the new test cases added by
Jussi Kivilinna.

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