]> 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)
commitf7356369e73d470923b8c7510280d3405f2ccf04
treea64e4aaf518c85bebfcf51dc90f865a8797bd131
parent05f803ae84daac94dad669fe634638e6c193a776
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