Skip to content

Commit

Permalink
Use already defined max 32bit size
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Aug 7, 2023
1 parent fd20fef commit f018455
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -13217,16 +13217,12 @@ int wolfSSH_oct2dec(WOLFSSH* ssh, byte* oct, word32 octSz)
}


/* not using UINT_MAX here because word32 should always be 32 bits where an
* int type can change depending on platform */
#define WS_WORD32_MAX_SZ 4294967295U

/* addend1 += addend2 */
void AddAssign64(word32* addend1, word32 addend2)
{
if (addend1[0] > (WS_WORD32_MAX_SZ - addend2)) {
if (addend1[0] > (WOLFSSL_MAX_32BIT - addend2)) {
addend1[1]++;
addend1[0] = addend2 - (WS_WORD32_MAX_SZ - addend1[0]);
addend1[0] = addend2 - (WOLFSSL_MAX_32BIT- addend1[0]);
}
else {
addend1[0] += addend2;
Expand Down

0 comments on commit f018455

Please sign in to comment.