arnaucube
arnaucube/poulpyPublic Self-hosted repository
fix keyswitching
Pro7ech jeanphilippe.bossuat@gmail.com
Thu, 16 Oct 2025 22:41:40 +0200
commit

90a25638c248750ece4eb1182fc4f359a085cfd5

parent

920b9252162ee5704592b75b252d1dfd8424457f

2 files changed, 5 insertions(+), 3 deletions(-)

jump to
M poulpy-core/src/conversion/mod.rs → poulpy-core/src/conversion/mod.rs

@@ -3,3 +3,5 @@ mod glwe_to_lwe;

mod lwe_to_glwe; pub use gglwe_to_ggsw::*; +pub use glwe_to_lwe::*; +pub use lwe_to_glwe::*;
M poulpy-core/src/keyswitching/lwe_ct.rs → poulpy-core/src/keyswitching/lwe_ct.rs

@@ -4,7 +4,7 @@ layouts::{Backend, DataMut, Module, Scratch, ZnxView, ZnxViewMut, ZnxZero},

}; use crate::{ - ScratchTakeCore, + LWESampleExtract, ScratchTakeCore, keyswitching::glwe_ct::GLWEKeyswitch, layouts::{ GGLWEInfos, GLWE, GLWEAlloc, GLWELayout, LWE, LWEInfos, LWEToMut, LWEToRef, Rank, TorusPrecision,

@@ -40,7 +40,7 @@ impl<BE: Backend> LWEKeySwitch<BE> for Module<BE> where Self: LWEKeySwitch<BE> {}

pub trait LWEKeySwitch<BE: Backend> where - Self: GLWEKeyswitch<BE> + GLWEAlloc, + Self: GLWEKeyswitch<BE> + GLWEAlloc + LWESampleExtract, { fn lwe_keyswitch_tmp_bytes<R, A, K>(&self, res_infos: &R, a_infos: &A, key_infos: &K) -> usize where

@@ -121,6 +121,6 @@ glwe_in.data.at_mut(1, i)[..n_lwe].copy_from_slice(&data_lwe[1..]);

} self.glwe_keyswitch(&mut glwe_out, &glwe_in, &ksk.0, scratch_1); - res.sample_extract(&glwe_out); + self.lwe_sample_extract(res, &glwe_out); } }