Skip to content

Commit f0041cd

Browse files
committed
SP int: fix 8 bit words and sp_clamp_ct
Need to cast to sp_size_t as it may be bigger than the word type sp_int_digit.
1 parent a40b56c commit f0041cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/sp_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8025,8 +8025,8 @@ static void sp_clamp_ct(sp_int* a)
80258025
(sp_int_digit)((sp_int_sdigit)(negVal & minusOne) >>
80268026
(SP_WORD_SIZE - 1));
80278027
#else
8028-
sp_int_digit zeroMask =
8029-
(sp_int_digit)((((sp_int_sword)a->dp[i]) - 1) >> SP_WORD_SIZE);
8028+
sp_size_t zeroMask =
8029+
(sp_size_t)((((sp_int_sword)a->dp[i]) - 1) >> SP_WORD_SIZE);
80308030
#endif
80318031
mask &= (sp_size_t)zeroMask;
80328032
used = (sp_size_t)(used + mask);

0 commit comments

Comments
 (0)