crypto: ccree: fix xts-aes-ccree blocksize
Subsystems (2)
PATCH 1/1 crypto: ccree: fix xts-aes-ccree blocksize
loading ccree on next-20220207 with CRYPTO_MANAGER_EXTRA_TESTS show a warning:
alg: skcipher: blocksize for xts-aes-ccree (1) doesn't match generic impl (16)
alg: self-tests for xts-aes-ccree (xts(aes)) failed (rc=-22)
After setting the correct blocksize, selftests pass.
--- drivers/crypto/ccree/cc_cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/ccree/cc_cipher.c +2 -2
@@ -1010,7 +1010,7 @@ static const struct cc_alg_template skcipher_algs[] = { { .name = "xts(paes)", .driver_name = "xts-paes-ccree", - .blocksize = 1, + .blocksize = XTS_BLOCK_SIZE, .template_skcipher = { .setkey = cc_cipher_sethkey, .encrypt = cc_cipher_encrypt,
@@ -1140,7 +1140,7 @@ static const struct cc_alg_template skcipher_algs[] = {*/ .name = "xts(aes)", .driver_name = "xts-aes-ccree", - .blocksize = 1, + .blocksize = XTS_BLOCK_SIZE, .template_skcipher = { .setkey = cc_cipher_setkey, .encrypt = cc_cipher_encrypt,
Signature · 1 line
2.34.1
Gilad Ben-Yossef
maintainerHi Again,
Thank you for taking the time to look into this!
However, this is an old topic that has been discussed before and the answer really is that the selftests are wrong. They are looking at the wrong thing. Yes, I know...
See the discussion here:
https://www.mail-archive.com/[email protected]/msg40576.html
I also also point out this is actually documented in the code:
+ /* See
https://www.mail-archive.com/[email protected]/msg40576.html
+ * for the reason why this differs from the generic + * implementation. + */
Thanks again!
Gilad
Quoted 38 lines · Corentin Labbe
loading ccree on next-20220207 with
CRYPTO_MANAGER_EXTRA_TESTSshow a warning:
alg: skcipher: blocksize for xts-aes-ccree (1) doesn't match generic impl (16)
alg: self-tests for xts-aes-ccree (xts(aes)) failed (rc=-22)After setting the correct blocksize, selftests pass.
Fixes 67caef08a71f ("crypto: ccree - enable CTS support in AES-XTS")Signed-off-by Corentin Labbe <[email protected]>--- drivers/crypto/ccree/cc_cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/crypto/ccree/cc_cipher.c +2
-3@@ -1010,7 +1010,7 @@ static const struct cc_alg_template skcipher_algs[] = { { .name = "xts(paes)", .driver_name = "xts-paes-ccree", - .blocksize = 1, + .blocksize = XTS_BLOCK_SIZE, .template_skcipher = { .setkey = cc_cipher_sethkey, .encrypt = cc_cipher_encrypt,@@ -1140,7 +1140,7 @@ static const struct cc_alg_template skcipher_algs[] = {*/ .name = "xts(aes)", .driver_name = "xts-aes-ccree", - .blocksize = 1, + .blocksize = XTS_BLOCK_SIZE, .template_skcipher = { .setkey = cc_cipher_setkey, .encrypt = cc_cipher_encrypt, --2.34.1
Signature · 4 lines
Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!
Herbert Xu
maintainerQuoted 15 lines · Gilad Ben-Yossef
Hi Again,
Thank you for taking the time to look into this!
However, this is an old topic that has been discussed before and the answer really is that the selftests are wrong. They are looking at the wrong thing. Yes, I know...
See the discussion here:
https://www.mail-archive.com/[email protected]/msg40576.htmlI also also point out this is actually documented in the code:
+ /* See
https://www.mail-archive.com/[email protected]/msg40576.html
Review
Quoted 3 lines
(quoted diff) +3
-0+ * for the reason why this differs from the generic + * implementation. + */
Indeed. We should instead change the generic algorithm as well as the other drivers that implement XTS.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt