crypto: aes-ni - Add support for more modes
authorHuang Ying <ying.huang@intel.com>
Sun, 29 Mar 2009 07:41:20 +0000 (15:41 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 2 Jun 2009 04:04:16 +0000 (14:04 +1000)
commit2cf4ac8beb9dc50a315a6155b7b70e754d511958
tree0c4043a1455ab581b4e505604df290acd59ef79e
parent150c7e85526e80474b87004f4b420e8834fdeb43
crypto: aes-ni - Add support for more modes

Because kernel_fpu_begin() and kernel_fpu_end() operations are too
slow, the performance gain of general mode implementation + aes-aesni
is almost all compensated.

The AES-NI support for more modes are implemented as follow:

- Add a new AES algorithm implementation named __aes-aesni without
  kernel_fpu_begin/end()

- Use fpu(<mode>(AES)) to provide kenrel_fpu_begin/end() invoking

- Add <mode>(AES) ablkcipher, which uses cryptd(fpu(<mode>(AES))) to
  defer cryption to cryptd context in soft_irq context.

Now the ctr, lrw, pcbc and xts support are added.

Performance testing based on dm-crypt shows that cryption time can be
reduced to 50% of general mode implementation + aes-aesni implementation.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_glue.c
crypto/Kconfig