]> git.proxmox.com Git - mirror_ubuntu-disco-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)
commit84f366dadc6a03dd39a3f4b2fc63347f04a56628
treea64e4aaf518c85bebfcf51dc90f865a8797bd131
parentd6b609d1b8e99694cfc47180e395f14fde68addb
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