Use fewer bits for block_size
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/library/cmac.c b/library/cmac.c
index 48f51df..2e9c1a1 100644
--- a/library/cmac.c
+++ b/library/cmac.c
@@ -119,7 +119,7 @@
mbedtls_platform_zeroize(L, sizeof(L));
- block_size = ctx->cipher_info->block_size;
+ block_size = mbedtls_cipher_info_get_block_size(ctx->cipher_info);
/* Calculate Ek(0) */
if ((ret = mbedtls_cipher_update(ctx, L, block_size, L, &olen)) != 0) {
@@ -226,7 +226,7 @@
}
cmac_ctx = ctx->cmac_ctx;
- block_size = ctx->cipher_info->block_size;
+ block_size = mbedtls_cipher_info_get_block_size(ctx->cipher_info);
state = ctx->cmac_ctx->state;
/* Is there data still to process from the last call, that's greater in
@@ -295,7 +295,7 @@
}
cmac_ctx = ctx->cmac_ctx;
- block_size = ctx->cipher_info->block_size;
+ block_size = mbedtls_cipher_info_get_block_size(ctx->cipher_info);
state = cmac_ctx->state;
mbedtls_platform_zeroize(K1, sizeof(K1));