drivers: crypto: stm32: AES CTR IV is 16bytes

AES-CTR IV is the same as the block size 128-bits(16 bytes)
 regardless of key size.

Signed-off-by: Chris LaFlash <chris-github@laflash.com>
This commit is contained in:
Chris LaFlash 2024-05-17 23:07:51 -07:00 committed by Alberto Escolar
parent fec0aaa80e
commit e94adf1e2b

View file

@ -234,7 +234,7 @@ static int crypto_stm32_ctr_encrypt(struct cipher_ctx *ctx,
{
int ret;
uint32_t ctr[BLOCK_LEN_WORDS] = {0};
int ivlen = ctx->keylen - (ctx->mode_params.ctr_info.ctr_len >> 3);
int ivlen = BLOCK_LEN_BYTES - (ctx->mode_params.ctr_info.ctr_len >> 3);
struct crypto_stm32_session *session = CRYPTO_STM32_SESSN(ctx);
@ -257,7 +257,7 @@ static int crypto_stm32_ctr_decrypt(struct cipher_ctx *ctx,
{
int ret;
uint32_t ctr[BLOCK_LEN_WORDS] = {0};
int ivlen = ctx->keylen - (ctx->mode_params.ctr_info.ctr_len >> 3);
int ivlen = BLOCK_LEN_BYTES - (ctx->mode_params.ctr_info.ctr_len >> 3);
struct crypto_stm32_session *session = CRYPTO_STM32_SESSN(ctx);