glwe + ggsw keyswitch

This commit is contained in:
Pro7ech
2025-10-20 11:07:29 +02:00
parent 8dc4946736
commit 0c894c19db
8 changed files with 146 additions and 381 deletions

View File

@@ -11,7 +11,7 @@ use crate::{
};
impl AutomorphismKey<Vec<u8>> {
pub fn keyswitch_inplace_tmp_bytes<R, A, K, M, BE: Backend>(module: &M, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
pub fn keyswitch_tmp_bytes<R, A, K, M, BE: Backend>(module: &M, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
where
R: GGLWEInfos,
A: GGLWEInfos,
@@ -44,7 +44,7 @@ impl<DataSelf: DataMut> AutomorphismKey<DataSelf> {
}
impl GLWESwitchingKey<Vec<u8>> {
pub fn keyswitch_inplace_tmp_bytes<R, A, K, M, BE: Backend>(module: &M, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
pub fn keyswitch_tmp_bytes<R, A, K, M, BE: Backend>(module: &M, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
where
R: GGLWEInfos,
A: GGLWEInfos,
@@ -77,7 +77,7 @@ impl<DataSelf: DataMut> GLWESwitchingKey<DataSelf> {
}
impl GGLWE<Vec<u8>> {
pub fn keyswitch_inplace_tmp_bytes<R, A, K, M, BE: Backend>(module: &M, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
pub fn keyswitch_tmp_bytes<R, A, K, M, BE: Backend>(module: &M, res_infos: &R, a_infos: &A, key_infos: &K) -> usize
where
R: GGLWEInfos,
A: GGLWEInfos,

View File

@@ -1,4 +1,4 @@
use poulpy_hal::layouts::{Backend, DataMut, Scratch, VecZnx};
use poulpy_hal::layouts::{Backend, DataMut, Module, Scratch, VecZnx};
use crate::{
GGSWExpandRows, ScratchTakeCore,
@@ -51,6 +51,8 @@ impl<D: DataMut> GGSW<D> {
}
}
impl<BE: Backend> GGSWKeyswitch<BE> for Module<BE> where Self: GLWEKeyswitch<BE> + GGSWExpandRows<BE> {}
pub trait GGSWKeyswitch<BE: Backend>
where
Self: GLWEKeyswitch<BE> + GGSWExpandRows<BE>,

View File

@@ -4,6 +4,6 @@ mod glwe_ct;
mod lwe_ct;
pub use gglwe_ct::*;
// pub use gglwe_ct::*;
pub use ggsw_ct::*;
pub use glwe_ct::*;
pub use lwe_ct::*;