WSL2-Linux-Kernel/drivers/crypto/keembay
Daniele Alessandrelli 0db5bc85c5 crypto: keembay-ocs-aes - Fix 'q' assignment during CCM B0 generation
In ocs_aes_ccm_write_b0(), 'q' (the octet length of the binary
representation of the octet length of the payload) is set to 'iv[0]',
while it should be set to 'iv[0] & 0x7' (i.e., only the last 3
bits of iv[0] should be used), as documented in NIST Special Publication
800-38C:
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38c.pdf

In practice, this is not an issue, since 'iv[0]' is checked to be in the
range [1-7] by ocs_aes_validate_inputs(), but let's fix the assignment
anyway, in order to make the code more robust.

Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2021-02-10 17:55:59 +11:00
..
Kconfig crypto: keembay-ocs-hcu - Add dependency on HAS_IOMEM and ARCH_KEEMBAY 2021-01-14 17:43:10 +11:00
Makefile crypto: keembay - Add Keem Bay OCS HCU driver 2021-01-03 08:41:36 +11:00
keembay-ocs-aes-core.c crypto: keembay - Add support for Keem Bay OCS AES/SM4 2020-12-11 21:12:05 +11:00
keembay-ocs-hcu-core.c crypto: keembay-ocs-hcu - Fix a WARN() message 2021-01-14 17:10:30 +11:00
ocs-aes.c crypto: keembay-ocs-aes - Fix 'q' assignment during CCM B0 generation 2021-02-10 17:55:59 +11:00
ocs-aes.h crypto: keembay - Add support for Keem Bay OCS AES/SM4 2020-12-11 21:12:05 +11:00
ocs-hcu.c crypto: keembay-ocs-hcu - Add HMAC support 2021-01-03 08:41:36 +11:00
ocs-hcu.h crypto: keembay-ocs-hcu - Add HMAC support 2021-01-03 08:41:36 +11:00