diff --git a/src/internal.c b/src/internal.c index 7906c4c77..6286fd3bd 100644 --- a/src/internal.c +++ b/src/internal.c @@ -13103,10 +13103,10 @@ static int DoDtlsHandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx, #ifdef HAVE_AEAD -#if !defined(NO_PUBLIC_GCM_SET_IV) && \ - (((defined(HAVE_FIPS) || defined(HAVE_SELFTEST)) && \ - (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))) || \ - (defined(HAVE_POLY1305) && defined(HAVE_CHACHA))) +#if (!defined(NO_PUBLIC_GCM_SET_IV) && \ + ((defined(HAVE_FIPS) || defined(HAVE_SELFTEST)) && \ + (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2)))) || \ + (defined(HAVE_POLY1305) && defined(HAVE_CHACHA)) static WC_INLINE void AeadIncrementExpIV(WOLFSSL* ssl) { int i; diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 516884670..504aa6559 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -331,7 +331,7 @@ } HAL_CRYP_DeInit(&hcryp); - #else /* STD_PERI_LIB */ + #else /* Standard Peripheral Library */ ret = wc_Stm32_Aes_Init(aes, &cryptInit, &keyInit); if (ret != 0) return ret; @@ -415,7 +415,7 @@ } HAL_CRYP_DeInit(&hcryp); - #else /* STD_PERI_LIB */ + #else /* Standard Peripheral Library */ ret = wc_Stm32_Aes_Init(aes, &cryptInit, &keyInit); if (ret != 0) return ret; @@ -3065,7 +3065,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) } #endif /* HAVE_AES_DECRYPT */ -#else /* STD_PERI_LIB */ +#else /* Standard Peripheral Library */ int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) { int ret; @@ -3781,7 +3781,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) } HAL_CRYP_DeInit(&hcryp); - #else /* STD_PERI_LIB */ + #else /* Standard Peripheral Library */ ret = wc_Stm32_Aes_Init(aes, &cryptInit, &keyInit); if (ret != 0) { wolfSSL_CryptHwMutexUnLock(); @@ -6065,7 +6065,7 @@ static int wc_AesGcmEncrypt_STM32(Aes* aes, byte* out, const byte* in, word32 sz ret = AES_GCM_AUTH_E; HAL_CRYP_DeInit(&hcryp); -#else /* STD_PERI_LIB */ +#else /* Standard Peripheral Library */ ByteReverseWords(keyCopy, (word32*)aes->key, keySize); status = CRYP_AES_GCM(MODE_ENCRYPT, (uint8_t*)ctr, (uint8_t*)keyCopy, keySize * 8, @@ -6277,15 +6277,9 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, #endif /* WOLFSSL_ASYNC_CRYPT */ #ifdef STM32_CRYPTO_AES_GCM - /* The STM standard peripheral library API's doesn't support partial blocks */ - #ifdef STD_PERI_LIB - if (partial == 0) - #endif - { - return wc_AesGcmEncrypt_STM32( - aes, out, in, sz, iv, ivSz, - authTag, authTagSz, authIn, authInSz); - } + return wc_AesGcmEncrypt_STM32( + aes, out, in, sz, iv, ivSz, + authTag, authTagSz, authIn, authInSz); #endif /* STM32_CRYPTO_AES_GCM */ #ifdef WOLFSSL_AESNI @@ -6507,7 +6501,7 @@ static int wc_AesGcmDecrypt_STM32(Aes* aes, byte* out, HAL_CRYP_DeInit(&hcryp); -#else /* STD_PERI_LIB */ +#else /* Standard Peripheral Library */ ByteReverseWords(keyCopy, (word32*)aes->key, aes->keylen); /* Input size and auth size need to be the actual sizes, even though @@ -6732,14 +6726,9 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, #ifdef STM32_CRYPTO_AES_GCM /* The STM standard peripheral library API's doesn't support partial blocks */ - #ifdef STD_PERI_LIB - if (partial == 0) - #endif - { - return wc_AesGcmDecrypt_STM32( - aes, out, in, sz, iv, ivSz, - authTag, authTagSz, authIn, authInSz); - } + return wc_AesGcmDecrypt_STM32( + aes, out, in, sz, iv, ivSz, + authTag, authTagSz, authIn, authInSz); #endif /* STM32_CRYPTO_AES_GCM */ #ifdef WOLFSSL_AESNI diff --git a/wolfcrypt/src/port/st/stm32.c b/wolfcrypt/src/port/st/stm32.c index b37dbd845..bb20a14d7 100644 --- a/wolfcrypt/src/port/st/stm32.c +++ b/wolfcrypt/src/port/st/stm32.c @@ -299,7 +299,7 @@ int wc_Stm32_Aes_Init(Aes* aes, CRYP_HandleTypeDef* hcryp) return 0; } -#else /* STD_PERI_LIB */ +#else /* Standard Peripheral Library */ int wc_Stm32_Aes_Init(Aes* aes, CRYP_InitTypeDef* cryptInit, CRYP_KeyInitTypeDef* keyInit) diff --git a/wolfssl/wolfcrypt/port/st/stm32.h b/wolfssl/wolfcrypt/port/st/stm32.h index 4b461a113..0e9010756 100644 --- a/wolfssl/wolfcrypt/port/st/stm32.h +++ b/wolfssl/wolfcrypt/port/st/stm32.h @@ -122,7 +122,7 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo, struct Aes; #ifdef WOLFSSL_STM32_CUBEMX int wc_Stm32_Aes_Init(struct Aes* aes, CRYP_HandleTypeDef* hcryp); - #else /* STD_PERI_LIB */ + #else /* Standard Peripheral Library */ int wc_Stm32_Aes_Init(struct Aes* aes, CRYP_InitTypeDef* cryptInit, CRYP_KeyInitTypeDef* keyInit); #endif /* WOLFSSL_STM32_CUBEMX */