Skip to content

Commit

Permalink
fix(core): fix unsigned noise addition for custom modulus
Browse files Browse the repository at this point in the history
  • Loading branch information
IceTDrinker committed Feb 26, 2024
1 parent d770a27 commit 618758b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tfhe/src/core_crypto/commons/math/random/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,10 @@ impl<G: ByteRandomGenerator> RandomGenerator<G> {
custom_modulus_as_scalar,
);
if let Some(elem) = s.get_mut(0) {
*elem = (*elem).wrapping_add(g1);
*elem = (*elem).wrapping_add_custom_mod(g1, custom_modulus_as_scalar);
}
if let Some(elem) = s.get_mut(1) {
*elem = (*elem).wrapping_add(g2);
*elem = (*elem).wrapping_add_custom_mod(g2, custom_modulus_as_scalar);
}
});
}
Expand Down

0 comments on commit 618758b

Please sign in to comment.