Skip to content

Commit c3c8927

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 4f9f498 commit c3c8927

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ 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 > B / 2 || (res == B / 2 && random == 1)
181+
// with B = 2^(base_log * l)
180182
let need_balance = balanced_rounding_condition_bit_trick(res, rep_bit_count, rounding_bit);
181183
// Balance depending on the control bit
182184
res.wrapping_sub(need_balance << rep_bit_count)

0 commit comments

Comments
 (0)