OSDN Git Service

crypto: atmel-aes - properly set IV after {en,de}crypt
authorRomain Izard <romain.izard.pro@gmail.com>
Tue, 31 Oct 2017 15:25:23 +0000 (16:25 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Nov 2017 14:11:26 +0000 (22:11 +0800)
commit91308019ecb46047b81d3c769cf5bf6b129ddf02
tree7f456e91e54f9394650786cc75c94a6cfd1d8cbd
parent142a27f0a731ddcf467546960a5585970ca98e21
crypto: atmel-aes - properly set IV after {en,de}crypt

Certain cipher modes like CTS expect the IV (req->info) of
ablkcipher_request (or equivalently req->iv of skcipher_request) to
contain the last ciphertext block when the {en,de}crypt operation is done.

Fix this issue for the Atmel AES hardware engine. The tcrypt test
case for cts(cbc(aes)) is now correctly passed.

In the case of in-place decryption, copy the ciphertext in an
intermediate buffer before decryption.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-aes.c