]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccree - use CBC-CS3 CTS mode
authorGilad Ben-Yossef <gilad@benyossef.com>
Sun, 1 Jul 2018 07:02:38 +0000 (08:02 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 8 Jul 2018 16:33:36 +0000 (00:33 +0800)
commit6da42a4df9ea2ba9108b8deebcf98048752881bb
treea64e4aaf518c85bebfcf51dc90f865a8797bd131
parentd35ffcb7db658bee79e4a47312b0a86d0bf18561
crypto: ccree - use CBC-CS3 CTS mode

The ccree driver implemented NIST 800-38A CBC-CS2 ciphertext format,
which only reverses the last two blocks if the stolen ciphertext amount
are none zero. Move it to the kernel chosen format of CBC-CS3  which swaps
the final blocks unconditionally and rename it to "cts" now that it
complies with the kernel format and passes the self tests.

Ironically, the CryptoCell REE HW does just that, so the fix is dropping
the code that forced it to use plain CBC if the ciphertext was block
aligned.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_cipher.c