We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f9f498 commit c3c8927Copy full SHA for c3c8927
tfhe/src/core_crypto/commons/math/decomposition/decomposer.rs
@@ -176,7 +176,9 @@ where
176
let mod_mask = Scalar::MAX >> (Scalar::BITS - rep_bit_count);
177
res &= mod_mask;
178
// 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)
+ // This is equivalent to:
180
+ // res > B / 2 || (res == B / 2 && random == 1)
181
+ // with B = 2^(base_log * l)
182
let need_balance = balanced_rounding_condition_bit_trick(res, rep_bit_count, rounding_bit);
183
// Balance depending on the control bit
184
res.wrapping_sub(need_balance << rep_bit_count)
0 commit comments