glwe packing

This commit is contained in:
Pro7ech
2025-10-16 22:17:22 +02:00
parent 31b92f7f23
commit 93e0671eda
2 changed files with 139 additions and 118 deletions

View File

@@ -277,6 +277,10 @@ pub trait GLWEShift<BE: Backend>
where
Self: ModuleN + VecZnxRshInplace<BE>,
{
fn glwe_rsh_tmp_byte(&self) -> usize {
VecZnx::rsh_tmp_bytes(self.n())
}
fn glwe_rsh<R>(&self, k: usize, res: &mut R, scratch: &mut Scratch<BE>)
where
R: GLWEToMut,
@@ -291,8 +295,11 @@ where
}
impl GLWE<Vec<u8>> {
pub fn rsh_tmp_bytes(n: usize) -> usize {
VecZnx::rsh_tmp_bytes(n)
pub fn rsh_tmp_bytes<M, BE: Backend>(module: &M) -> usize
where
M: GLWEShift<BE>,
{
module.glwe_rsh_tmp_byte()
}
}