Merge pull request #2105 from dgarske/fix_stm_aesgcm

Fix for STM32 AES GCM
This commit is contained in:
toddouska 2019-02-20 09:23:11 -08:00 committed by GitHub
commit b8dc772ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5450,8 +5450,8 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
defined(WOLFSSL_STM32F7) || \
defined(WOLFSSL_STM32L4))
/* STM32 HW only supports 12 byte IV and 16 byte auth */
if (ivSz == GCM_NONCE_MID_SZ && authInSz == AES_BLOCK_SIZE) {
/* STM32 HW only supports 12 byte IV */
if (ivSz == GCM_NONCE_MID_SZ) {
return wc_AesGcmEncrypt_STM32(aes, out, in, sz, iv, ivSz,
authTag, authTagSz, authIn, authInSz);
}
@ -5853,8 +5853,8 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
defined(WOLFSSL_STM32F7) || \
defined(WOLFSSL_STM32L4))
/* STM32 HW only supports 12 byte IV and 16 byte auth */
if (ivSz == GCM_NONCE_MID_SZ && authInSz == AES_BLOCK_SIZE) {
/* STM32 HW only supports 12 byte IV */
if (ivSz == GCM_NONCE_MID_SZ) {
return wc_AesGcmDecrypt_STM32(aes, out, in, sz, iv, ivSz,
authTag, authTagSz, authIn, authInSz);
}