From 36f39ace27e51bd6737b1c5a642c4e7f9a912054 Mon Sep 17 00:00:00 2001 From: Phi Hung Le Date: Tue, 26 Dec 2023 22:18:27 +0000 Subject: [PATCH] Removes all branching code from SubMod. --- src/main/cc/any_sketch/crypto/secret_share_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cc/any_sketch/crypto/secret_share_generator.cc b/src/main/cc/any_sketch/crypto/secret_share_generator.cc index 6fefd87..2a39082 100644 --- a/src/main/cc/any_sketch/crypto/secret_share_generator.cc +++ b/src/main/cc/any_sketch/crypto/secret_share_generator.cc @@ -39,7 +39,7 @@ absl::StatusOr 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; }