mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 05:06:44 +01:00
fix keyswitching
This commit is contained in:
@@ -3,3 +3,5 @@ mod glwe_to_lwe;
|
|||||||
mod lwe_to_glwe;
|
mod lwe_to_glwe;
|
||||||
|
|
||||||
pub use gglwe_to_ggsw::*;
|
pub use gglwe_to_ggsw::*;
|
||||||
|
pub use glwe_to_lwe::*;
|
||||||
|
pub use lwe_to_glwe::*;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use poulpy_hal::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ScratchTakeCore,
|
LWESampleExtract, ScratchTakeCore,
|
||||||
keyswitching::glwe_ct::GLWEKeyswitch,
|
keyswitching::glwe_ct::GLWEKeyswitch,
|
||||||
layouts::{
|
layouts::{
|
||||||
GGLWEInfos, GLWE, GLWEAlloc, GLWELayout, LWE, LWEInfos, LWEToMut, LWEToRef, Rank, TorusPrecision,
|
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>
|
pub trait LWEKeySwitch<BE: Backend>
|
||||||
where
|
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
|
fn lwe_keyswitch_tmp_bytes<R, A, K>(&self, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
|
||||||
where
|
where
|
||||||
@@ -121,6 +121,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.glwe_keyswitch(&mut glwe_out, &glwe_in, &ksk.0, scratch_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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user