diff --git a/poulpy-core/src/encryption/compressed/glwe_automorphism_key.rs b/poulpy-core/src/encryption/compressed/glwe_automorphism_key.rs index 713dd31..9c9046d 100644 --- a/poulpy-core/src/encryption/compressed/glwe_automorphism_key.rs +++ b/poulpy-core/src/encryption/compressed/glwe_automorphism_key.rs @@ -8,7 +8,7 @@ use crate::{ GGLWECompressedEncryptSk, ScratchTakeCore, layouts::{ GGLWECompressedSeedMut, GGLWECompressedToMut, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretPrepared, - GLWESecretPreparedApi, GLWESecretToRef, LWEInfos, SetGaloisElement, compressed::GLWEAutomorphismKeyCompressed, + GLWESecretPreparedFactory, GLWESecretToRef, LWEInfos, SetGaloisElement, compressed::GLWEAutomorphismKeyCompressed, }, }; @@ -60,7 +60,7 @@ pub trait AutomorphismKeyCompressedEncryptSk { impl AutomorphismKeyCompressedEncryptSk for Module where - Self: ModuleN + GaloisElement + VecZnxAutomorphism + GGLWECompressedEncryptSk + GLWESecretPreparedApi, + Self: ModuleN + GaloisElement + VecZnxAutomorphism + GGLWECompressedEncryptSk + GLWESecretPreparedFactory, Scratch: ScratchTakeCore, { fn automorphism_key_compressed_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize diff --git a/poulpy-core/src/encryption/compressed/glwe_switching_key.rs b/poulpy-core/src/encryption/compressed/glwe_switching_key.rs index cdc65b1..c492cfd 100644 --- a/poulpy-core/src/encryption/compressed/glwe_switching_key.rs +++ b/poulpy-core/src/encryption/compressed/glwe_switching_key.rs @@ -10,7 +10,7 @@ use crate::{ GGLWECompressedSeedMut, GGLWECompressedToMut, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretToRef, GLWESwitchingKeyDegreesMut, LWEInfos, compressed::GLWESwitchingKeyCompressed, - prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, + prepared::{GLWESecretPrepared, GLWESecretPreparedFactory}, }, }; @@ -64,7 +64,7 @@ pub trait GLWESwitchingKeyCompressedEncryptSk { impl GLWESwitchingKeyCompressedEncryptSk for Module where - Self: ModuleN + GGLWECompressedEncryptSk + GLWESecretPreparedApi + VecZnxSwitchRing, + Self: ModuleN + GGLWECompressedEncryptSk + GLWESecretPreparedFactory + VecZnxSwitchRing, Scratch: ScratchTakeCore, { fn glwe_switching_key_compressed_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize diff --git a/poulpy-core/src/encryption/compressed/glwe_tensor_key.rs b/poulpy-core/src/encryption/compressed/glwe_tensor_key.rs index 76050b5..9456e89 100644 --- a/poulpy-core/src/encryption/compressed/glwe_tensor_key.rs +++ b/poulpy-core/src/encryption/compressed/glwe_tensor_key.rs @@ -10,7 +10,7 @@ use poulpy_hal::{ use crate::{ GGLWECompressedEncryptSk, GetDistribution, ScratchTakeCore, TensorKeyEncryptSk, layouts::{ - GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedApi, GLWESecretToRef, LWEInfos, Rank, + GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedFactory, GLWESecretToRef, LWEInfos, Rank, TensorKeyCompressedAtMut, compressed::GLWETensorKeyCompressed, }, }; @@ -72,7 +72,7 @@ where + SvpPPolBytesOf + VecZnxDftBytesOf + VecZnxBigBytesOf - + GLWESecretPreparedApi, + + GLWESecretPreparedFactory, Scratch: ScratchTakeBasic + ScratchTakeCore, { fn tensor_key_compressed_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize diff --git a/poulpy-core/src/encryption/glwe_automorphism_key.rs b/poulpy-core/src/encryption/glwe_automorphism_key.rs index bcd01c7..68782e3 100644 --- a/poulpy-core/src/encryption/glwe_automorphism_key.rs +++ b/poulpy-core/src/encryption/glwe_automorphism_key.rs @@ -7,7 +7,7 @@ use poulpy_hal::{ use crate::{ GGLWEEncryptSk, ScratchTakeCore, layouts::{ - AutomorphismKey, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedApi, + AutomorphismKey, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedFactory, GLWESecretToRef, LWEInfos, SetGaloisElement, }, }; @@ -70,7 +70,7 @@ pub trait AutomorphismKeyEncryptSk { impl AutomorphismKeyEncryptSk for Module where - Self: GGLWEEncryptSk + VecZnxAutomorphism + GaloisElement + SvpPPolBytesOf + GLWESecretPreparedApi, + Self: GGLWEEncryptSk + VecZnxAutomorphism + GaloisElement + SvpPPolBytesOf + GLWESecretPreparedFactory, Scratch: ScratchTakeCore, { fn automorphism_key_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize diff --git a/poulpy-core/src/encryption/glwe_switching_key.rs b/poulpy-core/src/encryption/glwe_switching_key.rs index cf6cf8e..fc19a71 100644 --- a/poulpy-core/src/encryption/glwe_switching_key.rs +++ b/poulpy-core/src/encryption/glwe_switching_key.rs @@ -9,7 +9,7 @@ use crate::{ encryption::gglwe::GGLWEEncryptSk, layouts::{ GGLWEInfos, GGLWEToMut, GLWEInfos, GLWESecret, GLWESecretToRef, GLWESwitchingKey, GLWESwitchingKeyDegreesMut, LWEInfos, - prepared::GLWESecretPreparedApi, + prepared::GLWESecretPreparedFactory, }, }; @@ -71,7 +71,7 @@ pub trait GLWESwitchingKeyEncryptSk { impl GLWESwitchingKeyEncryptSk for Module where - Self: ModuleN + GGLWEEncryptSk + GLWESecretPreparedApi + VecZnxSwitchRing + SvpPrepare, + Self: ModuleN + GGLWEEncryptSk + GLWESecretPreparedFactory + VecZnxSwitchRing + SvpPrepare, Scratch: ScratchTakeCore, { fn glwe_switching_key_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize diff --git a/poulpy-core/src/encryption/glwe_tensor_key.rs b/poulpy-core/src/encryption/glwe_tensor_key.rs index 21bf474..758afcc 100644 --- a/poulpy-core/src/encryption/glwe_tensor_key.rs +++ b/poulpy-core/src/encryption/glwe_tensor_key.rs @@ -11,7 +11,7 @@ use crate::{ GGLWEEncryptSk, GetDistribution, ScratchTakeCore, layouts::{ GGLWE, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretToRef, LWEInfos, Rank, TensorKey, TensorKeyToMut, - prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, + prepared::{GLWESecretPrepared, GLWESecretPreparedFactory}, }, }; @@ -65,7 +65,7 @@ where + GGLWEEncryptSk + VecZnxDftBytesOf + VecZnxBigBytesOf - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxDftApply + SvpApplyDftToDft + VecZnxIdftApplyTmpA diff --git a/poulpy-core/src/encryption/glwe_to_lwe_switching_key.rs b/poulpy-core/src/encryption/glwe_to_lwe_switching_key.rs index d77eb60..36ecff2 100644 --- a/poulpy-core/src/encryption/glwe_to_lwe_switching_key.rs +++ b/poulpy-core/src/encryption/glwe_to_lwe_switching_key.rs @@ -9,7 +9,7 @@ use crate::{ layouts::{ GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretToRef, GLWEToLWESwitchingKey, LWEInfos, LWESecret, LWESecretToRef, Rank, - prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, + prepared::{GLWESecretPrepared, GLWESecretPreparedFactory}, }, }; @@ -65,7 +65,7 @@ impl GLWEToLWESwitchingKeyEncryptSk for Module where Self: ModuleN + GGLWEEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxAutomorphismInplace + VecZnxAutomorphismInplaceTmpBytes, Scratch: ScratchTakeCore, diff --git a/poulpy-core/src/encryption/lwe_switching_key.rs b/poulpy-core/src/encryption/lwe_switching_key.rs index e06c910..daee764 100644 --- a/poulpy-core/src/encryption/lwe_switching_key.rs +++ b/poulpy-core/src/encryption/lwe_switching_key.rs @@ -10,7 +10,7 @@ use crate::{ layouts::{ GGLWEInfos, GGLWEToMut, GLWESecret, GLWESwitchingKey, GLWESwitchingKeyDegreesMut, LWEInfos, LWESecret, LWESecretToRef, LWESwitchingKey, Rank, - prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, + prepared::{GLWESecretPrepared, GLWESecretPreparedFactory}, }, }; @@ -63,7 +63,7 @@ pub trait LWESwitchingKeyEncrypt { impl LWESwitchingKeyEncrypt for Module where - Self: ModuleN + GLWESwitchingKeyEncryptSk + GLWESecretPreparedApi + VecZnxAutomorphismInplace, + Self: ModuleN + GLWESwitchingKeyEncryptSk + GLWESecretPreparedFactory + VecZnxAutomorphismInplace, Scratch: ScratchTakeCore, { fn lwe_switching_key_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize diff --git a/poulpy-core/src/encryption/lwe_to_glwe_switching_key.rs b/poulpy-core/src/encryption/lwe_to_glwe_switching_key.rs index 24153b6..588875d 100644 --- a/poulpy-core/src/encryption/lwe_to_glwe_switching_key.rs +++ b/poulpy-core/src/encryption/lwe_to_glwe_switching_key.rs @@ -7,7 +7,7 @@ use poulpy_hal::{ use crate::{ GGLWEEncryptSk, ScratchTakeCore, layouts::{ - GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretPreparedApi, GLWESecretPreparedToRef, LWEInfos, LWESecret, + GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretPreparedFactory, GLWESecretPreparedToRef, LWEInfos, LWESecret, LWESecretToRef, LWEToGLWESwitchingKey, Rank, }, }; @@ -65,7 +65,7 @@ where Self: ModuleN + GGLWEEncryptSk + VecZnxAutomorphismInplace - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxAutomorphismInplaceTmpBytes, Scratch: ScratchTakeCore, { diff --git a/poulpy-core/src/layouts/prepared/gglwe.rs b/poulpy-core/src/layouts/prepared/gglwe.rs index 27e80ee..792adbf 100644 --- a/poulpy-core/src/layouts/prepared/gglwe.rs +++ b/poulpy-core/src/layouts/prepared/gglwe.rs @@ -57,7 +57,7 @@ impl GGLWEInfos for GGLWEPrepared { } } -pub trait GGLWEPreparedAlloc +pub trait GGLWEPreparedFactory where Self: GetDegree + VmpPMatAlloc + VmpPMatBytesOf + VmpPrepare + VmpPrepareTmpBytes, { @@ -178,7 +178,7 @@ where } } -impl GGLWEPreparedAlloc for Module where +impl GGLWEPreparedFactory for Module where Module: GetDegree + VmpPMatAlloc + VmpPMatBytesOf + VmpPrepare + VmpPrepareTmpBytes { } @@ -187,7 +187,7 @@ impl GGLWEPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: GGLWEPreparedAlloc, + M: GGLWEPreparedFactory, { module.alloc_gglwe_prepared_from_infos(infos) } @@ -202,7 +202,7 @@ impl GGLWEPrepared, B> { dsize: Dsize, ) -> Self where - M: GGLWEPreparedAlloc, + M: GGLWEPreparedFactory, { module.alloc_gglwe_prepared(base2k, k, rank_in, rank_out, dnum, dsize) } @@ -210,7 +210,7 @@ impl GGLWEPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: GGLWEPreparedAlloc, + M: GGLWEPreparedFactory, { module.bytes_of_gglwe_prepared_from_infos(infos) } @@ -225,7 +225,7 @@ impl GGLWEPrepared, B> { dsize: Dsize, ) -> usize where - M: GGLWEPreparedAlloc, + M: GGLWEPreparedFactory, { module.bytes_of_gglwe_prepared(base2k, k, rank_in, rank_out, dnum, dsize) } @@ -235,7 +235,7 @@ impl GGLWEPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGLWEToRef, - M: GGLWEPreparedAlloc, + M: GGLWEPreparedFactory, { module.prepare_gglwe(self, other, scratch); } @@ -244,7 +244,7 @@ impl GGLWEPrepared { impl GGLWEPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M) -> usize where - M: GGLWEPreparedAlloc, + M: GGLWEPreparedFactory, { module.prepare_gglwe_tmp_bytes(self) } diff --git a/poulpy-core/src/layouts/prepared/ggsw.rs b/poulpy-core/src/layouts/prepared/ggsw.rs index c2c62a2..3115980 100644 --- a/poulpy-core/src/layouts/prepared/ggsw.rs +++ b/poulpy-core/src/layouts/prepared/ggsw.rs @@ -49,7 +49,7 @@ impl GGSWInfos for GGSWPrepared { } } -pub trait GGSWPreparedAlloc +pub trait GGSWPreparedFactory where Self: GetDegree + VmpPMatAlloc + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare, { @@ -162,7 +162,7 @@ where } } -impl GGSWPreparedAlloc for Module where +impl GGSWPreparedFactory for Module where Self: GetDegree + VmpPMatAlloc + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare { } @@ -171,14 +171,14 @@ impl GGSWPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGSWInfos, - M: GGSWPreparedAlloc, + M: GGSWPreparedFactory, { module.alloc_ggsw_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self where - M: GGSWPreparedAlloc, + M: GGSWPreparedFactory, { module.alloc_ggsw_prepared(base2k, k, dnum, dsize, rank) } @@ -186,14 +186,14 @@ impl GGSWPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGSWInfos, - M: GGSWPreparedAlloc, + M: GGSWPreparedFactory, { module.bytes_of_ggsw_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> usize where - M: GGSWPreparedAlloc, + M: GGSWPreparedFactory, { module.bytes_of_ggsw_prepared(base2k, k, dnum, dsize, rank) } @@ -209,7 +209,7 @@ impl GGSWPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M, infos: &A) -> usize where A: GGSWInfos, - M: GGSWPreparedAlloc, + M: GGSWPreparedFactory, { module.ggsw_prepare_tmp_bytes(infos) } @@ -219,7 +219,7 @@ impl GGSWPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGSWToRef, - M: GGSWPreparedAlloc, + M: GGSWPreparedFactory, { module.ggsw_prepare(self, other, scratch); } diff --git a/poulpy-core/src/layouts/prepared/glwe.rs b/poulpy-core/src/layouts/prepared/glwe.rs index b09ca72..cf7e564 100644 --- a/poulpy-core/src/layouts/prepared/glwe.rs +++ b/poulpy-core/src/layouts/prepared/glwe.rs @@ -36,7 +36,7 @@ impl GLWEInfos for GLWEPrepared { } } -pub trait GLWEPreparedAlloc +pub trait GLWEPreparedFactory where Self: GetDegree + VecZnxDftAlloc + VecZnxDftBytesOf + VecZnxDftApply, { @@ -88,20 +88,20 @@ where } } -impl GLWEPreparedAlloc for Module where Self: VecZnxDftAlloc + VecZnxDftBytesOf + VecZnxDftApply {} +impl GLWEPreparedFactory for Module where Self: VecZnxDftAlloc + VecZnxDftBytesOf + VecZnxDftApply {} impl GLWEPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GLWEInfos, - M: GLWEPreparedAlloc, + M: GLWEPreparedFactory, { module.alloc_glwe_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self where - M: GLWEPreparedAlloc, + M: GLWEPreparedFactory, { module.alloc_glwe_prepared(base2k, k, rank) } @@ -109,14 +109,14 @@ impl GLWEPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GLWEInfos, - M: GLWEPreparedAlloc, + M: GLWEPreparedFactory, { module.bytes_of_glwe_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize where - M: GLWEPreparedAlloc, + M: GLWEPreparedFactory, { module.bytes_of_glwe_prepared(base2k, k, rank) } @@ -126,7 +126,7 @@ impl GLWEPrepared { pub fn prepare(&mut self, module: &M, other: &O) where O: GLWEToRef, - M: GLWEPreparedAlloc, + M: GLWEPreparedFactory, { module.prepare_glwe(self, other); } diff --git a/poulpy-core/src/layouts/prepared/glwe_automorphism_key.rs b/poulpy-core/src/layouts/prepared/glwe_automorphism_key.rs index 5790491..0296e0f 100644 --- a/poulpy-core/src/layouts/prepared/glwe_automorphism_key.rs +++ b/poulpy-core/src/layouts/prepared/glwe_automorphism_key.rs @@ -1,7 +1,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use crate::layouts::{ - Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedAlloc, GGLWEPreparedToMut, GGLWEPreparedToRef, + Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedFactory, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, GetGaloisElement, LWEInfos, Rank, SetGaloisElement, TorusPrecision, }; @@ -65,9 +65,9 @@ impl GGLWEInfos for GLWEAutomorphismKeyPrepared { } } -pub trait GLWEAutomorphismKeyPreparedApi +pub trait GLWEAutomorphismKeyPreparedFactory where - Self: GGLWEPreparedAlloc, + Self: GGLWEPreparedFactory, { fn alloc_automorphism_key_prepared( &self, @@ -147,20 +147,20 @@ where } } -impl GLWEAutomorphismKeyPreparedApi for Module where Module: GGLWEPreparedAlloc {} +impl GLWEAutomorphismKeyPreparedFactory for Module where Module: GGLWEPreparedFactory {} impl GLWEAutomorphismKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: GLWEAutomorphismKeyPreparedApi, + M: GLWEAutomorphismKeyPreparedFactory, { module.alloc_automorphism_key_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> Self where - M: GLWEAutomorphismKeyPreparedApi, + M: GLWEAutomorphismKeyPreparedFactory, { module.alloc_automorphism_key_prepared(base2k, k, rank, dnum, dsize) } @@ -168,14 +168,14 @@ impl GLWEAutomorphismKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: GLWEAutomorphismKeyPreparedApi, + M: GLWEAutomorphismKeyPreparedFactory, { module.bytes_of_automorphism_key_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> usize where - M: GLWEAutomorphismKeyPreparedApi, + M: GLWEAutomorphismKeyPreparedFactory, { module.bytes_of_automorphism_key_prepared(base2k, k, rank, dnum, dsize) } @@ -184,7 +184,7 @@ impl GLWEAutomorphismKeyPrepared, B> { impl GLWEAutomorphismKeyPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M) -> usize where - M: GLWEAutomorphismKeyPreparedApi, + M: GLWEAutomorphismKeyPreparedFactory, { module.prepare_automorphism_key_tmp_bytes(self) } @@ -194,7 +194,7 @@ impl GLWEAutomorphismKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGLWEToRef + GetGaloisElement, - M: GLWEAutomorphismKeyPreparedApi, + M: GLWEAutomorphismKeyPreparedFactory, { module.prepare_automorphism_key(self, other, scratch); } diff --git a/poulpy-core/src/layouts/prepared/glwe_public_key.rs b/poulpy-core/src/layouts/prepared/glwe_public_key.rs index 8938c93..b20682d 100644 --- a/poulpy-core/src/layouts/prepared/glwe_public_key.rs +++ b/poulpy-core/src/layouts/prepared/glwe_public_key.rs @@ -7,7 +7,7 @@ use crate::{ GetDistribution, GetDistributionMut, dist::Distribution, layouts::{ - Base2K, Degree, GLWEInfos, GLWEPrepared, GLWEPreparedAlloc, GLWEPreparedToMut, GLWEPreparedToRef, GLWEToRef, GetDegree, + Base2K, Degree, GLWEInfos, GLWEPrepared, GLWEPreparedFactory, GLWEPreparedToMut, GLWEPreparedToRef, GLWEToRef, GetDegree, LWEInfos, Rank, TorusPrecision, }, }; @@ -54,9 +54,9 @@ impl GLWEInfos for GLWEPublicKeyPrepared { } } -pub trait GLWEPublicKeyPreparedAlloc +pub trait GLWEPublicKeyPreparedFactory where - Self: GetDegree + GLWEPreparedAlloc, + Self: GetDegree + GLWEPreparedFactory, { fn alloc_glwe_public_key_prepared(&self, base2k: Base2K, k: TorusPrecision, rank: Rank) -> GLWEPublicKeyPrepared, B> { GLWEPublicKeyPrepared { @@ -93,20 +93,20 @@ where } } -impl GLWEPublicKeyPreparedAlloc for Module where Self: VecZnxDftAlloc + VecZnxDftBytesOf + VecZnxDftApply {} +impl GLWEPublicKeyPreparedFactory for Module where Self: VecZnxDftAlloc + VecZnxDftBytesOf + VecZnxDftApply {} impl GLWEPublicKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GLWEInfos, - M: GLWEPublicKeyPreparedAlloc, + M: GLWEPublicKeyPreparedFactory, { module.alloc_glwe_public_key_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self where - M: GLWEPublicKeyPreparedAlloc, + M: GLWEPublicKeyPreparedFactory, { module.alloc_glwe_public_key_prepared(base2k, k, rank) } @@ -114,14 +114,14 @@ impl GLWEPublicKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GLWEInfos, - M: GLWEPublicKeyPreparedAlloc, + M: GLWEPublicKeyPreparedFactory, { module.bytes_of_glwe_public_key_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize where - M: GLWEPublicKeyPreparedAlloc, + M: GLWEPublicKeyPreparedFactory, { module.bytes_of_glwe_public_key_prepared(base2k, k, rank) } @@ -131,7 +131,7 @@ impl GLWEPublicKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O) where O: GLWEToRef + GetDistribution, - M: GLWEPublicKeyPreparedAlloc, + M: GLWEPublicKeyPreparedFactory, { module.prepare_glwe_public_key(self, other); } diff --git a/poulpy-core/src/layouts/prepared/glwe_secret.rs b/poulpy-core/src/layouts/prepared/glwe_secret.rs index 98e8078..412733c 100644 --- a/poulpy-core/src/layouts/prepared/glwe_secret.rs +++ b/poulpy-core/src/layouts/prepared/glwe_secret.rs @@ -49,7 +49,7 @@ impl GLWEInfos for GLWESecretPrepared { } } -pub trait GLWESecretPreparedApi +pub trait GLWESecretPreparedFactory where Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc + SvpPrepare, { @@ -96,20 +96,20 @@ where } } -impl GLWESecretPreparedApi for Module where Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc + SvpPrepare {} +impl GLWESecretPreparedFactory for Module where Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc + SvpPrepare {} impl GLWESecretPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GLWEInfos, - M: GLWESecretPreparedApi, + M: GLWESecretPreparedFactory, { module.alloc_glwe_secret_prepared_from_infos(infos) } pub fn alloc(module: &M, rank: Rank) -> Self where - M: GLWESecretPreparedApi, + M: GLWESecretPreparedFactory, { module.alloc_glwe_secret_prepared(rank) } @@ -117,14 +117,14 @@ impl GLWESecretPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GLWEInfos, - M: GLWESecretPreparedApi, + M: GLWESecretPreparedFactory, { module.bytes_of_glwe_secret_prepared_from_infos(infos) } pub fn bytes_of(module: &M, rank: Rank) -> usize where - M: GLWESecretPreparedApi, + M: GLWESecretPreparedFactory, { module.bytes_of_glwe_secret_prepared(rank) } @@ -143,7 +143,7 @@ impl GLWESecretPrepared { impl GLWESecretPrepared { pub fn prepare(&mut self, module: &M, other: &O) where - M: GLWESecretPreparedApi, + M: GLWESecretPreparedFactory, O: GLWESecretToRef + GetDistribution, { module.prepare_glwe_secret(self, other); diff --git a/poulpy-core/src/layouts/prepared/glwe_switching_key.rs b/poulpy-core/src/layouts/prepared/glwe_switching_key.rs index ce9cdfa..d73d17d 100644 --- a/poulpy-core/src/layouts/prepared/glwe_switching_key.rs +++ b/poulpy-core/src/layouts/prepared/glwe_switching_key.rs @@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use crate::layouts::{ Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEToRef, GLWEInfos, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, - prepared::{GGLWEPrepared, GGLWEPreparedAlloc, GGLWEPreparedToMut, GGLWEPreparedToRef}, + prepared::{GGLWEPrepared, GGLWEPreparedFactory, GGLWEPreparedToMut, GGLWEPreparedToRef}, }; #[derive(PartialEq, Eq)] @@ -75,9 +75,9 @@ impl GGLWEInfos for GLWESwitchingKeyPrepared { } } -pub trait GLWESwitchingKeyPreparedAlloc +pub trait GLWESwitchingKeyPreparedFactory where - Self: GGLWEPreparedAlloc, + Self: GGLWEPreparedFactory, { fn alloc_glwe_switching_key_prepared( &self, @@ -153,13 +153,13 @@ where } } -impl GLWESwitchingKeyPreparedAlloc for Module where Self: GGLWEPreparedAlloc {} +impl GLWESwitchingKeyPreparedFactory for Module where Self: GGLWEPreparedFactory {} impl GLWESwitchingKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: GLWESwitchingKeyPreparedAlloc, + M: GLWESwitchingKeyPreparedFactory, { module.alloc_glwe_switching_key_prepared_from_infos(infos) } @@ -174,7 +174,7 @@ impl GLWESwitchingKeyPrepared, B> { dsize: Dsize, ) -> Self where - M: GLWESwitchingKeyPreparedAlloc, + M: GLWESwitchingKeyPreparedFactory, { module.alloc_glwe_switching_key_prepared(base2k, k, rank_in, rank_out, dnum, dsize) } @@ -182,7 +182,7 @@ impl GLWESwitchingKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: GLWESwitchingKeyPreparedAlloc, + M: GLWESwitchingKeyPreparedFactory, { module.bytes_of_glwe_switching_key_prepared_from_infos(infos) } @@ -197,7 +197,7 @@ impl GLWESwitchingKeyPrepared, B> { dsize: Dsize, ) -> usize where - M: GLWESwitchingKeyPreparedAlloc, + M: GLWESwitchingKeyPreparedFactory, { module.bytes_of_glwe_switching_key_prepared(base2k, k, rank_in, rank_out, dnum, dsize) } @@ -207,7 +207,7 @@ impl GLWESwitchingKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGLWEToRef + GLWESwitchingKeyDegrees, - M: GLWESwitchingKeyPreparedAlloc, + M: GLWESwitchingKeyPreparedFactory, { module.prepare_glwe_switching(self, other, scratch); } @@ -216,7 +216,7 @@ impl GLWESwitchingKeyPrepared { impl GLWESwitchingKeyPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M) -> usize where - M: GLWESwitchingKeyPreparedAlloc, + M: GLWESwitchingKeyPreparedFactory, { module.prepare_glwe_switching_key_tmp_bytes(self) } diff --git a/poulpy-core/src/layouts/prepared/glwe_tensor_key.rs b/poulpy-core/src/layouts/prepared/glwe_tensor_key.rs index d1287e8..7ac936e 100644 --- a/poulpy-core/src/layouts/prepared/glwe_tensor_key.rs +++ b/poulpy-core/src/layouts/prepared/glwe_tensor_key.rs @@ -1,7 +1,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use crate::layouts::{ - Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedAlloc, GGLWEPreparedToMut, GGLWEPreparedToRef, + Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedFactory, GGLWEPreparedToMut, GGLWEPreparedToRef, GLWEInfos, LWEInfos, Rank, TensorKey, TensorKeyToRef, TorusPrecision, }; @@ -52,9 +52,9 @@ impl GGLWEInfos for TensorKeyPrepared { } } -pub trait TensorKeyPreparedAlloc +pub trait TensorKeyPreparedFactory where - Self: GGLWEPreparedAlloc, + Self: GGLWEPreparedFactory, { fn alloc_tensor_key_prepared( &self, @@ -131,20 +131,20 @@ where } } -impl TensorKeyPreparedAlloc for Module where Module: GGLWEPreparedAlloc {} +impl TensorKeyPreparedFactory for Module where Module: GGLWEPreparedFactory {} impl TensorKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: TensorKeyPreparedAlloc, + M: TensorKeyPreparedFactory, { module.alloc_tensor_key_prepared_from_infos(infos) } pub fn alloc_with(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self where - M: TensorKeyPreparedAlloc, + M: TensorKeyPreparedFactory, { module.alloc_tensor_key_prepared(base2k, k, dnum, dsize, rank) } @@ -152,14 +152,14 @@ impl TensorKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: TensorKeyPreparedAlloc, + M: TensorKeyPreparedFactory, { module.bytes_of_tensor_key_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> usize where - M: TensorKeyPreparedAlloc, + M: TensorKeyPreparedFactory, { module.bytes_of_tensor_key_prepared(base2k, k, rank, dnum, dsize) } @@ -191,7 +191,7 @@ impl TensorKeyPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: TensorKeyPreparedAlloc, + M: TensorKeyPreparedFactory, { module.prepare_tensor_key_tmp_bytes(infos) } @@ -201,7 +201,7 @@ impl TensorKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: TensorKeyToRef, - M: TensorKeyPreparedAlloc, + M: TensorKeyPreparedFactory, { module.prepare_tensor_key(self, other, scratch); } diff --git a/poulpy-core/src/layouts/prepared/glwe_to_lwe_switching_key.rs b/poulpy-core/src/layouts/prepared/glwe_to_lwe_switching_key.rs index 96a9907..865e9cd 100644 --- a/poulpy-core/src/layouts/prepared/glwe_to_lwe_switching_key.rs +++ b/poulpy-core/src/layouts/prepared/glwe_to_lwe_switching_key.rs @@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use crate::layouts::{ Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, - prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedAlloc}, + prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedFactory}, }; #[derive(PartialEq, Eq)] @@ -51,9 +51,9 @@ impl GGLWEInfos for GLWEToLWESwitchingKeyPrepared { } } -pub trait GLWEToLWESwitchingKeyPreparedAlloc +pub trait GLWEToLWESwitchingKeyPreparedFactory where - Self: GLWESwitchingKeyPreparedAlloc, + Self: GLWESwitchingKeyPreparedFactory, { fn alloc_glwe_to_lwe_switching_key_prepared( &self, @@ -118,20 +118,20 @@ where } } -impl GLWEToLWESwitchingKeyPreparedAlloc for Module where Self: GLWESwitchingKeyPreparedAlloc {} +impl GLWEToLWESwitchingKeyPreparedFactory for Module where Self: GLWESwitchingKeyPreparedFactory {} impl GLWEToLWESwitchingKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: GLWEToLWESwitchingKeyPreparedAlloc, + M: GLWEToLWESwitchingKeyPreparedFactory, { module.alloc_glwe_to_lwe_switching_key_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, rank_in: Rank, dnum: Dnum) -> Self where - M: GLWEToLWESwitchingKeyPreparedAlloc, + M: GLWEToLWESwitchingKeyPreparedFactory, { module.alloc_glwe_to_lwe_switching_key_prepared(base2k, k, rank_in, dnum) } @@ -139,14 +139,14 @@ impl GLWEToLWESwitchingKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: GLWEToLWESwitchingKeyPreparedAlloc, + M: GLWEToLWESwitchingKeyPreparedFactory, { module.bytes_of_glwe_to_lwe_switching_key_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, rank_in: Rank, dnum: Dnum) -> usize where - M: GLWEToLWESwitchingKeyPreparedAlloc, + M: GLWEToLWESwitchingKeyPreparedFactory, { module.bytes_of_glwe_to_lwe_switching_key_prepared(base2k, k, rank_in, dnum) } @@ -156,7 +156,7 @@ impl GLWEToLWESwitchingKeyPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M, infos: &A) where A: GGLWEInfos, - M: GLWEToLWESwitchingKeyPreparedAlloc, + M: GLWEToLWESwitchingKeyPreparedFactory, { module.prepare_glwe_to_lwe_switching_key_tmp_bytes(infos); } @@ -166,7 +166,7 @@ impl GLWEToLWESwitchingKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGLWEToRef + GLWESwitchingKeyDegrees, - M: GLWEToLWESwitchingKeyPreparedAlloc, + M: GLWEToLWESwitchingKeyPreparedFactory, { module.prepare_glwe_to_lwe_switching_key(self, other, scratch); } diff --git a/poulpy-core/src/layouts/prepared/lwe_switching_key.rs b/poulpy-core/src/layouts/prepared/lwe_switching_key.rs index 6fc0ee9..327d001 100644 --- a/poulpy-core/src/layouts/prepared/lwe_switching_key.rs +++ b/poulpy-core/src/layouts/prepared/lwe_switching_key.rs @@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use crate::layouts::{ Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, - prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedAlloc}, + prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedFactory}, }; #[derive(PartialEq, Eq)] @@ -50,9 +50,9 @@ impl GGLWEInfos for LWESwitchingKeyPrepared { } } -pub trait LWESwitchingKeyPreparedAlloc +pub trait LWESwitchingKeyPreparedFactory where - Self: GLWESwitchingKeyPreparedAlloc, + Self: GLWESwitchingKeyPreparedFactory, { fn alloc_lwe_switching_key_prepared( &self, @@ -126,20 +126,20 @@ where } } -impl LWESwitchingKeyPreparedAlloc for Module where Self: GLWESwitchingKeyPreparedAlloc {} +impl LWESwitchingKeyPreparedFactory for Module where Self: GLWESwitchingKeyPreparedFactory {} impl LWESwitchingKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: LWESwitchingKeyPreparedAlloc, + M: LWESwitchingKeyPreparedFactory, { module.alloc_lwe_switching_key_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> Self where - M: LWESwitchingKeyPreparedAlloc, + M: LWESwitchingKeyPreparedFactory, { module.alloc_lwe_switching_key_prepared(base2k, k, dnum) } @@ -147,14 +147,14 @@ impl LWESwitchingKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: LWESwitchingKeyPreparedAlloc, + M: LWESwitchingKeyPreparedFactory, { module.bytes_of_lwe_switching_key_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> usize where - M: LWESwitchingKeyPreparedAlloc, + M: LWESwitchingKeyPreparedFactory, { module.bytes_of_lwe_switching_key_prepared(base2k, k, dnum) } @@ -164,7 +164,7 @@ impl LWESwitchingKeyPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M, infos: &A) where A: GGLWEInfos, - M: LWESwitchingKeyPreparedAlloc, + M: LWESwitchingKeyPreparedFactory, { module.prepare_lwe_switching_key_tmp_bytes(infos); } @@ -174,7 +174,7 @@ impl LWESwitchingKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGLWEToRef + GLWESwitchingKeyDegrees, - M: LWESwitchingKeyPreparedAlloc, + M: LWESwitchingKeyPreparedFactory, { module.prepare_lwe_switching_key(self, other, scratch); } diff --git a/poulpy-core/src/layouts/prepared/lwe_to_glwe_switching_key.rs b/poulpy-core/src/layouts/prepared/lwe_to_glwe_switching_key.rs index bb0952c..30ed131 100644 --- a/poulpy-core/src/layouts/prepared/lwe_to_glwe_switching_key.rs +++ b/poulpy-core/src/layouts/prepared/lwe_to_glwe_switching_key.rs @@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use crate::layouts::{ Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, - prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedAlloc}, + prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedFactory}, }; /// A special [GLWESwitchingKey] required to for the conversion from [LWE] to [GLWE]. @@ -52,9 +52,9 @@ impl GGLWEInfos for LWEToGLWESwitchingKeyPrepared { } } -pub trait LWEToGLWESwitchingKeyPreparedAlloc +pub trait LWEToGLWESwitchingKeyPreparedFactory where - Self: GLWESwitchingKeyPreparedAlloc, + Self: GLWESwitchingKeyPreparedFactory, { fn alloc_lwe_to_glwe_switching_key_prepared( &self, @@ -125,20 +125,20 @@ where } } -impl LWEToGLWESwitchingKeyPreparedAlloc for Module where Self: GLWESwitchingKeyPreparedAlloc {} +impl LWEToGLWESwitchingKeyPreparedFactory for Module where Self: GLWESwitchingKeyPreparedFactory {} impl LWEToGLWESwitchingKeyPrepared, B> { pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGLWEInfos, - M: LWEToGLWESwitchingKeyPreparedAlloc, + M: LWEToGLWESwitchingKeyPreparedFactory, { module.alloc_lwe_to_glwe_switching_key_prepared_from_infos(infos) } pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, rank_out: Rank, dnum: Dnum) -> Self where - M: LWEToGLWESwitchingKeyPreparedAlloc, + M: LWEToGLWESwitchingKeyPreparedFactory, { module.alloc_lwe_to_glwe_switching_key_prepared(base2k, k, rank_out, dnum) } @@ -146,14 +146,14 @@ impl LWEToGLWESwitchingKeyPrepared, B> { pub fn bytes_of_from_infos(module: &M, infos: &A) -> usize where A: GGLWEInfos, - M: LWEToGLWESwitchingKeyPreparedAlloc, + M: LWEToGLWESwitchingKeyPreparedFactory, { module.bytes_of_lwe_to_glwe_switching_key_prepared_from_infos(infos) } pub fn bytes_of(module: &M, base2k: Base2K, k: TorusPrecision, rank_out: Rank, dnum: Dnum) -> usize where - M: LWEToGLWESwitchingKeyPreparedAlloc, + M: LWEToGLWESwitchingKeyPreparedFactory, { module.bytes_of_lwe_to_glwe_switching_key_prepared(base2k, k, rank_out, dnum) } @@ -163,7 +163,7 @@ impl LWEToGLWESwitchingKeyPrepared, B> { pub fn prepare_tmp_bytes(&self, module: &M, infos: &A) where A: GGLWEInfos, - M: LWEToGLWESwitchingKeyPreparedAlloc, + M: LWEToGLWESwitchingKeyPreparedFactory, { module.prepare_lwe_to_glwe_switching_key_tmp_bytes(infos); } @@ -173,7 +173,7 @@ impl LWEToGLWESwitchingKeyPrepared { pub fn prepare(&mut self, module: &M, other: &O, scratch: &mut Scratch) where O: GGLWEToRef + GLWESwitchingKeyDegrees, - M: LWEToGLWESwitchingKeyPreparedAlloc, + M: LWEToGLWESwitchingKeyPreparedFactory, { module.prepare_lwe_to_glwe_switching_key(self, other, scratch); } diff --git a/poulpy-core/src/tests/test_suite/automorphism/gglwe_atk.rs b/poulpy-core/src/tests/test_suite/automorphism/gglwe_atk.rs index fabd835..a8d3d53 100644 --- a/poulpy-core/src/tests/test_suite/automorphism/gglwe_atk.rs +++ b/poulpy-core/src/tests/test_suite/automorphism/gglwe_atk.rs @@ -8,8 +8,8 @@ use crate::{ AutomorphismKeyEncryptSk, GLWEAutomorphismKeyAutomorphism, GLWEDecrypt, ScratchTakeCore, encryption::SIGMA, layouts::{ - AutomorphismKey, AutomorphismKeyLayout, GGLWEInfos, GLWEAutomorphismKeyPreparedApi, GLWEPlaintext, GLWESecret, - GLWESecretPreparedApi, + AutomorphismKey, AutomorphismKeyLayout, GGLWEInfos, GLWEAutomorphismKeyPreparedFactory, GLWEPlaintext, GLWESecret, + GLWESecretPreparedFactory, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, }, noise::log2_std_noise_gglwe_product, @@ -19,12 +19,12 @@ use crate::{ pub fn test_gglwe_automorphism_key_automorphism(module: &Module) where Module: AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GLWEAutomorphismKeyAutomorphism + VecZnxAutomorphism + GaloisElement + VecZnxSubScalarInplace - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWEDecrypt, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, @@ -188,12 +188,12 @@ where pub fn test_gglwe_automorphism_key_automorphism_inplace(module: &Module) where Module: AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GLWEAutomorphismKeyAutomorphism + VecZnxAutomorphism + GaloisElement + VecZnxSubScalarInplace - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWEDecrypt, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, diff --git a/poulpy-core/src/tests/test_suite/automorphism/ggsw_ct.rs b/poulpy-core/src/tests/test_suite/automorphism/ggsw_ct.rs index b8cd8d1..384a86b 100644 --- a/poulpy-core/src/tests/test_suite/automorphism/ggsw_ct.rs +++ b/poulpy-core/src/tests/test_suite/automorphism/ggsw_ct.rs @@ -8,8 +8,8 @@ use crate::{ AutomorphismKeyEncryptSk, GGSWAutomorphism, GGSWEncryptSk, GGSWNoise, ScratchTakeCore, TensorKeyEncryptSk, encryption::SIGMA, layouts::{ - AutomorphismKey, GGSW, GGSWLayout, GLWEAutomorphismKeyPreparedApi, GLWESecret, GLWESecretPreparedApi, TensorKey, - TensorKeyLayout, TensorKeyPreparedAlloc, + AutomorphismKey, GGSW, GGSWLayout, GLWEAutomorphismKeyPreparedFactory, GLWESecret, GLWESecretPreparedFactory, TensorKey, + TensorKeyLayout, TensorKeyPreparedFactory, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared, TensorKeyPrepared}, }, noise::noise_ggsw_keyswitch, @@ -19,11 +19,11 @@ pub fn test_ggsw_automorphism(module: &Module) where Module: GGSWEncryptSk + AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GGSWAutomorphism - + TensorKeyPreparedAlloc + + TensorKeyPreparedFactory + TensorKeyEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxAutomorphismInplace + GGSWNoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, @@ -178,11 +178,11 @@ pub fn test_ggsw_automorphism_inplace(module: &Module) where Module: GGSWEncryptSk + AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GGSWAutomorphism - + TensorKeyPreparedAlloc + + TensorKeyPreparedFactory + TensorKeyEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxAutomorphismInplace + GGSWNoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, diff --git a/poulpy-core/src/tests/test_suite/automorphism/glwe_ct.rs b/poulpy-core/src/tests/test_suite/automorphism/glwe_ct.rs index 64540cb..df9d36d 100644 --- a/poulpy-core/src/tests/test_suite/automorphism/glwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/automorphism/glwe_ct.rs @@ -8,8 +8,8 @@ use crate::{ AutomorphismKeyEncryptSk, GLWEAutomorphism, GLWEDecrypt, GLWEEncryptSk, GLWENoise, ScratchTakeCore, encryption::SIGMA, layouts::{ - AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedApi, GLWELayout, GLWEPlaintext, GLWESecret, - GLWESecretPreparedApi, + AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedFactory, GLWELayout, GLWEPlaintext, GLWESecret, + GLWESecretPreparedFactory, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, }, noise::log2_std_noise_gglwe_product, @@ -18,12 +18,12 @@ use crate::{ pub fn test_glwe_automorphism(module: &Module) where Module: GLWEEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxFillUniform + GLWEDecrypt + GLWEAutomorphism + AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GLWENoise + VecZnxAutomorphismInplace, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, @@ -136,12 +136,12 @@ where pub fn test_glwe_automorphism_inplace(module: &Module) where Module: GLWEEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxFillUniform + GLWEDecrypt + GLWEAutomorphism + AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GLWENoise + VecZnxAutomorphismInplace, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, diff --git a/poulpy-core/src/tests/test_suite/conversion.rs b/poulpy-core/src/tests/test_suite/conversion.rs index 0c55bad..c6e7d00 100644 --- a/poulpy-core/src/tests/test_suite/conversion.rs +++ b/poulpy-core/src/tests/test_suite/conversion.rs @@ -8,9 +8,9 @@ use crate::{ GLWEDecrypt, GLWEEncryptSk, GLWEFromLWE, GLWEToLWESwitchingKeyEncryptSk, LWEDecrypt, LWEEncryptSk, LWEToGLWESwitchingKeyEncryptSk, ScratchTakeCore, layouts::{ - Base2K, Degree, Dnum, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GLWEToLWEKeyLayout, - GLWEToLWESwitchingKey, GLWEToLWESwitchingKeyPreparedAlloc, LWE, LWELayout, LWEPlaintext, LWESecret, - LWEToGLWESwitchingKey, LWEToGLWESwitchingKeyLayout, LWEToGLWESwitchingKeyPreparedAlloc, Rank, TorusPrecision, + Base2K, Degree, Dnum, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, GLWEToLWEKeyLayout, + GLWEToLWESwitchingKey, GLWEToLWESwitchingKeyPreparedFactory, LWE, LWELayout, LWEPlaintext, LWESecret, + LWEToGLWESwitchingKey, LWEToGLWESwitchingKeyLayout, LWEToGLWESwitchingKeyPreparedFactory, Rank, TorusPrecision, prepared::{GLWESecretPrepared, GLWEToLWESwitchingKeyPrepared, LWEToGLWESwitchingKeyPrepared}, }, }; @@ -20,9 +20,9 @@ where Module: GLWEFromLWE + LWEToGLWESwitchingKeyEncryptSk + GLWEDecrypt - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + LWEEncryptSk - + LWEToGLWESwitchingKeyPreparedAlloc, + + LWEToGLWESwitchingKeyPreparedFactory, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { @@ -112,9 +112,9 @@ where + GLWEEncryptSk + LWEDecrypt + GLWEDecrypt - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWEToLWESwitchingKeyEncryptSk - + GLWEToLWESwitchingKeyPreparedAlloc, + + GLWEToLWESwitchingKeyPreparedFactory, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { diff --git a/poulpy-core/src/tests/test_suite/encryption/gglwe_atk.rs b/poulpy-core/src/tests/test_suite/encryption/gglwe_atk.rs index 11d0c00..3b642c4 100644 --- a/poulpy-core/src/tests/test_suite/encryption/gglwe_atk.rs +++ b/poulpy-core/src/tests/test_suite/encryption/gglwe_atk.rs @@ -9,7 +9,7 @@ use crate::{ GLWESwitchingKeyEncryptSk, ScratchTakeCore, encryption::SIGMA, layouts::{ - AutomorphismKey, AutomorphismKeyDecompress, AutomorphismKeyLayout, GLWEInfos, GLWESecret, GLWESecretPreparedApi, + AutomorphismKey, AutomorphismKeyDecompress, AutomorphismKeyLayout, GLWEInfos, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKeyDecompress, compressed::GLWEAutomorphismKeyCompressed, prepared::GLWESecretPrepared, }, noise::GGLWENoise, @@ -19,7 +19,7 @@ pub fn test_gglwe_automorphism_key_encrypt_sk(module: &Module) where Module: AutomorphismKeyEncryptSk + GGLWEKeyswitch - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWESwitchingKeyEncryptSk + GLWESwitchingKeyCompressedEncryptSk + GLWESwitchingKeyDecompress @@ -91,7 +91,7 @@ pub fn test_gglwe_automorphism_key_compressed_encrypt_sk(module: &M where Module: AutomorphismKeyCompressedEncryptSk + GGLWEKeyswitch - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWESwitchingKeyEncryptSk + GLWESwitchingKeyCompressedEncryptSk + AutomorphismKeyDecompress diff --git a/poulpy-core/src/tests/test_suite/encryption/gglwe_ct.rs b/poulpy-core/src/tests/test_suite/encryption/gglwe_ct.rs index 1516684..9e8aafe 100644 --- a/poulpy-core/src/tests/test_suite/encryption/gglwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/encryption/gglwe_ct.rs @@ -9,8 +9,8 @@ use crate::{ decryption::GLWEDecrypt, encryption::SIGMA, layouts::{ - GGLWELayout, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyCompressed, GLWESwitchingKeyDecompress, - prepared::{GGLWEPreparedAlloc, GLWESecretPrepared}, + GGLWELayout, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyCompressed, GLWESwitchingKeyDecompress, + prepared::{GGLWEPreparedFactory, GLWESecretPrepared}, }, noise::GGLWENoise, }; @@ -18,10 +18,10 @@ use crate::{ pub fn test_gglwe_switching_key_encrypt_sk(module: &Module) where Module: GGLWEEncryptSk - + GGLWEPreparedAlloc + + GGLWEPreparedFactory + GGLWEKeyswitch + GLWEDecrypt - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWESwitchingKeyEncryptSk + VecZnxFillUniform + GGLWENoise, @@ -83,10 +83,10 @@ where pub fn test_gglwe_switching_key_compressed_encrypt_sk(module: &Module) where Module: GGLWEEncryptSk - + GGLWEPreparedAlloc + + GGLWEPreparedFactory + GGLWEKeyswitch + GLWEDecrypt - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWESwitchingKeyEncryptSk + GLWESwitchingKeyCompressedEncryptSk + GLWESwitchingKeyDecompress diff --git a/poulpy-core/src/tests/test_suite/encryption/ggsw_ct.rs b/poulpy-core/src/tests/test_suite/encryption/ggsw_ct.rs index b315fef..54b5df0 100644 --- a/poulpy-core/src/tests/test_suite/encryption/ggsw_ct.rs +++ b/poulpy-core/src/tests/test_suite/encryption/ggsw_ct.rs @@ -8,7 +8,7 @@ use crate::{ GGSWCompressedEncryptSk, GGSWEncryptSk, GGSWNoise, ScratchTakeCore, encryption::SIGMA, layouts::{ - GGSW, GGSWDecompress, GGSWLayout, GLWESecret, GLWESecretPreparedApi, compressed::GGSWCompressed, + GGSW, GGSWDecompress, GGSWLayout, GLWESecret, GLWESecretPreparedFactory, compressed::GGSWCompressed, prepared::GLWESecretPrepared, }, }; @@ -17,7 +17,7 @@ pub fn test_ggsw_encrypt_sk(module: &Module) where ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchTakeCore, - Module: GGSWEncryptSk + GLWESecretPreparedApi + GGSWNoise, + Module: GGSWEncryptSk + GLWESecretPreparedFactory + GGSWNoise, { let base2k: usize = 12; let k: usize = 54; @@ -74,7 +74,7 @@ pub fn test_ggsw_compressed_encrypt_sk(module: &Module) where ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchTakeCore, - Module: GGSWCompressedEncryptSk + GLWESecretPreparedApi + GGSWNoise + GGSWDecompress, + Module: GGSWCompressedEncryptSk + GLWESecretPreparedFactory + GGSWNoise + GGSWDecompress, { let base2k: usize = 12; let k: usize = 54; diff --git a/poulpy-core/src/tests/test_suite/encryption/glwe_ct.rs b/poulpy-core/src/tests/test_suite/encryption/glwe_ct.rs index 135561d..514d28d 100644 --- a/poulpy-core/src/tests/test_suite/encryption/glwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/encryption/glwe_ct.rs @@ -9,8 +9,8 @@ use crate::{ decryption::GLWEDecrypt, encryption::SIGMA, layouts::{ - GLWE, GLWELayout, GLWEPlaintext, GLWEPlaintextLayout, GLWEPublicKey, GLWEPublicKeyPreparedAlloc, GLWESecret, - GLWESecretPreparedApi, LWEInfos, + GLWE, GLWELayout, GLWEPlaintext, GLWEPlaintextLayout, GLWEPublicKey, GLWEPublicKeyPreparedFactory, GLWESecret, + GLWESecretPreparedFactory, LWEInfos, compressed::GLWECompressed, prepared::{GLWEPublicKeyPrepared, GLWESecretPrepared}, }, @@ -18,7 +18,7 @@ use crate::{ pub fn test_glwe_encrypt_sk(module: &Module) where - Module: GLWEEncryptSk + GLWEDecrypt + GLWESecretPreparedApi + VecZnxFillUniform + GLWESub, + Module: GLWEEncryptSk + GLWEDecrypt + GLWESecretPreparedFactory + VecZnxFillUniform + GLWESub, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { @@ -83,7 +83,7 @@ where pub fn test_glwe_compressed_encrypt_sk(module: &Module) where - Module: GLWECompressedEncryptSk + GLWEDecrypt + GLWESecretPreparedApi + VecZnxFillUniform + GLWESub, + Module: GLWECompressedEncryptSk + GLWEDecrypt + GLWESecretPreparedFactory + VecZnxFillUniform + GLWESub, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { @@ -160,7 +160,7 @@ where pub fn test_glwe_encrypt_zero_sk(module: &Module) where - Module: GLWEEncryptSk + GLWEDecrypt + GLWESecretPreparedApi + VecZnxFillUniform + GLWESub, + Module: GLWEEncryptSk + GLWEDecrypt + GLWESecretPreparedFactory + VecZnxFillUniform + GLWESub, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { @@ -210,10 +210,10 @@ where pub fn test_glwe_encrypt_pk(module: &Module) where Module: GLWEEncryptPk - + GLWEPublicKeyPreparedAlloc + + GLWEPublicKeyPreparedFactory + GLWEPublicKeyGenerate + GLWEDecrypt - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxFillUniform + GLWESub, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, diff --git a/poulpy-core/src/tests/test_suite/encryption/glwe_tsk.rs b/poulpy-core/src/tests/test_suite/encryption/glwe_tsk.rs index e56d0fb..9135374 100644 --- a/poulpy-core/src/tests/test_suite/encryption/glwe_tsk.rs +++ b/poulpy-core/src/tests/test_suite/encryption/glwe_tsk.rs @@ -13,7 +13,7 @@ use crate::{ decryption::GLWEDecrypt, encryption::SIGMA, layouts::{ - Dsize, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GLWETensorKeyCompressed, TensorKey, TensorKeyLayout, + Dsize, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, GLWETensorKeyCompressed, TensorKey, TensorKeyLayout, prepared::GLWESecretPrepared, }, }; @@ -21,7 +21,7 @@ use crate::{ pub fn test_gglwe_tensor_key_encrypt_sk(module: &Module) where Module: TensorKeyEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWEDecrypt + VecZnxDftAlloc + VecZnxBigAlloc @@ -112,7 +112,7 @@ where pub fn test_gglwe_tensor_key_compressed_encrypt_sk(module: &Module) where Module: TensorKeyEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GGLWETensorKeyCompressedEncryptSk + GLWEDecrypt + VecZnxDftAlloc diff --git a/poulpy-core/src/tests/test_suite/external_product/gglwe_ksk.rs b/poulpy-core/src/tests/test_suite/external_product/gglwe_ksk.rs index 419da96..07a0926 100644 --- a/poulpy-core/src/tests/test_suite/external_product/gglwe_ksk.rs +++ b/poulpy-core/src/tests/test_suite/external_product/gglwe_ksk.rs @@ -8,7 +8,7 @@ use crate::{ GGLWEExternalProduct, GGLWENoise, GGSWEncryptSk, GLWESwitchingKeyEncryptSk, ScratchTakeCore, encryption::SIGMA, layouts::{ - GGSW, GGSWLayout, GGSWPreparedAlloc, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, + GGSW, GGSWLayout, GGSWPreparedFactory, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout, prepared::{GGSWPrepared, GLWESecretPrepared}, }, noise::noise_ggsw_product, @@ -20,9 +20,9 @@ where Module: GGLWEExternalProduct + GGSWEncryptSk + GLWESwitchingKeyEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxRotateInplace - + GGSWPreparedAlloc + + GGSWPreparedFactory + GGLWENoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, @@ -169,9 +169,9 @@ where Module: GGLWEExternalProduct + GGSWEncryptSk + GLWESwitchingKeyEncryptSk - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxRotateInplace - + GGSWPreparedAlloc + + GGSWPreparedFactory + GGLWENoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, diff --git a/poulpy-core/src/tests/test_suite/external_product/ggsw_ct.rs b/poulpy-core/src/tests/test_suite/external_product/ggsw_ct.rs index 7e7535c..3fe2da4 100644 --- a/poulpy-core/src/tests/test_suite/external_product/ggsw_ct.rs +++ b/poulpy-core/src/tests/test_suite/external_product/ggsw_ct.rs @@ -8,7 +8,7 @@ use crate::{ GGSWEncryptSk, GGSWExternalProduct, GGSWNoise, ScratchTakeCore, encryption::SIGMA, layouts::{ - GGSW, GGSWLayout, GGSWPreparedAlloc, GLWESecret, GLWESecretPreparedApi, + GGSW, GGSWLayout, GGSWPreparedFactory, GLWESecret, GLWESecretPreparedFactory, prepared::{GGSWPrepared, GLWESecretPrepared}, }, noise::noise_ggsw_product, @@ -19,8 +19,8 @@ pub fn test_ggsw_external_product(module: &Module) where Module: GGSWEncryptSk + GGSWExternalProduct - + GLWESecretPreparedApi - + GGSWPreparedAlloc + + GLWESecretPreparedFactory + + GGSWPreparedFactory + VecZnxRotateInplace + GGSWNoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, @@ -153,8 +153,8 @@ pub fn test_ggsw_external_product_inplace(module: &Module) where Module: GGSWEncryptSk + GGSWExternalProduct - + GLWESecretPreparedApi - + GGSWPreparedAlloc + + GLWESecretPreparedFactory + + GGSWPreparedFactory + VecZnxRotateInplace + GGSWNoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, diff --git a/poulpy-core/src/tests/test_suite/external_product/glwe_ct.rs b/poulpy-core/src/tests/test_suite/external_product/glwe_ct.rs index d501b9a..0425d35 100644 --- a/poulpy-core/src/tests/test_suite/external_product/glwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/external_product/glwe_ct.rs @@ -8,7 +8,7 @@ use crate::{ GGSWEncryptSk, GLWEEncryptSk, GLWEExternalProduct, GLWENoise, ScratchTakeCore, encryption::SIGMA, layouts::{ - GGSW, GGSWLayout, GGSWPreparedAlloc, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, + GGSW, GGSWLayout, GGSWPreparedFactory, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, prepared::{GGSWPrepared, GLWESecretPrepared}, }, noise::noise_ggsw_product, @@ -18,13 +18,13 @@ use crate::{ pub fn test_glwe_external_product(module: &Module) where Module: GGSWEncryptSk - + GGSWPreparedAlloc + + GGSWPreparedFactory + VecZnxFillUniform + GLWEExternalProduct + GLWEEncryptSk + GLWENoise + VecZnxRotateInplace - + GLWESecretPreparedApi, + + GLWESecretPreparedFactory, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { @@ -148,13 +148,13 @@ where pub fn test_glwe_external_product_inplace(module: &Module) where Module: GGSWEncryptSk - + GGSWPreparedAlloc + + GGSWPreparedFactory + VecZnxFillUniform + GLWEExternalProduct + GLWEEncryptSk + GLWENoise + VecZnxRotateInplace - + GLWESecretPreparedApi, + + GLWESecretPreparedFactory, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { diff --git a/poulpy-core/src/tests/test_suite/keyswitch/gglwe_ct.rs b/poulpy-core/src/tests/test_suite/keyswitch/gglwe_ct.rs index baa1c34..548d1f0 100644 --- a/poulpy-core/src/tests/test_suite/keyswitch/gglwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/keyswitch/gglwe_ct.rs @@ -8,7 +8,7 @@ use crate::{ GGLWEKeyswitch, GGLWENoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, encryption::SIGMA, layouts::{ - GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, GLWESwitchingKeyPreparedAlloc, + GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout, GLWESwitchingKeyPreparedFactory, prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared}, }, noise::log2_std_noise_gglwe_product, @@ -18,8 +18,8 @@ pub fn test_gglwe_switching_key_keyswitch(module: &Module) where Module: GLWESwitchingKeyEncryptSk + GGLWEKeyswitch - + GLWESwitchingKeyPreparedAlloc - + GLWESecretPreparedApi + + GLWESwitchingKeyPreparedFactory + + GLWESecretPreparedFactory + GGLWENoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, @@ -162,9 +162,9 @@ pub fn test_gglwe_switching_key_keyswitch_inplace(module: &Module: GLWESwitchingKeyEncryptSk + GGLWEKeyswitch - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GGLWENoise - + GLWESwitchingKeyPreparedAlloc, + + GLWESwitchingKeyPreparedFactory, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { diff --git a/poulpy-core/src/tests/test_suite/keyswitch/ggsw_ct.rs b/poulpy-core/src/tests/test_suite/keyswitch/ggsw_ct.rs index 8f5be61..288eb88 100644 --- a/poulpy-core/src/tests/test_suite/keyswitch/ggsw_ct.rs +++ b/poulpy-core/src/tests/test_suite/keyswitch/ggsw_ct.rs @@ -8,8 +8,8 @@ use crate::{ GGSWEncryptSk, GGSWKeyswitch, GGSWNoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, TensorKeyEncryptSk, encryption::SIGMA, layouts::{ - GGSW, GGSWLayout, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, - GLWESwitchingKeyPreparedAlloc, TensorKey, TensorKeyLayout, TensorKeyPreparedAlloc, + GGSW, GGSWLayout, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout, + GLWESwitchingKeyPreparedFactory, TensorKey, TensorKeyLayout, TensorKeyPreparedFactory, prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared, TensorKeyPrepared}, }, noise::noise_ggsw_keyswitch, @@ -22,9 +22,9 @@ where + GLWESwitchingKeyEncryptSk + TensorKeyEncryptSk + GGSWKeyswitch - + GLWESecretPreparedApi - + TensorKeyPreparedAlloc - + GLWESwitchingKeyPreparedAlloc + + GLWESecretPreparedFactory + + TensorKeyPreparedFactory + + GLWESwitchingKeyPreparedFactory + GGSWNoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, @@ -187,9 +187,9 @@ where + GLWESwitchingKeyEncryptSk + TensorKeyEncryptSk + GGSWKeyswitch - + GLWESecretPreparedApi - + TensorKeyPreparedAlloc - + GLWESwitchingKeyPreparedAlloc + + GLWESecretPreparedFactory + + TensorKeyPreparedFactory + + GLWESwitchingKeyPreparedFactory + GGSWNoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, diff --git a/poulpy-core/src/tests/test_suite/keyswitch/glwe_ct.rs b/poulpy-core/src/tests/test_suite/keyswitch/glwe_ct.rs index 8619a7b..90cc543 100644 --- a/poulpy-core/src/tests/test_suite/keyswitch/glwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/keyswitch/glwe_ct.rs @@ -8,8 +8,8 @@ use crate::{ GLWEEncryptSk, GLWEKeyswitch, GLWENoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, encryption::SIGMA, layouts::{ - GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, - GLWESwitchingKeyPreparedAlloc, + GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout, + GLWESwitchingKeyPreparedFactory, prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared}, }, noise::log2_std_noise_gglwe_product, @@ -22,8 +22,8 @@ where + GLWESwitchingKeyEncryptSk + GLWEEncryptSk + GLWEKeyswitch - + GLWESecretPreparedApi - + GLWESwitchingKeyPreparedAlloc + + GLWESecretPreparedFactory + + GLWESwitchingKeyPreparedFactory + GLWENoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, @@ -143,8 +143,8 @@ where + GLWESwitchingKeyEncryptSk + GLWEEncryptSk + GLWEKeyswitch - + GLWESecretPreparedApi - + GLWESwitchingKeyPreparedAlloc + + GLWESecretPreparedFactory + + GLWESwitchingKeyPreparedFactory + GLWENoise, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, diff --git a/poulpy-core/src/tests/test_suite/keyswitch/lwe_ct.rs b/poulpy-core/src/tests/test_suite/keyswitch/lwe_ct.rs index cbda02f..7617b09 100644 --- a/poulpy-core/src/tests/test_suite/keyswitch/lwe_ct.rs +++ b/poulpy-core/src/tests/test_suite/keyswitch/lwe_ct.rs @@ -7,7 +7,7 @@ use poulpy_hal::{ use crate::{ LWEDecrypt, LWEEncryptSk, LWEKeySwitch, LWESwitchingKeyEncrypt, ScratchTakeCore, layouts::{ - LWE, LWELayout, LWEPlaintext, LWESecret, LWESwitchingKey, LWESwitchingKeyLayout, LWESwitchingKeyPreparedAlloc, + LWE, LWELayout, LWEPlaintext, LWESecret, LWESwitchingKey, LWESwitchingKeyLayout, LWESwitchingKeyPreparedFactory, prepared::LWESwitchingKeyPrepared, }, }; @@ -15,7 +15,7 @@ use crate::{ pub fn test_lwe_keyswitch(module: &Module) where Module: - LWEKeySwitch + LWESwitchingKeyEncrypt + LWEEncryptSk + LWESwitchingKeyPreparedAlloc + LWEDecrypt, + LWEKeySwitch + LWESwitchingKeyEncrypt + LWEEncryptSk + LWESwitchingKeyPreparedFactory + LWEDecrypt, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow, Scratch: ScratchAvailable + ScratchTakeCore, { diff --git a/poulpy-core/src/tests/test_suite/packing.rs b/poulpy-core/src/tests/test_suite/packing.rs index a9e340e..ec685f4 100644 --- a/poulpy-core/src/tests/test_suite/packing.rs +++ b/poulpy-core/src/tests/test_suite/packing.rs @@ -9,8 +9,8 @@ use poulpy_hal::{ use crate::{ AutomorphismKeyEncryptSk, GLWEDecrypt, GLWEEncryptSk, GLWEPacker, GLWEPacking, GLWERotate, GLWESub, ScratchTakeCore, layouts::{ - AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedApi, GLWELayout, GLWEPlaintext, GLWESecret, - GLWESecretPreparedApi, + AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedFactory, GLWELayout, GLWEPlaintext, GLWESecret, + GLWESecretPreparedFactory, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, }, }; @@ -19,9 +19,9 @@ pub fn test_glwe_packing(module: &Module) where Module: GLWEEncryptSk + AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + GLWEPacking - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + GLWESub + GLWEDecrypt + GLWERotate, diff --git a/poulpy-core/src/tests/test_suite/trace.rs b/poulpy-core/src/tests/test_suite/trace.rs index c15e584..4b83808 100644 --- a/poulpy-core/src/tests/test_suite/trace.rs +++ b/poulpy-core/src/tests/test_suite/trace.rs @@ -11,8 +11,8 @@ use crate::{ encryption::SIGMA, glwe_trace::GLWETrace, layouts::{ - AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedApi, GLWELayout, GLWEPlaintext, GLWESecret, - GLWESecretPreparedApi, LWEInfos, + AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedFactory, GLWELayout, GLWEPlaintext, GLWESecret, + GLWESecretPreparedFactory, LWEInfos, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, }, noise::var_noise_gglwe_product, @@ -24,9 +24,9 @@ where + GLWEEncryptSk + GLWEDecrypt + AutomorphismKeyEncryptSk - + GLWEAutomorphismKeyPreparedApi + + GLWEAutomorphismKeyPreparedFactory + VecZnxFillUniform - + GLWESecretPreparedApi + + GLWESecretPreparedFactory + VecZnxSubInplace + VecZnxNormalizeInplace, ScratchOwned: ScratchOwnedAlloc + ScratchOwnedBorrow,