]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: atmel-tdes - Set the IV after {en,de}crypt
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 15 Nov 2019 13:49:06 +0000 (13:49 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Nov 2019 10:48:37 +0000 (18:48 +0800)
commitce71d72bf539409d602ef130ef717b36195a5842
treef35120081e5dc14cd9635aff0577fccb0886a525
parentbed3dfb9db85fb6629e77ad2b1931feac342c363
crypto: atmel-tdes - Set the IV after {en,de}crypt

The req->iv of the skcipher_request is expected to contain the
last ciphertext block when the {en,de}crypt operation is done.
In case of in-place decryption, copy the ciphertext in an
intermediate buffer before decryption.

This fixes the following tcrypt tests:
alg: skcipher: atmel-cbc-des encryption test failed (wrong output IV) on test vector 0, cfg="in-place"
00000000: fe dc ba 98 76 54 32 10
alg: skcipher: atmel-cbc-tdes encryption test failed (wrong output IV) on test vector 0, cfg="in-place"
00000000: 7d 33 88 93 0f 93 b2 42

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-tdes.c