@@ -254,7 +254,7 @@ otcrypto_status_t otcrypto_hmac(const otcrypto_blinded_key_t *key,
254254 kOtcryptoKeySecurityLevelMedium );
255255 HARDENED_TRY (hmac_hmac_sha256_cl (& hmac_key , input_message , tag ));
256256 // Second HMAC computation using the HMAC core.
257- uint32_t tag_redundant_data [tag -> len ];
257+ uint32_t tag_redundant_data [kHmacSha256DigestWords ];
258258 otcrypto_word32_buf_t tag_redundant = OTCRYPTO_MAKE_BUF (
259259 otcrypto_word32_buf_t , tag_redundant_data , tag -> len );
260260 hmac_key_t hmac_key_redundant ;
@@ -276,7 +276,7 @@ otcrypto_status_t otcrypto_hmac(const otcrypto_blinded_key_t *key,
276276 // First HMAC computation using the HMAC core.
277277 HARDENED_TRY (hmac_hmac_sha256_cl (& hmac_key , input_message , tag ));
278278 // Second HMAC computation without using the HMAC core.
279- uint32_t tag_redundant_data [tag -> len ];
279+ uint32_t tag_redundant_data [kHmacSha256DigestWords ];
280280 otcrypto_word32_buf_t tag_redundant = OTCRYPTO_MAKE_BUF (
281281 otcrypto_word32_buf_t , tag_redundant_data , tag -> len );
282282 hmac_key_t hmac_key_redundant ;
@@ -308,7 +308,7 @@ otcrypto_status_t otcrypto_hmac(const otcrypto_blinded_key_t *key,
308308 kOtcryptoKeySecurityLevelMedium );
309309 HARDENED_TRY (hmac_hmac_sha384 (& hmac_key , input_message , tag ));
310310 // Second HMAC computation using the HMAC core.
311- uint32_t tag_redundant_data [tag -> len ];
311+ uint32_t tag_redundant_data [kHmacSha384DigestWords ];
312312 otcrypto_word32_buf_t tag_redundant = OTCRYPTO_MAKE_BUF (
313313 otcrypto_word32_buf_t , tag_redundant_data , tag -> len );
314314 hmac_key_t hmac_key_redundant ;
@@ -330,7 +330,7 @@ otcrypto_status_t otcrypto_hmac(const otcrypto_blinded_key_t *key,
330330 // First HMAC computation using the HMAC core.
331331 HARDENED_TRY (hmac_hmac_sha384 (& hmac_key , input_message , tag ));
332332 // Second HMAC computation without using the HMAC core.
333- uint32_t tag_redundant_data [tag -> len ];
333+ uint32_t tag_redundant_data [kHmacSha384DigestWords ];
334334 otcrypto_word32_buf_t tag_redundant = OTCRYPTO_MAKE_BUF (
335335 otcrypto_word32_buf_t , tag_redundant_data , tag -> len );
336336 hmac_key_t hmac_key_redundant ;
@@ -362,7 +362,7 @@ otcrypto_status_t otcrypto_hmac(const otcrypto_blinded_key_t *key,
362362 kOtcryptoKeySecurityLevelMedium );
363363 HARDENED_TRY (hmac_hmac_sha512 (& hmac_key , input_message , tag ));
364364 // Second HMAC computation using the HMAC core.
365- uint32_t tag_redundant_data [tag -> len ];
365+ uint32_t tag_redundant_data [kHmacSha512DigestWords ];
366366 otcrypto_word32_buf_t tag_redundant = OTCRYPTO_MAKE_BUF (
367367 otcrypto_word32_buf_t , tag_redundant_data , tag -> len );
368368 hmac_key_t hmac_key_redundant ;
@@ -384,7 +384,7 @@ otcrypto_status_t otcrypto_hmac(const otcrypto_blinded_key_t *key,
384384 // First HMAC computation using the HMAC core.
385385 HARDENED_TRY (hmac_hmac_sha512 (& hmac_key , input_message , tag ));
386386 // Second HMAC computation without using the HMAC core.
387- uint32_t tag_redundant_data [tag -> len ];
387+ uint32_t tag_redundant_data [kHmacSha512DigestWords ];
388388 otcrypto_word32_buf_t tag_redundant = OTCRYPTO_MAKE_BUF (
389389 otcrypto_word32_buf_t , tag_redundant_data , tag -> len );
390390 hmac_key_t hmac_key_redundant ;
0 commit comments