Skip to content

Commit

Permalink
Merge pull request #8186 from SparkiDev/tfm_mask_cast
Browse files Browse the repository at this point in the history
TFM: explicit cast of -1 to fp_digit
  • Loading branch information
dgarske authored Nov 15, 2024
2 parents c06b5fa + 9d8a3cc commit fcfd3be
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 fcfd3be

Please sign in to comment.