Skip to content

Commit

Permalink
Removes all branching code from SubMod.
Browse files Browse the repository at this point in the history
  • Loading branch information
ple13 committed Dec 26, 2023
1 parent 869e1ab commit 36f39ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/cc/any_sketch/crypto/secret_share_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ absl::StatusOr<uint32_t> SubMod(uint32_t x, uint32_t y, uint32_t modulus) {
"Inputs must be less than the modulus, which is $0.", modulus));
}

uint32_t cmp = (x < y) ? 1 : 0;
uint32_t cmp = (x < y);
return x - y + cmp * modulus;
}

Expand Down

0 comments on commit 36f39ac

Please sign in to comment.