Skip to content

Commit fe573dc

Browse files
committed
chore: fix comment confusing comment in decomposer.rs
- function is documented and the comment did not match, the behavior is checked in a test
1 parent 405b50a commit fe573dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tfhe/src/core_crypto/commons/math/decomposition/decomposer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ where
176176
let mod_mask = Scalar::MAX >> (Scalar::BITS - rep_bit_count);
177177
res &= mod_mask;
178178
// Control bit about whether we should balance the state
179-
// This is equivalent to res > 2^(base_log * l) || (res == 2^(base_log * l) && random == 1)
179+
// This is equivalent to:
180+
// res > 2^(base_log * l) / 2 || (res == 2^(base_log * l) / 2 && random == 1)
180181
let need_balance = balanced_rounding_condition_bit_trick(res, rep_bit_count, rounding_bit);
181182
// Balance depending on the control bit
182183
res.wrapping_sub(need_balance << rep_bit_count)

0 commit comments

Comments
 (0)