0008-v5.6-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From bb5c863b3d3cbd10e80b2ebf409934a091058f54 Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <[email protected]>
  3. Date: Fri, 20 Dec 2019 16:02:13 -0300
  4. Subject: [PATCH 02/11] crypto: qce - fix ctr-aes-qce block, chunk sizes
  5. Set blocksize of ctr-aes-qce to 1, so it can operate as a stream cipher,
  6. adding the definition for chucksize instead, where the underlying block
  7. size belongs.
  8. Signed-off-by: Eneas U de Queiroz <[email protected]>
  9. Signed-off-by: Herbert Xu <[email protected]>
  10. ---
  11. drivers/crypto/qce/skcipher.c | 5 ++++-
  12. 1 file changed, 4 insertions(+), 1 deletion(-)
  13. --- a/drivers/crypto/qce/skcipher.c
  14. +++ b/drivers/crypto/qce/skcipher.c
  15. @@ -270,6 +270,7 @@ struct qce_skcipher_def {
  16. const char *name;
  17. const char *drv_name;
  18. unsigned int blocksize;
  19. + unsigned int chunksize;
  20. unsigned int ivsize;
  21. unsigned int min_keysize;
  22. unsigned int max_keysize;
  23. @@ -298,7 +299,8 @@ static const struct qce_skcipher_def skc
  24. .flags = QCE_ALG_AES | QCE_MODE_CTR,
  25. .name = "ctr(aes)",
  26. .drv_name = "ctr-aes-qce",
  27. - .blocksize = AES_BLOCK_SIZE,
  28. + .blocksize = 1,
  29. + .chunksize = AES_BLOCK_SIZE,
  30. .ivsize = AES_BLOCK_SIZE,
  31. .min_keysize = AES_MIN_KEY_SIZE,
  32. .max_keysize = AES_MAX_KEY_SIZE,
  33. @@ -368,6 +370,7 @@ static int qce_skcipher_register_one(con
  34. def->drv_name);
  35. alg->base.cra_blocksize = def->blocksize;
  36. + alg->chunksize = def->chunksize;
  37. alg->ivsize = def->ivsize;
  38. alg->min_keysize = def->min_keysize;
  39. alg->max_keysize = def->max_keysize;