]> 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)
commitc0ff5a76cdc91ee3ed2c1b76be226c40cf850dd9
tree5d65df3dacd78570469a5c1183359595015fdd9b
parenta03dc460aa55340d9e32be1631f5809f871a1518
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