Skip to content

Commit

Permalink
cast to larger type for multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Jul 19, 2024
1 parent 8a9c893 commit f5ed246
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wolfcrypt/src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,10 @@ WC_MISC_STATIC WC_INLINE w64wrapper w64Mul(word32 a, word32 b)
ltlC = b & 0xFFFF;
ltlD = (b >> 16) & 0xFFFF;

bigA = ltlA * ltlC;
bigC = ltlB * ltlC;
bigD = ltlA * ltlD;
bigB = ltlB * ltlD;
bigA = (word32)ltlA * (word32)ltlC;
bigC = (word32)ltlB * (word32)ltlC;
bigD = (word32)ltlA * (word32)ltlD;
bigB = (word32)ltlB * (word32)ltlD;

ret = w64From32(0, bigB);
ret = w64ShiftLeft(ret, 16);
Expand Down

0 comments on commit f5ed246

Please sign in to comment.