fixed sampling & rlwe encryption

This commit is contained in:
Jean-Philippe Bossuat
2025-02-12 08:25:38 +01:00
parent 4a01bb8420
commit 1f52a3d266
6 changed files with 60 additions and 36 deletions

View File

@@ -8,8 +8,8 @@ use sampling::source::Source;
pub struct SecretKey(pub Scalar);
impl SecretKey {
pub fn new(params: &Module) -> Self {
SecretKey(Scalar::new(params.n()))
pub fn new(module: &Module) -> Self {
SecretKey(Scalar::new(module.n()))
}
pub fn fill_ternary_prob(&mut self, prob: f64, source: &mut Source) {
@@ -58,7 +58,7 @@ impl PublicKey {
}
}
pub struct SwitchingKey(GadgetCiphertext);
pub struct SwitchingKey(pub GadgetCiphertext);
impl SwitchingKey {
pub fn new(