OpenCloudOS-Kernel/drivers/crypto/amcc
Christian Lamparter bfa2ba7d9e crypto: crypto4xx - fix AES CTR blocksize value
This patch fixes a issue with crypto4xx's ctr(aes) that was
discovered by libcapi's kcapi-enc-test.sh test.

The some of the ctr(aes) encryptions test were failing on the
non-power-of-two test:

kcapi-enc - Error: encryption failed with error 0
kcapi-enc - Error: decryption failed with error 0
[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits):
original file (1d100e..cc96184c) and generated file (e3b0c442..1b7852b855)
[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits)
(openssl generated CT): original file (e3b0..5) and generated file (3..8e)
[PASSED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits)
(openssl generated PT)
[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (password):
original file (1d1..84c) and generated file (e3b..852b855)

But the 16, 32, 512, 65536 tests always worked.

Thankfully, this isn't a hidden hardware problem like previously,
instead this turned out to be a copy and paste issue.

With this patch, all the tests are passing with and
kcapi-enc-test.sh gives crypto4xx's a clean bill of health:
 "Number of failures: 0" :).

Cc: stable@vger.kernel.org
Fixes: 98e87e3d93 ("crypto: crypto4xx - add aes-ctr support")
Fixes: f2a13e7cba ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-05-23 14:13:09 +08:00
..
Makefile crypto: crypto4xx - move and refactor dynamic_contents helpers 2017-09-22 17:43:18 +08:00
crypto4xx_alg.c crypto: crypto4xx - use sync skcipher for fallback 2019-05-03 14:03:29 +08:00
crypto4xx_core.c crypto: crypto4xx - fix AES CTR blocksize value 2019-05-23 14:13:09 +08:00
crypto4xx_core.h crypto: crypto4xx - get rid of redundant using_sd variable 2019-05-03 14:03:29 +08:00
crypto4xx_reg_def.h crypto: crypto4xx - add prng crypto support 2019-01-11 14:16:56 +08:00
crypto4xx_sa.h crypto: crypto4xx - prepare for AEAD support 2017-10-12 22:55:19 +08:00
crypto4xx_trng.c crypto: crypto4xx - add missing of_node_put after of_device_is_available 2019-02-28 14:37:35 +08:00
crypto4xx_trng.h crypto: crypto4xx - Fix wrong ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments 2019-02-01 14:42:04 +08:00