Skip to content

Commit

Permalink
TFM: explicit cast of -1 to fp_digit
Browse files Browse the repository at this point in the history
When -1 is needed as an fp_digit, as a mask. cast to fp_digit.
  • Loading branch information
SparkiDev committed Nov 14, 2024
1 parent 6af54d3 commit 9d8a3cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wolfcrypt/src/tfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,9 @@ int fp_div_2_mod_ct(fp_int *a, fp_int *b, fp_int *c)
fp_digit mask;
int i;

mask = 0 - (a->dp[0] & 1);
mask = (fp_digit)0 - (a->dp[0] & 1);
for (i = 0; i < b->used; i++) {
fp_digit mask_a = 0 - (i < a->used);
fp_digit mask_a = (fp_digit)0 - (i < a->used);

w += b->dp[i] & mask;
w += a->dp[i] & mask_a;
Expand Down

0 comments on commit 9d8a3cc

Please sign in to comment.