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 405b50a commit fe573dcCopy full SHA for fe573dc
tfhe/src/core_crypto/commons/math/decomposition/decomposer.rs
@@ -176,7 +176,8 @@ 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 > 2^(base_log * l) / 2 || (res == 2^(base_log * l) / 2 && random == 1)
181
let need_balance = balanced_rounding_condition_bit_trick(res, rep_bit_count, rounding_bit);
182
// Balance depending on the control bit
183
res.wrapping_sub(need_balance << rep_bit_count)
0 commit comments