Fix W560 "possible truncation at implicit conversion to type unsigned char" warnings raised by Tasking compiler.

This commit is contained in:
Kareem
2026-04-22 15:47:39 -07:00
parent b5738236d9
commit 9fef016106
3 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -8577,7 +8577,7 @@ static WC_INLINE int DecodeTls13SigAlg(byte* input, byte* hashAlgo,
break;
#endif
case NEW_SA_MAJOR:
*hashAlgo = GetNewSAHashAlgo(input[1]);
*hashAlgo = (byte)GetNewSAHashAlgo(input[1]);
/* PSS encryption: 0x080[4-6] */
if (input[1] >= RSA_PSS_RSAE_SHA256_MINOR &&
+5 -1
View File
@@ -3286,7 +3286,11 @@ int LwIPNativeSend(WOLFSSL* ssl, char* buf, int sz, void* ctx)
err_t ret;
WOLFSSL_LWIP_NATIVE_STATE* nlwip = (WOLFSSL_LWIP_NATIVE_STATE*)ctx;
ret = tcp_write(nlwip->pcb, buf, sz, TCP_WRITE_FLAG_COPY);
if (sz > UINT16_MAX || sz < 0) {
return BAD_FUNC_ARG;
}
ret = tcp_write(nlwip->pcb, buf, (u16_t)sz, TCP_WRITE_FLAG_COPY);
if (ret != ERR_OK) {
sz = WOLFSSL_FATAL_ERROR;
}
+9 -9
View File
@@ -546,7 +546,7 @@ void fe_load(byte *x, word32 c)
word32 i;
for (i = 0; i < sizeof(c); i++) {
x[i] = c;
x[i] = (byte)c;
c >>= 8;
}
@@ -636,7 +636,7 @@ void lm_sub(byte* r, const byte* a, const byte* b)
c = 218;
for (i = 0; i + 1 < F25519_SIZE; i++) {
c += 65280 + ((word32)a[i]) - ((word32)b[i]);
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
@@ -646,7 +646,7 @@ void lm_sub(byte* r, const byte* a, const byte* b)
for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
@@ -661,7 +661,7 @@ void lm_neg(byte* r, const byte* a)
c = 218;
for (i = 0; i + 1 < F25519_SIZE; i++) {
c += 65280 - ((word32)a[i]);
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
@@ -671,7 +671,7 @@ void lm_neg(byte* r, const byte* a)
for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
@@ -693,7 +693,7 @@ void fe_mul__distinct(byte *r, const byte *a, const byte *b)
c += ((word32)a[j]) *
((word32)b[i + F25519_SIZE - j]) * 38;
r[i] = c;
r[i] = (byte)c;
}
r[31] &= 127;
@@ -701,7 +701,7 @@ void fe_mul__distinct(byte *r, const byte *a, const byte *b)
for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
@@ -724,7 +724,7 @@ void fe_mul_c(byte *r, const byte *a, word32 b)
for (i = 0; i < F25519_SIZE; i++) {
c >>= 8;
c += b * ((word32)a[i]);
r[i] = c;
r[i] = (byte)c;
}
r[31] &= 127;
@@ -733,7 +733,7 @@ void fe_mul_c(byte *r, const byte *a, word32 b)
for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}