Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccree - fix some reported cipher block sizes

OFB and CTR modes block sizes were wrongfully reported as
the underlying block sizes. Fix it to 1 bytes as they
turn the block ciphers into stream ciphers.

Also document why our XTS differes from the generic
implementation.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Gilad Ben-Yossef and committed by
Herbert Xu
4aaefb62 504e84ab

+6 -2
+6 -2
drivers/crypto/ccree/cc_cipher.c
··· 1228 1228 .sec_func = true, 1229 1229 }, 1230 1230 { 1231 + /* See https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg40576.html 1232 + * for the reason why this differs from the generic 1233 + * implementation. 1234 + */ 1231 1235 .name = "xts(aes)", 1232 1236 .driver_name = "xts-aes-ccree", 1233 1237 .blocksize = 1, ··· 1427 1423 { 1428 1424 .name = "ofb(aes)", 1429 1425 .driver_name = "ofb-aes-ccree", 1430 - .blocksize = AES_BLOCK_SIZE, 1426 + .blocksize = 1, 1431 1427 .template_skcipher = { 1432 1428 .setkey = cc_cipher_setkey, 1433 1429 .encrypt = cc_cipher_encrypt, ··· 1580 1576 { 1581 1577 .name = "ctr(sm4)", 1582 1578 .driver_name = "ctr-sm4-ccree", 1583 - .blocksize = SM4_BLOCK_SIZE, 1579 + .blocksize = 1, 1584 1580 .template_skcipher = { 1585 1581 .setkey = cc_cipher_setkey, 1586 1582 .encrypt = cc_cipher_encrypt,