Skip to content

Commit 86789f9

Browse files
authored
Merge pull request #9446 from dgarske/stm32_castwarn
Fix stm32.c type warnings
2 parents 76fec60 + 64c03fa commit 86789f9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

wolfcrypt/src/port/st/stm32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ int stm32_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash,
10341034
if (hashlen > STM32_MAX_ECC_SIZE) {
10351035
return ECC_BAD_ARG_E;
10361036
}
1037-
else if (hashlen > size) {
1037+
else if ((int)hashlen > size) {
10381038
/* in the case that hashlen is larger than key size place hash at
10391039
* beginning of buffer */
10401040
XMEMCPY(Hashbin, hash, size);
@@ -1141,7 +1141,7 @@ int stm32_ecc_sign_hash_ex(const byte* hash, word32 hashlen, WC_RNG* rng,
11411141
if (hashlen > STM32_MAX_ECC_SIZE) {
11421142
return ECC_BAD_ARG_E;
11431143
}
1144-
else if (hashlen > size) {
1144+
else if ((int)hashlen > size) {
11451145
/* in the case that hashlen is larger than key size place hash at
11461146
* beginning of buffer */
11471147
XMEMCPY(Hashbin, hash, size);

wolfssl/wolfcrypt/port/st/stm32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#ifdef STM32_HASH
3232

33+
#include <stdint.h> /* for uint32_t */
34+
3335
#define WOLFSSL_NO_HASH_RAW
3436

3537
#ifdef HASH_DIGEST

0 commit comments

Comments
 (0)