update trait name

This commit is contained in:
Pro7ech
2025-10-21 10:22:50 +02:00
parent db3b20b8f6
commit 681ec7e349
38 changed files with 210 additions and 210 deletions

View File

@@ -8,7 +8,7 @@ use crate::{
GGLWECompressedEncryptSk, ScratchTakeCore, GGLWECompressedEncryptSk, ScratchTakeCore,
layouts::{ layouts::{
GGLWECompressedSeedMut, GGLWECompressedToMut, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretPrepared, 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<BE: Backend> {
impl<BE: Backend> AutomorphismKeyCompressedEncryptSk<BE> for Module<BE> impl<BE: Backend> AutomorphismKeyCompressedEncryptSk<BE> for Module<BE>
where where
Self: ModuleN + GaloisElement + VecZnxAutomorphism + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedApi<BE>, Self: ModuleN + GaloisElement + VecZnxAutomorphism + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedFactory<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn automorphism_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize fn automorphism_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -10,7 +10,7 @@ use crate::{
GGLWECompressedSeedMut, GGLWECompressedToMut, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretToRef, GGLWECompressedSeedMut, GGLWECompressedToMut, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretToRef,
GLWESwitchingKeyDegreesMut, LWEInfos, GLWESwitchingKeyDegreesMut, LWEInfos,
compressed::GLWESwitchingKeyCompressed, compressed::GLWESwitchingKeyCompressed,
prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, prepared::{GLWESecretPrepared, GLWESecretPreparedFactory},
}, },
}; };
@@ -64,7 +64,7 @@ pub trait GLWESwitchingKeyCompressedEncryptSk<BE: Backend> {
impl<BE: Backend> GLWESwitchingKeyCompressedEncryptSk<BE> for Module<BE> impl<BE: Backend> GLWESwitchingKeyCompressedEncryptSk<BE> for Module<BE>
where where
Self: ModuleN + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedApi<BE> + VecZnxSwitchRing, Self: ModuleN + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedFactory<BE> + VecZnxSwitchRing,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn glwe_switching_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize fn glwe_switching_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -10,7 +10,7 @@ use poulpy_hal::{
use crate::{ use crate::{
GGLWECompressedEncryptSk, GetDistribution, ScratchTakeCore, TensorKeyEncryptSk, GGLWECompressedEncryptSk, GetDistribution, ScratchTakeCore, TensorKeyEncryptSk,
layouts::{ layouts::{
GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedApi, GLWESecretToRef, LWEInfos, Rank, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedFactory, GLWESecretToRef, LWEInfos, Rank,
TensorKeyCompressedAtMut, compressed::GLWETensorKeyCompressed, TensorKeyCompressedAtMut, compressed::GLWETensorKeyCompressed,
}, },
}; };
@@ -72,7 +72,7 @@ where
+ SvpPPolBytesOf + SvpPPolBytesOf
+ VecZnxDftBytesOf + VecZnxDftBytesOf
+ VecZnxBigBytesOf + VecZnxBigBytesOf
+ GLWESecretPreparedApi<BE>, + GLWESecretPreparedFactory<BE>,
Scratch<BE>: ScratchTakeBasic + ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeBasic + ScratchTakeCore<BE>,
{ {
fn tensor_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize fn tensor_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -7,7 +7,7 @@ use poulpy_hal::{
use crate::{ use crate::{
GGLWEEncryptSk, ScratchTakeCore, GGLWEEncryptSk, ScratchTakeCore,
layouts::{ layouts::{
AutomorphismKey, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedApi, AutomorphismKey, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESecret, GLWESecretPrepared, GLWESecretPreparedFactory,
GLWESecretToRef, LWEInfos, SetGaloisElement, GLWESecretToRef, LWEInfos, SetGaloisElement,
}, },
}; };
@@ -70,7 +70,7 @@ pub trait AutomorphismKeyEncryptSk<BE: Backend> {
impl<BE: Backend> AutomorphismKeyEncryptSk<BE> for Module<BE> impl<BE: Backend> AutomorphismKeyEncryptSk<BE> for Module<BE>
where where
Self: GGLWEEncryptSk<BE> + VecZnxAutomorphism + GaloisElement + SvpPPolBytesOf + GLWESecretPreparedApi<BE>, Self: GGLWEEncryptSk<BE> + VecZnxAutomorphism + GaloisElement + SvpPPolBytesOf + GLWESecretPreparedFactory<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn automorphism_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize fn automorphism_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -9,7 +9,7 @@ use crate::{
encryption::gglwe::GGLWEEncryptSk, encryption::gglwe::GGLWEEncryptSk,
layouts::{ layouts::{
GGLWEInfos, GGLWEToMut, GLWEInfos, GLWESecret, GLWESecretToRef, GLWESwitchingKey, GLWESwitchingKeyDegreesMut, LWEInfos, GGLWEInfos, GGLWEToMut, GLWEInfos, GLWESecret, GLWESecretToRef, GLWESwitchingKey, GLWESwitchingKeyDegreesMut, LWEInfos,
prepared::GLWESecretPreparedApi, prepared::GLWESecretPreparedFactory,
}, },
}; };
@@ -71,7 +71,7 @@ pub trait GLWESwitchingKeyEncryptSk<BE: Backend> {
impl<BE: Backend> GLWESwitchingKeyEncryptSk<BE> for Module<BE> impl<BE: Backend> GLWESwitchingKeyEncryptSk<BE> for Module<BE>
where where
Self: ModuleN + GGLWEEncryptSk<BE> + GLWESecretPreparedApi<BE> + VecZnxSwitchRing + SvpPrepare<BE>, Self: ModuleN + GGLWEEncryptSk<BE> + GLWESecretPreparedFactory<BE> + VecZnxSwitchRing + SvpPrepare<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn glwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize fn glwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -11,7 +11,7 @@ use crate::{
GGLWEEncryptSk, GetDistribution, ScratchTakeCore, GGLWEEncryptSk, GetDistribution, ScratchTakeCore,
layouts::{ layouts::{
GGLWE, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretToRef, LWEInfos, Rank, TensorKey, TensorKeyToMut, GGLWE, GGLWEInfos, GLWEInfos, GLWESecret, GLWESecretToRef, LWEInfos, Rank, TensorKey, TensorKeyToMut,
prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, prepared::{GLWESecretPrepared, GLWESecretPreparedFactory},
}, },
}; };
@@ -65,7 +65,7 @@ where
+ GGLWEEncryptSk<BE> + GGLWEEncryptSk<BE>
+ VecZnxDftBytesOf + VecZnxDftBytesOf
+ VecZnxBigBytesOf + VecZnxBigBytesOf
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxDftApply<BE> + VecZnxDftApply<BE>
+ SvpApplyDftToDft<BE> + SvpApplyDftToDft<BE>
+ VecZnxIdftApplyTmpA<BE> + VecZnxIdftApplyTmpA<BE>

View File

@@ -9,7 +9,7 @@ use crate::{
layouts::{ layouts::{
GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretToRef, GLWEToLWESwitchingKey, LWEInfos, LWESecret, LWESecretToRef, GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretToRef, GLWEToLWESwitchingKey, LWEInfos, LWESecret, LWESecretToRef,
Rank, Rank,
prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, prepared::{GLWESecretPrepared, GLWESecretPreparedFactory},
}, },
}; };
@@ -65,7 +65,7 @@ impl<BE: Backend> GLWEToLWESwitchingKeyEncryptSk<BE> for Module<BE>
where where
Self: ModuleN Self: ModuleN
+ GGLWEEncryptSk<BE> + GGLWEEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplace<BE> + VecZnxAutomorphismInplace<BE>
+ VecZnxAutomorphismInplaceTmpBytes, + VecZnxAutomorphismInplaceTmpBytes,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,

View File

@@ -10,7 +10,7 @@ use crate::{
layouts::{ layouts::{
GGLWEInfos, GGLWEToMut, GLWESecret, GLWESwitchingKey, GLWESwitchingKeyDegreesMut, LWEInfos, LWESecret, LWESecretToRef, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESwitchingKey, GLWESwitchingKeyDegreesMut, LWEInfos, LWESecret, LWESecretToRef,
LWESwitchingKey, Rank, LWESwitchingKey, Rank,
prepared::{GLWESecretPrepared, GLWESecretPreparedApi}, prepared::{GLWESecretPrepared, GLWESecretPreparedFactory},
}, },
}; };
@@ -63,7 +63,7 @@ pub trait LWESwitchingKeyEncrypt<BE: Backend> {
impl<BE: Backend> LWESwitchingKeyEncrypt<BE> for Module<BE> impl<BE: Backend> LWESwitchingKeyEncrypt<BE> for Module<BE>
where where
Self: ModuleN + GLWESwitchingKeyEncryptSk<BE> + GLWESecretPreparedApi<BE> + VecZnxAutomorphismInplace<BE>, Self: ModuleN + GLWESwitchingKeyEncryptSk<BE> + GLWESecretPreparedFactory<BE> + VecZnxAutomorphismInplace<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn lwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize fn lwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -7,7 +7,7 @@ use poulpy_hal::{
use crate::{ use crate::{
GGLWEEncryptSk, ScratchTakeCore, GGLWEEncryptSk, ScratchTakeCore,
layouts::{ layouts::{
GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretPreparedApi, GLWESecretPreparedToRef, LWEInfos, LWESecret, GGLWE, GGLWEInfos, GGLWEToMut, GLWESecret, GLWESecretPreparedFactory, GLWESecretPreparedToRef, LWEInfos, LWESecret,
LWESecretToRef, LWEToGLWESwitchingKey, Rank, LWESecretToRef, LWEToGLWESwitchingKey, Rank,
}, },
}; };
@@ -65,7 +65,7 @@ where
Self: ModuleN Self: ModuleN
+ GGLWEEncryptSk<BE> + GGLWEEncryptSk<BE>
+ VecZnxAutomorphismInplace<BE> + VecZnxAutomorphismInplace<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplaceTmpBytes, + VecZnxAutomorphismInplaceTmpBytes,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {

View File

@@ -57,7 +57,7 @@ impl<D: Data, B: Backend> GGLWEInfos for GGLWEPrepared<D, B> {
} }
} }
pub trait GGLWEPreparedAlloc<BE: Backend> pub trait GGLWEPreparedFactory<BE: Backend>
where where
Self: GetDegree + VmpPMatAlloc<BE> + VmpPMatBytesOf + VmpPrepare<BE> + VmpPrepareTmpBytes, Self: GetDegree + VmpPMatAlloc<BE> + VmpPMatBytesOf + VmpPrepare<BE> + VmpPrepareTmpBytes,
{ {
@@ -178,7 +178,7 @@ where
} }
} }
impl<BE: Backend> GGLWEPreparedAlloc<BE> for Module<BE> where impl<BE: Backend> GGLWEPreparedFactory<BE> for Module<BE> where
Module<BE>: GetDegree + VmpPMatAlloc<BE> + VmpPMatBytesOf + VmpPrepare<BE> + VmpPrepareTmpBytes Module<BE>: GetDegree + VmpPMatAlloc<BE> + VmpPMatBytesOf + VmpPrepare<BE> + VmpPrepareTmpBytes
{ {
} }
@@ -187,7 +187,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GGLWEPreparedAlloc<B>, M: GGLWEPreparedFactory<B>,
{ {
module.alloc_gglwe_prepared_from_infos(infos) module.alloc_gglwe_prepared_from_infos(infos)
} }
@@ -202,7 +202,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
dsize: Dsize, dsize: Dsize,
) -> Self ) -> Self
where where
M: GGLWEPreparedAlloc<B>, M: GGLWEPreparedFactory<B>,
{ {
module.alloc_gglwe_prepared(base2k, k, rank_in, rank_out, dnum, dsize) module.alloc_gglwe_prepared(base2k, k, rank_in, rank_out, dnum, dsize)
} }
@@ -210,7 +210,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GGLWEPreparedAlloc<B>, M: GGLWEPreparedFactory<B>,
{ {
module.bytes_of_gglwe_prepared_from_infos(infos) module.bytes_of_gglwe_prepared_from_infos(infos)
} }
@@ -225,7 +225,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
dsize: Dsize, dsize: Dsize,
) -> usize ) -> usize
where where
M: GGLWEPreparedAlloc<B>, M: GGLWEPreparedFactory<B>,
{ {
module.bytes_of_gglwe_prepared(base2k, k, rank_in, rank_out, dnum, dsize) module.bytes_of_gglwe_prepared(base2k, k, rank_in, rank_out, dnum, dsize)
} }
@@ -235,7 +235,7 @@ impl<D: DataMut, B: Backend> GGLWEPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGLWEToRef, O: GGLWEToRef,
M: GGLWEPreparedAlloc<B>, M: GGLWEPreparedFactory<B>,
{ {
module.prepare_gglwe(self, other, scratch); module.prepare_gglwe(self, other, scratch);
} }
@@ -244,7 +244,7 @@ impl<D: DataMut, B: Backend> GGLWEPrepared<D, B> {
impl<B: Backend> GGLWEPrepared<Vec<u8>, B> { impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize
where where
M: GGLWEPreparedAlloc<B>, M: GGLWEPreparedFactory<B>,
{ {
module.prepare_gglwe_tmp_bytes(self) module.prepare_gglwe_tmp_bytes(self)
} }

View File

@@ -49,7 +49,7 @@ impl<D: Data, B: Backend> GGSWInfos for GGSWPrepared<D, B> {
} }
} }
pub trait GGSWPreparedAlloc<B: Backend> pub trait GGSWPreparedFactory<B: Backend>
where where
Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B>, Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B>,
{ {
@@ -162,7 +162,7 @@ where
} }
} }
impl<B: Backend> GGSWPreparedAlloc<B> for Module<B> where impl<B: Backend> GGSWPreparedFactory<B> for Module<B> where
Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B> Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B>
{ {
} }
@@ -171,14 +171,14 @@ impl<B: Backend> GGSWPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGSWInfos, A: GGSWInfos,
M: GGSWPreparedAlloc<B>, M: GGSWPreparedFactory<B>,
{ {
module.alloc_ggsw_prepared_from_infos(infos) module.alloc_ggsw_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self
where where
M: GGSWPreparedAlloc<B>, M: GGSWPreparedFactory<B>,
{ {
module.alloc_ggsw_prepared(base2k, k, dnum, dsize, rank) module.alloc_ggsw_prepared(base2k, k, dnum, dsize, rank)
} }
@@ -186,14 +186,14 @@ impl<B: Backend> GGSWPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGSWInfos, A: GGSWInfos,
M: GGSWPreparedAlloc<B>, M: GGSWPreparedFactory<B>,
{ {
module.bytes_of_ggsw_prepared_from_infos(infos) module.bytes_of_ggsw_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> usize
where where
M: GGSWPreparedAlloc<B>, M: GGSWPreparedFactory<B>,
{ {
module.bytes_of_ggsw_prepared(base2k, k, dnum, dsize, rank) module.bytes_of_ggsw_prepared(base2k, k, dnum, dsize, rank)
} }
@@ -209,7 +209,7 @@ impl<B: Backend> GGSWPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) -> usize pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) -> usize
where where
A: GGSWInfos, A: GGSWInfos,
M: GGSWPreparedAlloc<B>, M: GGSWPreparedFactory<B>,
{ {
module.ggsw_prepare_tmp_bytes(infos) module.ggsw_prepare_tmp_bytes(infos)
} }
@@ -219,7 +219,7 @@ impl<D: DataMut, B: Backend> GGSWPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGSWToRef, O: GGSWToRef,
M: GGSWPreparedAlloc<B>, M: GGSWPreparedFactory<B>,
{ {
module.ggsw_prepare(self, other, scratch); module.ggsw_prepare(self, other, scratch);
} }

View File

@@ -36,7 +36,7 @@ impl<D: Data, B: Backend> GLWEInfos for GLWEPrepared<D, B> {
} }
} }
pub trait GLWEPreparedAlloc<B: Backend> pub trait GLWEPreparedFactory<B: Backend>
where where
Self: GetDegree + VecZnxDftAlloc<B> + VecZnxDftBytesOf + VecZnxDftApply<B>, Self: GetDegree + VecZnxDftAlloc<B> + VecZnxDftBytesOf + VecZnxDftApply<B>,
{ {
@@ -88,20 +88,20 @@ where
} }
} }
impl<B: Backend> GLWEPreparedAlloc<B> for Module<B> where Self: VecZnxDftAlloc<B> + VecZnxDftBytesOf + VecZnxDftApply<B> {} impl<B: Backend> GLWEPreparedFactory<B> for Module<B> where Self: VecZnxDftAlloc<B> + VecZnxDftBytesOf + VecZnxDftApply<B> {}
impl<B: Backend> GLWEPrepared<Vec<u8>, B> { impl<B: Backend> GLWEPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GLWEInfos, A: GLWEInfos,
M: GLWEPreparedAlloc<B>, M: GLWEPreparedFactory<B>,
{ {
module.alloc_glwe_prepared_from_infos(infos) module.alloc_glwe_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self
where where
M: GLWEPreparedAlloc<B>, M: GLWEPreparedFactory<B>,
{ {
module.alloc_glwe_prepared(base2k, k, rank) module.alloc_glwe_prepared(base2k, k, rank)
} }
@@ -109,14 +109,14 @@ impl<B: Backend> GLWEPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GLWEInfos, A: GLWEInfos,
M: GLWEPreparedAlloc<B>, M: GLWEPreparedFactory<B>,
{ {
module.bytes_of_glwe_prepared_from_infos(infos) module.bytes_of_glwe_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize
where where
M: GLWEPreparedAlloc<B>, M: GLWEPreparedFactory<B>,
{ {
module.bytes_of_glwe_prepared(base2k, k, rank) module.bytes_of_glwe_prepared(base2k, k, rank)
} }
@@ -126,7 +126,7 @@ impl<D: DataMut, B: Backend> GLWEPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O) pub fn prepare<O, M>(&mut self, module: &M, other: &O)
where where
O: GLWEToRef, O: GLWEToRef,
M: GLWEPreparedAlloc<B>, M: GLWEPreparedFactory<B>,
{ {
module.prepare_glwe(self, other); module.prepare_glwe(self, other);
} }

View File

@@ -1,7 +1,7 @@
use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch};
use crate::layouts::{ 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, GGLWEToRef, GLWEInfos, GetGaloisElement, LWEInfos, Rank, SetGaloisElement, TorusPrecision,
}; };
@@ -65,9 +65,9 @@ impl<D: Data, B: Backend> GGLWEInfos for GLWEAutomorphismKeyPrepared<D, B> {
} }
} }
pub trait GLWEAutomorphismKeyPreparedApi<B: Backend> pub trait GLWEAutomorphismKeyPreparedFactory<B: Backend>
where where
Self: GGLWEPreparedAlloc<B>, Self: GGLWEPreparedFactory<B>,
{ {
fn alloc_automorphism_key_prepared( fn alloc_automorphism_key_prepared(
&self, &self,
@@ -147,20 +147,20 @@ where
} }
} }
impl<B: Backend> GLWEAutomorphismKeyPreparedApi<B> for Module<B> where Module<B>: GGLWEPreparedAlloc<B> {} impl<B: Backend> GLWEAutomorphismKeyPreparedFactory<B> for Module<B> where Module<B>: GGLWEPreparedFactory<B> {}
impl<B: Backend> GLWEAutomorphismKeyPrepared<Vec<u8>, B> { impl<B: Backend> GLWEAutomorphismKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWEAutomorphismKeyPreparedApi<B>, M: GLWEAutomorphismKeyPreparedFactory<B>,
{ {
module.alloc_automorphism_key_prepared_from_infos(infos) module.alloc_automorphism_key_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> Self
where where
M: GLWEAutomorphismKeyPreparedApi<B>, M: GLWEAutomorphismKeyPreparedFactory<B>,
{ {
module.alloc_automorphism_key_prepared(base2k, k, rank, dnum, dsize) module.alloc_automorphism_key_prepared(base2k, k, rank, dnum, dsize)
} }
@@ -168,14 +168,14 @@ impl<B: Backend> GLWEAutomorphismKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWEAutomorphismKeyPreparedApi<B>, M: GLWEAutomorphismKeyPreparedFactory<B>,
{ {
module.bytes_of_automorphism_key_prepared_from_infos(infos) module.bytes_of_automorphism_key_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> usize
where where
M: GLWEAutomorphismKeyPreparedApi<B>, M: GLWEAutomorphismKeyPreparedFactory<B>,
{ {
module.bytes_of_automorphism_key_prepared(base2k, k, rank, dnum, dsize) module.bytes_of_automorphism_key_prepared(base2k, k, rank, dnum, dsize)
} }
@@ -184,7 +184,7 @@ impl<B: Backend> GLWEAutomorphismKeyPrepared<Vec<u8>, B> {
impl<B: Backend> GLWEAutomorphismKeyPrepared<Vec<u8>, B> { impl<B: Backend> GLWEAutomorphismKeyPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize
where where
M: GLWEAutomorphismKeyPreparedApi<B>, M: GLWEAutomorphismKeyPreparedFactory<B>,
{ {
module.prepare_automorphism_key_tmp_bytes(self) module.prepare_automorphism_key_tmp_bytes(self)
} }
@@ -194,7 +194,7 @@ impl<D: DataMut, B: Backend> GLWEAutomorphismKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGLWEToRef + GetGaloisElement, O: GGLWEToRef + GetGaloisElement,
M: GLWEAutomorphismKeyPreparedApi<B>, M: GLWEAutomorphismKeyPreparedFactory<B>,
{ {
module.prepare_automorphism_key(self, other, scratch); module.prepare_automorphism_key(self, other, scratch);
} }

View File

@@ -7,7 +7,7 @@ use crate::{
GetDistribution, GetDistributionMut, GetDistribution, GetDistributionMut,
dist::Distribution, dist::Distribution,
layouts::{ layouts::{
Base2K, Degree, GLWEInfos, GLWEPrepared, GLWEPreparedAlloc, GLWEPreparedToMut, GLWEPreparedToRef, GLWEToRef, GetDegree, Base2K, Degree, GLWEInfos, GLWEPrepared, GLWEPreparedFactory, GLWEPreparedToMut, GLWEPreparedToRef, GLWEToRef, GetDegree,
LWEInfos, Rank, TorusPrecision, LWEInfos, Rank, TorusPrecision,
}, },
}; };
@@ -54,9 +54,9 @@ impl<D: Data, B: Backend> GLWEInfos for GLWEPublicKeyPrepared<D, B> {
} }
} }
pub trait GLWEPublicKeyPreparedAlloc<B: Backend> pub trait GLWEPublicKeyPreparedFactory<B: Backend>
where where
Self: GetDegree + GLWEPreparedAlloc<B>, Self: GetDegree + GLWEPreparedFactory<B>,
{ {
fn alloc_glwe_public_key_prepared(&self, base2k: Base2K, k: TorusPrecision, rank: Rank) -> GLWEPublicKeyPrepared<Vec<u8>, B> { fn alloc_glwe_public_key_prepared(&self, base2k: Base2K, k: TorusPrecision, rank: Rank) -> GLWEPublicKeyPrepared<Vec<u8>, B> {
GLWEPublicKeyPrepared { GLWEPublicKeyPrepared {
@@ -93,20 +93,20 @@ where
} }
} }
impl<B: Backend> GLWEPublicKeyPreparedAlloc<B> for Module<B> where Self: VecZnxDftAlloc<B> + VecZnxDftBytesOf + VecZnxDftApply<B> {} impl<B: Backend> GLWEPublicKeyPreparedFactory<B> for Module<B> where Self: VecZnxDftAlloc<B> + VecZnxDftBytesOf + VecZnxDftApply<B> {}
impl<B: Backend> GLWEPublicKeyPrepared<Vec<u8>, B> { impl<B: Backend> GLWEPublicKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GLWEInfos, A: GLWEInfos,
M: GLWEPublicKeyPreparedAlloc<B>, M: GLWEPublicKeyPreparedFactory<B>,
{ {
module.alloc_glwe_public_key_prepared_from_infos(infos) module.alloc_glwe_public_key_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self
where where
M: GLWEPublicKeyPreparedAlloc<B>, M: GLWEPublicKeyPreparedFactory<B>,
{ {
module.alloc_glwe_public_key_prepared(base2k, k, rank) module.alloc_glwe_public_key_prepared(base2k, k, rank)
} }
@@ -114,14 +114,14 @@ impl<B: Backend> GLWEPublicKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GLWEInfos, A: GLWEInfos,
M: GLWEPublicKeyPreparedAlloc<B>, M: GLWEPublicKeyPreparedFactory<B>,
{ {
module.bytes_of_glwe_public_key_prepared_from_infos(infos) module.bytes_of_glwe_public_key_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize
where where
M: GLWEPublicKeyPreparedAlloc<B>, M: GLWEPublicKeyPreparedFactory<B>,
{ {
module.bytes_of_glwe_public_key_prepared(base2k, k, rank) module.bytes_of_glwe_public_key_prepared(base2k, k, rank)
} }
@@ -131,7 +131,7 @@ impl<D: DataMut, B: Backend> GLWEPublicKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O) pub fn prepare<O, M>(&mut self, module: &M, other: &O)
where where
O: GLWEToRef + GetDistribution, O: GLWEToRef + GetDistribution,
M: GLWEPublicKeyPreparedAlloc<B>, M: GLWEPublicKeyPreparedFactory<B>,
{ {
module.prepare_glwe_public_key(self, other); module.prepare_glwe_public_key(self, other);
} }

View File

@@ -49,7 +49,7 @@ impl<D: Data, B: Backend> GLWEInfos for GLWESecretPrepared<D, B> {
} }
} }
pub trait GLWESecretPreparedApi<B: Backend> pub trait GLWESecretPreparedFactory<B: Backend>
where where
Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc<B> + SvpPrepare<B>, Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc<B> + SvpPrepare<B>,
{ {
@@ -96,20 +96,20 @@ where
} }
} }
impl<B: Backend> GLWESecretPreparedApi<B> for Module<B> where Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc<B> + SvpPrepare<B> {} impl<B: Backend> GLWESecretPreparedFactory<B> for Module<B> where Self: GetDegree + SvpPPolBytesOf + SvpPPolAlloc<B> + SvpPrepare<B> {}
impl<B: Backend> GLWESecretPrepared<Vec<u8>, B> { impl<B: Backend> GLWESecretPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GLWEInfos, A: GLWEInfos,
M: GLWESecretPreparedApi<B>, M: GLWESecretPreparedFactory<B>,
{ {
module.alloc_glwe_secret_prepared_from_infos(infos) module.alloc_glwe_secret_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, rank: Rank) -> Self pub fn alloc<M>(module: &M, rank: Rank) -> Self
where where
M: GLWESecretPreparedApi<B>, M: GLWESecretPreparedFactory<B>,
{ {
module.alloc_glwe_secret_prepared(rank) module.alloc_glwe_secret_prepared(rank)
} }
@@ -117,14 +117,14 @@ impl<B: Backend> GLWESecretPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GLWEInfos, A: GLWEInfos,
M: GLWESecretPreparedApi<B>, M: GLWESecretPreparedFactory<B>,
{ {
module.bytes_of_glwe_secret_prepared_from_infos(infos) module.bytes_of_glwe_secret_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, rank: Rank) -> usize pub fn bytes_of<M>(module: &M, rank: Rank) -> usize
where where
M: GLWESecretPreparedApi<B>, M: GLWESecretPreparedFactory<B>,
{ {
module.bytes_of_glwe_secret_prepared(rank) module.bytes_of_glwe_secret_prepared(rank)
} }
@@ -143,7 +143,7 @@ impl<D: Data, B: Backend> GLWESecretPrepared<D, B> {
impl<D: DataMut, B: Backend> GLWESecretPrepared<D, B> { impl<D: DataMut, B: Backend> GLWESecretPrepared<D, B> {
pub fn prepare<M, O>(&mut self, module: &M, other: &O) pub fn prepare<M, O>(&mut self, module: &M, other: &O)
where where
M: GLWESecretPreparedApi<B>, M: GLWESecretPreparedFactory<B>,
O: GLWESecretToRef + GetDistribution, O: GLWESecretToRef + GetDistribution,
{ {
module.prepare_glwe_secret(self, other); module.prepare_glwe_secret(self, other);

View File

@@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch};
use crate::layouts::{ use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEToRef, GLWEInfos, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEToRef, GLWEInfos, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut,
LWEInfos, Rank, TorusPrecision, LWEInfos, Rank, TorusPrecision,
prepared::{GGLWEPrepared, GGLWEPreparedAlloc, GGLWEPreparedToMut, GGLWEPreparedToRef}, prepared::{GGLWEPrepared, GGLWEPreparedFactory, GGLWEPreparedToMut, GGLWEPreparedToRef},
}; };
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
@@ -75,9 +75,9 @@ impl<D: Data, B: Backend> GGLWEInfos for GLWESwitchingKeyPrepared<D, B> {
} }
} }
pub trait GLWESwitchingKeyPreparedAlloc<B: Backend> pub trait GLWESwitchingKeyPreparedFactory<B: Backend>
where where
Self: GGLWEPreparedAlloc<B>, Self: GGLWEPreparedFactory<B>,
{ {
fn alloc_glwe_switching_key_prepared( fn alloc_glwe_switching_key_prepared(
&self, &self,
@@ -153,13 +153,13 @@ where
} }
} }
impl<B: Backend> GLWESwitchingKeyPreparedAlloc<B> for Module<B> where Self: GGLWEPreparedAlloc<B> {} impl<B: Backend> GLWESwitchingKeyPreparedFactory<B> for Module<B> where Self: GGLWEPreparedFactory<B> {}
impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> { impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWESwitchingKeyPreparedAlloc<B>, M: GLWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_glwe_switching_key_prepared_from_infos(infos) module.alloc_glwe_switching_key_prepared_from_infos(infos)
} }
@@ -174,7 +174,7 @@ impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
dsize: Dsize, dsize: Dsize,
) -> Self ) -> Self
where where
M: GLWESwitchingKeyPreparedAlloc<B>, M: GLWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_glwe_switching_key_prepared(base2k, k, rank_in, rank_out, dnum, dsize) module.alloc_glwe_switching_key_prepared(base2k, k, rank_in, rank_out, dnum, dsize)
} }
@@ -182,7 +182,7 @@ impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWESwitchingKeyPreparedAlloc<B>, M: GLWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_glwe_switching_key_prepared_from_infos(infos) module.bytes_of_glwe_switching_key_prepared_from_infos(infos)
} }
@@ -197,7 +197,7 @@ impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
dsize: Dsize, dsize: Dsize,
) -> usize ) -> usize
where where
M: GLWESwitchingKeyPreparedAlloc<B>, M: GLWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_glwe_switching_key_prepared(base2k, k, rank_in, rank_out, dnum, dsize) module.bytes_of_glwe_switching_key_prepared(base2k, k, rank_in, rank_out, dnum, dsize)
} }
@@ -207,7 +207,7 @@ impl<D: DataMut, B: Backend> GLWESwitchingKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGLWEToRef + GLWESwitchingKeyDegrees, O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: GLWESwitchingKeyPreparedAlloc<B>, M: GLWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_glwe_switching(self, other, scratch); module.prepare_glwe_switching(self, other, scratch);
} }
@@ -216,7 +216,7 @@ impl<D: DataMut, B: Backend> GLWESwitchingKeyPrepared<D, B> {
impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> { impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize
where where
M: GLWESwitchingKeyPreparedAlloc<B>, M: GLWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_glwe_switching_key_tmp_bytes(self) module.prepare_glwe_switching_key_tmp_bytes(self)
} }

View File

@@ -1,7 +1,7 @@
use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch}; use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch};
use crate::layouts::{ 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, GLWEInfos, LWEInfos, Rank, TensorKey, TensorKeyToRef, TorusPrecision,
}; };
@@ -52,9 +52,9 @@ impl<D: Data, B: Backend> GGLWEInfos for TensorKeyPrepared<D, B> {
} }
} }
pub trait TensorKeyPreparedAlloc<B: Backend> pub trait TensorKeyPreparedFactory<B: Backend>
where where
Self: GGLWEPreparedAlloc<B>, Self: GGLWEPreparedFactory<B>,
{ {
fn alloc_tensor_key_prepared( fn alloc_tensor_key_prepared(
&self, &self,
@@ -131,20 +131,20 @@ where
} }
} }
impl<B: Backend> TensorKeyPreparedAlloc<B> for Module<B> where Module<B>: GGLWEPreparedAlloc<B> {} impl<B: Backend> TensorKeyPreparedFactory<B> for Module<B> where Module<B>: GGLWEPreparedFactory<B> {}
impl<B: Backend> TensorKeyPrepared<Vec<u8>, B> { impl<B: Backend> TensorKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: TensorKeyPreparedAlloc<B>, M: TensorKeyPreparedFactory<B>,
{ {
module.alloc_tensor_key_prepared_from_infos(infos) module.alloc_tensor_key_prepared_from_infos(infos)
} }
pub fn alloc_with<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self pub fn alloc_with<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self
where where
M: TensorKeyPreparedAlloc<B>, M: TensorKeyPreparedFactory<B>,
{ {
module.alloc_tensor_key_prepared(base2k, k, dnum, dsize, rank) module.alloc_tensor_key_prepared(base2k, k, dnum, dsize, rank)
} }
@@ -152,14 +152,14 @@ impl<B: Backend> TensorKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: TensorKeyPreparedAlloc<B>, M: TensorKeyPreparedFactory<B>,
{ {
module.bytes_of_tensor_key_prepared_from_infos(infos) module.bytes_of_tensor_key_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank, dnum: Dnum, dsize: Dsize) -> usize
where where
M: TensorKeyPreparedAlloc<B>, M: TensorKeyPreparedFactory<B>,
{ {
module.bytes_of_tensor_key_prepared(base2k, k, rank, dnum, dsize) module.bytes_of_tensor_key_prepared(base2k, k, rank, dnum, dsize)
} }
@@ -191,7 +191,7 @@ impl<B: Backend> TensorKeyPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) -> usize pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: TensorKeyPreparedAlloc<B>, M: TensorKeyPreparedFactory<B>,
{ {
module.prepare_tensor_key_tmp_bytes(infos) module.prepare_tensor_key_tmp_bytes(infos)
} }
@@ -201,7 +201,7 @@ impl<D: DataMut, B: Backend> TensorKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: TensorKeyToRef, O: TensorKeyToRef,
M: TensorKeyPreparedAlloc<B>, M: TensorKeyPreparedFactory<B>,
{ {
module.prepare_tensor_key(self, other, scratch); module.prepare_tensor_key(self, other, scratch);
} }

View File

@@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch};
use crate::layouts::{ use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos,
GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision,
prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedAlloc}, prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedFactory},
}; };
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
@@ -51,9 +51,9 @@ impl<D: Data, B: Backend> GGLWEInfos for GLWEToLWESwitchingKeyPrepared<D, B> {
} }
} }
pub trait GLWEToLWESwitchingKeyPreparedAlloc<B: Backend> pub trait GLWEToLWESwitchingKeyPreparedFactory<B: Backend>
where where
Self: GLWESwitchingKeyPreparedAlloc<B>, Self: GLWESwitchingKeyPreparedFactory<B>,
{ {
fn alloc_glwe_to_lwe_switching_key_prepared( fn alloc_glwe_to_lwe_switching_key_prepared(
&self, &self,
@@ -118,20 +118,20 @@ where
} }
} }
impl<B: Backend> GLWEToLWESwitchingKeyPreparedAlloc<B> for Module<B> where Self: GLWESwitchingKeyPreparedAlloc<B> {} impl<B: Backend> GLWEToLWESwitchingKeyPreparedFactory<B> for Module<B> where Self: GLWESwitchingKeyPreparedFactory<B> {}
impl<B: Backend> GLWEToLWESwitchingKeyPrepared<Vec<u8>, B> { impl<B: Backend> GLWEToLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>, M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_glwe_to_lwe_switching_key_prepared_from_infos(infos) module.alloc_glwe_to_lwe_switching_key_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_in: Rank, dnum: Dnum) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_in: Rank, dnum: Dnum) -> Self
where where
M: GLWEToLWESwitchingKeyPreparedAlloc<B>, M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_glwe_to_lwe_switching_key_prepared(base2k, k, rank_in, dnum) module.alloc_glwe_to_lwe_switching_key_prepared(base2k, k, rank_in, dnum)
} }
@@ -139,14 +139,14 @@ impl<B: Backend> GLWEToLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>, M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_glwe_to_lwe_switching_key_prepared_from_infos(infos) module.bytes_of_glwe_to_lwe_switching_key_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_in: Rank, dnum: Dnum) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_in: Rank, dnum: Dnum) -> usize
where where
M: GLWEToLWESwitchingKeyPreparedAlloc<B>, M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_glwe_to_lwe_switching_key_prepared(base2k, k, rank_in, dnum) module.bytes_of_glwe_to_lwe_switching_key_prepared(base2k, k, rank_in, dnum)
} }
@@ -156,7 +156,7 @@ impl<B: Backend> GLWEToLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A)
where where
A: GGLWEInfos, A: GGLWEInfos,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>, M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_glwe_to_lwe_switching_key_tmp_bytes(infos); module.prepare_glwe_to_lwe_switching_key_tmp_bytes(infos);
} }
@@ -166,7 +166,7 @@ impl<D: DataMut, B: Backend> GLWEToLWESwitchingKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGLWEToRef + GLWESwitchingKeyDegrees, O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>, M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_glwe_to_lwe_switching_key(self, other, scratch); module.prepare_glwe_to_lwe_switching_key(self, other, scratch);
} }

View File

@@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch};
use crate::layouts::{ use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos,
GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision,
prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedAlloc}, prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedFactory},
}; };
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
@@ -50,9 +50,9 @@ impl<D: Data, B: Backend> GGLWEInfos for LWESwitchingKeyPrepared<D, B> {
} }
} }
pub trait LWESwitchingKeyPreparedAlloc<B: Backend> pub trait LWESwitchingKeyPreparedFactory<B: Backend>
where where
Self: GLWESwitchingKeyPreparedAlloc<B>, Self: GLWESwitchingKeyPreparedFactory<B>,
{ {
fn alloc_lwe_switching_key_prepared( fn alloc_lwe_switching_key_prepared(
&self, &self,
@@ -126,20 +126,20 @@ where
} }
} }
impl<B: Backend> LWESwitchingKeyPreparedAlloc<B> for Module<B> where Self: GLWESwitchingKeyPreparedAlloc<B> {} impl<B: Backend> LWESwitchingKeyPreparedFactory<B> for Module<B> where Self: GLWESwitchingKeyPreparedFactory<B> {}
impl<B: Backend> LWESwitchingKeyPrepared<Vec<u8>, B> { impl<B: Backend> LWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: LWESwitchingKeyPreparedAlloc<B>, M: LWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_lwe_switching_key_prepared_from_infos(infos) module.alloc_lwe_switching_key_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> Self
where where
M: LWESwitchingKeyPreparedAlloc<B>, M: LWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_lwe_switching_key_prepared(base2k, k, dnum) module.alloc_lwe_switching_key_prepared(base2k, k, dnum)
} }
@@ -147,14 +147,14 @@ impl<B: Backend> LWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: LWESwitchingKeyPreparedAlloc<B>, M: LWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_lwe_switching_key_prepared_from_infos(infos) module.bytes_of_lwe_switching_key_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> usize
where where
M: LWESwitchingKeyPreparedAlloc<B>, M: LWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_lwe_switching_key_prepared(base2k, k, dnum) module.bytes_of_lwe_switching_key_prepared(base2k, k, dnum)
} }
@@ -164,7 +164,7 @@ impl<B: Backend> LWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A)
where where
A: GGLWEInfos, A: GGLWEInfos,
M: LWESwitchingKeyPreparedAlloc<B>, M: LWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_lwe_switching_key_tmp_bytes(infos); module.prepare_lwe_switching_key_tmp_bytes(infos);
} }
@@ -174,7 +174,7 @@ impl<D: DataMut, B: Backend> LWESwitchingKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGLWEToRef + GLWESwitchingKeyDegrees, O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: LWESwitchingKeyPreparedAlloc<B>, M: LWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_lwe_switching_key(self, other, scratch); module.prepare_lwe_switching_key(self, other, scratch);
} }

View File

@@ -3,7 +3,7 @@ use poulpy_hal::layouts::{Backend, Data, DataMut, DataRef, Module, Scratch};
use crate::layouts::{ use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos, Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWEPrepared, GGLWEPreparedToMut, GGLWEPreparedToRef, GGLWEToRef, GLWEInfos,
GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision, GLWESwitchingKeyDegrees, GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision,
prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedAlloc}, prepared::{GLWESwitchingKeyPrepared, GLWESwitchingKeyPreparedFactory},
}; };
/// A special [GLWESwitchingKey] required to for the conversion from [LWE] to [GLWE]. /// A special [GLWESwitchingKey] required to for the conversion from [LWE] to [GLWE].
@@ -52,9 +52,9 @@ impl<D: Data, B: Backend> GGLWEInfos for LWEToGLWESwitchingKeyPrepared<D, B> {
} }
} }
pub trait LWEToGLWESwitchingKeyPreparedAlloc<B: Backend> pub trait LWEToGLWESwitchingKeyPreparedFactory<B: Backend>
where where
Self: GLWESwitchingKeyPreparedAlloc<B>, Self: GLWESwitchingKeyPreparedFactory<B>,
{ {
fn alloc_lwe_to_glwe_switching_key_prepared( fn alloc_lwe_to_glwe_switching_key_prepared(
&self, &self,
@@ -125,20 +125,20 @@ where
} }
} }
impl<B: Backend> LWEToGLWESwitchingKeyPreparedAlloc<B> for Module<B> where Self: GLWESwitchingKeyPreparedAlloc<B> {} impl<B: Backend> LWEToGLWESwitchingKeyPreparedFactory<B> for Module<B> where Self: GLWESwitchingKeyPreparedFactory<B> {}
impl<B: Backend> LWEToGLWESwitchingKeyPrepared<Vec<u8>, B> { impl<B: Backend> LWEToGLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where where
A: GGLWEInfos, A: GGLWEInfos,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>, M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_lwe_to_glwe_switching_key_prepared_from_infos(infos) module.alloc_lwe_to_glwe_switching_key_prepared_from_infos(infos)
} }
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_out: Rank, dnum: Dnum) -> Self pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_out: Rank, dnum: Dnum) -> Self
where where
M: LWEToGLWESwitchingKeyPreparedAlloc<B>, M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{ {
module.alloc_lwe_to_glwe_switching_key_prepared(base2k, k, rank_out, dnum) module.alloc_lwe_to_glwe_switching_key_prepared(base2k, k, rank_out, dnum)
} }
@@ -146,14 +146,14 @@ impl<B: Backend> LWEToGLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize pub fn bytes_of_from_infos<A, M>(module: &M, infos: &A) -> usize
where where
A: GGLWEInfos, A: GGLWEInfos,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>, M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_lwe_to_glwe_switching_key_prepared_from_infos(infos) module.bytes_of_lwe_to_glwe_switching_key_prepared_from_infos(infos)
} }
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_out: Rank, dnum: Dnum) -> usize pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank_out: Rank, dnum: Dnum) -> usize
where where
M: LWEToGLWESwitchingKeyPreparedAlloc<B>, M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{ {
module.bytes_of_lwe_to_glwe_switching_key_prepared(base2k, k, rank_out, dnum) module.bytes_of_lwe_to_glwe_switching_key_prepared(base2k, k, rank_out, dnum)
} }
@@ -163,7 +163,7 @@ impl<B: Backend> LWEToGLWESwitchingKeyPrepared<Vec<u8>, B> {
pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A) pub fn prepare_tmp_bytes<A, M>(&self, module: &M, infos: &A)
where where
A: GGLWEInfos, A: GGLWEInfos,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>, M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_lwe_to_glwe_switching_key_tmp_bytes(infos); module.prepare_lwe_to_glwe_switching_key_tmp_bytes(infos);
} }
@@ -173,7 +173,7 @@ impl<D: DataMut, B: Backend> LWEToGLWESwitchingKeyPrepared<D, B> {
pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>) pub fn prepare<O, M>(&mut self, module: &M, other: &O, scratch: &mut Scratch<B>)
where where
O: GGLWEToRef + GLWESwitchingKeyDegrees, O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>, M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{ {
module.prepare_lwe_to_glwe_switching_key(self, other, scratch); module.prepare_lwe_to_glwe_switching_key(self, other, scratch);
} }

View File

@@ -8,8 +8,8 @@ use crate::{
AutomorphismKeyEncryptSk, GLWEAutomorphismKeyAutomorphism, GLWEDecrypt, ScratchTakeCore, AutomorphismKeyEncryptSk, GLWEAutomorphismKeyAutomorphism, GLWEDecrypt, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
AutomorphismKey, AutomorphismKeyLayout, GGLWEInfos, GLWEAutomorphismKeyPreparedApi, GLWEPlaintext, GLWESecret, AutomorphismKey, AutomorphismKeyLayout, GGLWEInfos, GLWEAutomorphismKeyPreparedFactory, GLWEPlaintext, GLWESecret,
GLWESecretPreparedApi, GLWESecretPreparedFactory,
prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared},
}, },
noise::log2_std_noise_gglwe_product, noise::log2_std_noise_gglwe_product,
@@ -19,12 +19,12 @@ use crate::{
pub fn test_gglwe_automorphism_key_automorphism<BE: Backend>(module: &Module<BE>) pub fn test_gglwe_automorphism_key_automorphism<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: AutomorphismKeyEncryptSk<BE> Module<BE>: AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWEAutomorphismKeyAutomorphism<BE> + GLWEAutomorphismKeyAutomorphism<BE>
+ VecZnxAutomorphism + VecZnxAutomorphism
+ GaloisElement + GaloisElement
+ VecZnxSubScalarInplace + VecZnxSubScalarInplace
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWEDecrypt<BE>, + GLWEDecrypt<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -188,12 +188,12 @@ where
pub fn test_gglwe_automorphism_key_automorphism_inplace<BE: Backend>(module: &Module<BE>) pub fn test_gglwe_automorphism_key_automorphism_inplace<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: AutomorphismKeyEncryptSk<BE> Module<BE>: AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWEAutomorphismKeyAutomorphism<BE> + GLWEAutomorphismKeyAutomorphism<BE>
+ VecZnxAutomorphism + VecZnxAutomorphism
+ GaloisElement + GaloisElement
+ VecZnxSubScalarInplace + VecZnxSubScalarInplace
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWEDecrypt<BE>, + GLWEDecrypt<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -8,8 +8,8 @@ use crate::{
AutomorphismKeyEncryptSk, GGSWAutomorphism, GGSWEncryptSk, GGSWNoise, ScratchTakeCore, TensorKeyEncryptSk, AutomorphismKeyEncryptSk, GGSWAutomorphism, GGSWEncryptSk, GGSWNoise, ScratchTakeCore, TensorKeyEncryptSk,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
AutomorphismKey, GGSW, GGSWLayout, GLWEAutomorphismKeyPreparedApi, GLWESecret, GLWESecretPreparedApi, TensorKey, AutomorphismKey, GGSW, GGSWLayout, GLWEAutomorphismKeyPreparedFactory, GLWESecret, GLWESecretPreparedFactory, TensorKey,
TensorKeyLayout, TensorKeyPreparedAlloc, TensorKeyLayout, TensorKeyPreparedFactory,
prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared, TensorKeyPrepared}, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared, TensorKeyPrepared},
}, },
noise::noise_ggsw_keyswitch, noise::noise_ggsw_keyswitch,
@@ -19,11 +19,11 @@ pub fn test_ggsw_automorphism<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGSWEncryptSk<BE> Module<BE>: GGSWEncryptSk<BE>
+ AutomorphismKeyEncryptSk<BE> + AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GGSWAutomorphism<BE> + GGSWAutomorphism<BE>
+ TensorKeyPreparedAlloc<BE> + TensorKeyPreparedFactory<BE>
+ TensorKeyEncryptSk<BE> + TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplace<BE> + VecZnxAutomorphismInplace<BE>
+ GGSWNoise<BE>, + GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
@@ -178,11 +178,11 @@ pub fn test_ggsw_automorphism_inplace<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGSWEncryptSk<BE> Module<BE>: GGSWEncryptSk<BE>
+ AutomorphismKeyEncryptSk<BE> + AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GGSWAutomorphism<BE> + GGSWAutomorphism<BE>
+ TensorKeyPreparedAlloc<BE> + TensorKeyPreparedFactory<BE>
+ TensorKeyEncryptSk<BE> + TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplace<BE> + VecZnxAutomorphismInplace<BE>
+ GGSWNoise<BE>, + GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -8,8 +8,8 @@ use crate::{
AutomorphismKeyEncryptSk, GLWEAutomorphism, GLWEDecrypt, GLWEEncryptSk, GLWENoise, ScratchTakeCore, AutomorphismKeyEncryptSk, GLWEAutomorphism, GLWEDecrypt, GLWEEncryptSk, GLWENoise, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedApi, GLWELayout, GLWEPlaintext, GLWESecret, AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedFactory, GLWELayout, GLWEPlaintext, GLWESecret,
GLWESecretPreparedApi, GLWESecretPreparedFactory,
prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared},
}, },
noise::log2_std_noise_gglwe_product, noise::log2_std_noise_gglwe_product,
@@ -18,12 +18,12 @@ use crate::{
pub fn test_glwe_automorphism<BE: Backend>(module: &Module<BE>) pub fn test_glwe_automorphism<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWEEncryptSk<BE> Module<BE>: GLWEEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWEAutomorphism<BE> + GLWEAutomorphism<BE>
+ AutomorphismKeyEncryptSk<BE> + AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWENoise<BE> + GLWENoise<BE>
+ VecZnxAutomorphismInplace<BE>, + VecZnxAutomorphismInplace<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
@@ -136,12 +136,12 @@ where
pub fn test_glwe_automorphism_inplace<BE: Backend>(module: &Module<BE>) pub fn test_glwe_automorphism_inplace<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWEEncryptSk<BE> Module<BE>: GLWEEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWEAutomorphism<BE> + GLWEAutomorphism<BE>
+ AutomorphismKeyEncryptSk<BE> + AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWENoise<BE> + GLWENoise<BE>
+ VecZnxAutomorphismInplace<BE>, + VecZnxAutomorphismInplace<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -8,9 +8,9 @@ use crate::{
GLWEDecrypt, GLWEEncryptSk, GLWEFromLWE, GLWEToLWESwitchingKeyEncryptSk, LWEDecrypt, LWEEncryptSk, GLWEDecrypt, GLWEEncryptSk, GLWEFromLWE, GLWEToLWESwitchingKeyEncryptSk, LWEDecrypt, LWEEncryptSk,
LWEToGLWESwitchingKeyEncryptSk, ScratchTakeCore, LWEToGLWESwitchingKeyEncryptSk, ScratchTakeCore,
layouts::{ layouts::{
Base2K, Degree, Dnum, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GLWEToLWEKeyLayout, Base2K, Degree, Dnum, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, GLWEToLWEKeyLayout,
GLWEToLWESwitchingKey, GLWEToLWESwitchingKeyPreparedAlloc, LWE, LWELayout, LWEPlaintext, LWESecret, GLWEToLWESwitchingKey, GLWEToLWESwitchingKeyPreparedFactory, LWE, LWELayout, LWEPlaintext, LWESecret,
LWEToGLWESwitchingKey, LWEToGLWESwitchingKeyLayout, LWEToGLWESwitchingKeyPreparedAlloc, Rank, TorusPrecision, LWEToGLWESwitchingKey, LWEToGLWESwitchingKeyLayout, LWEToGLWESwitchingKeyPreparedFactory, Rank, TorusPrecision,
prepared::{GLWESecretPrepared, GLWEToLWESwitchingKeyPrepared, LWEToGLWESwitchingKeyPrepared}, prepared::{GLWESecretPrepared, GLWEToLWESwitchingKeyPrepared, LWEToGLWESwitchingKeyPrepared},
}, },
}; };
@@ -20,9 +20,9 @@ where
Module<BE>: GLWEFromLWE<BE> Module<BE>: GLWEFromLWE<BE>
+ LWEToGLWESwitchingKeyEncryptSk<BE> + LWEToGLWESwitchingKeyEncryptSk<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ LWEEncryptSk<BE> + LWEEncryptSk<BE>
+ LWEToGLWESwitchingKeyPreparedAlloc<BE>, + LWEToGLWESwitchingKeyPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {
@@ -112,9 +112,9 @@ where
+ GLWEEncryptSk<BE> + GLWEEncryptSk<BE>
+ LWEDecrypt<BE> + LWEDecrypt<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWEToLWESwitchingKeyEncryptSk<BE> + GLWEToLWESwitchingKeyEncryptSk<BE>
+ GLWEToLWESwitchingKeyPreparedAlloc<BE>, + GLWEToLWESwitchingKeyPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {

View File

@@ -9,7 +9,7 @@ use crate::{
GLWESwitchingKeyEncryptSk, ScratchTakeCore, GLWESwitchingKeyEncryptSk, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
AutomorphismKey, AutomorphismKeyDecompress, AutomorphismKeyLayout, GLWEInfos, GLWESecret, GLWESecretPreparedApi, AutomorphismKey, AutomorphismKeyDecompress, AutomorphismKeyLayout, GLWEInfos, GLWESecret, GLWESecretPreparedFactory,
GLWESwitchingKeyDecompress, compressed::GLWEAutomorphismKeyCompressed, prepared::GLWESecretPrepared, GLWESwitchingKeyDecompress, compressed::GLWEAutomorphismKeyCompressed, prepared::GLWESecretPrepared,
}, },
noise::GGLWENoise, noise::GGLWENoise,
@@ -19,7 +19,7 @@ pub fn test_gglwe_automorphism_key_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: AutomorphismKeyEncryptSk<BE> Module<BE>: AutomorphismKeyEncryptSk<BE>
+ GGLWEKeyswitch<BE> + GGLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWESwitchingKeyCompressedEncryptSk<BE> + GLWESwitchingKeyCompressedEncryptSk<BE>
+ GLWESwitchingKeyDecompress + GLWESwitchingKeyDecompress
@@ -91,7 +91,7 @@ pub fn test_gglwe_automorphism_key_compressed_encrypt_sk<BE: Backend>(module: &M
where where
Module<BE>: AutomorphismKeyCompressedEncryptSk<BE> Module<BE>: AutomorphismKeyCompressedEncryptSk<BE>
+ GGLWEKeyswitch<BE> + GGLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWESwitchingKeyCompressedEncryptSk<BE> + GLWESwitchingKeyCompressedEncryptSk<BE>
+ AutomorphismKeyDecompress + AutomorphismKeyDecompress

View File

@@ -9,8 +9,8 @@ use crate::{
decryption::GLWEDecrypt, decryption::GLWEDecrypt,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GGLWELayout, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyCompressed, GLWESwitchingKeyDecompress, GGLWELayout, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyCompressed, GLWESwitchingKeyDecompress,
prepared::{GGLWEPreparedAlloc, GLWESecretPrepared}, prepared::{GGLWEPreparedFactory, GLWESecretPrepared},
}, },
noise::GGLWENoise, noise::GGLWENoise,
}; };
@@ -18,10 +18,10 @@ use crate::{
pub fn test_gglwe_switching_key_encrypt_sk<BE: Backend>(module: &Module<BE>) pub fn test_gglwe_switching_key_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGLWEEncryptSk<BE> Module<BE>: GGLWEEncryptSk<BE>
+ GGLWEPreparedAlloc<BE> + GGLWEPreparedFactory<BE>
+ GGLWEKeyswitch<BE> + GGLWEKeyswitch<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GGLWENoise<BE>, + GGLWENoise<BE>,
@@ -83,10 +83,10 @@ where
pub fn test_gglwe_switching_key_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>) pub fn test_gglwe_switching_key_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGLWEEncryptSk<BE> Module<BE>: GGLWEEncryptSk<BE>
+ GGLWEPreparedAlloc<BE> + GGLWEPreparedFactory<BE>
+ GGLWEKeyswitch<BE> + GGLWEKeyswitch<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWESwitchingKeyCompressedEncryptSk<BE> + GLWESwitchingKeyCompressedEncryptSk<BE>
+ GLWESwitchingKeyDecompress + GLWESwitchingKeyDecompress

View File

@@ -8,7 +8,7 @@ use crate::{
GGSWCompressedEncryptSk, GGSWEncryptSk, GGSWNoise, ScratchTakeCore, GGSWCompressedEncryptSk, GGSWEncryptSk, GGSWNoise, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GGSW, GGSWDecompress, GGSWLayout, GLWESecret, GLWESecretPreparedApi, compressed::GGSWCompressed, GGSW, GGSWDecompress, GGSWLayout, GLWESecret, GLWESecretPreparedFactory, compressed::GGSWCompressed,
prepared::GLWESecretPrepared, prepared::GLWESecretPrepared,
}, },
}; };
@@ -17,7 +17,7 @@ pub fn test_ggsw_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
Module<BE>: GGSWEncryptSk<BE> + GLWESecretPreparedApi<BE> + GGSWNoise<BE>, Module<BE>: GGSWEncryptSk<BE> + GLWESecretPreparedFactory<BE> + GGSWNoise<BE>,
{ {
let base2k: usize = 12; let base2k: usize = 12;
let k: usize = 54; let k: usize = 54;
@@ -74,7 +74,7 @@ pub fn test_ggsw_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
Module<BE>: GGSWCompressedEncryptSk<BE> + GLWESecretPreparedApi<BE> + GGSWNoise<BE> + GGSWDecompress, Module<BE>: GGSWCompressedEncryptSk<BE> + GLWESecretPreparedFactory<BE> + GGSWNoise<BE> + GGSWDecompress,
{ {
let base2k: usize = 12; let base2k: usize = 12;
let k: usize = 54; let k: usize = 54;

View File

@@ -9,8 +9,8 @@ use crate::{
decryption::GLWEDecrypt, decryption::GLWEDecrypt,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GLWE, GLWELayout, GLWEPlaintext, GLWEPlaintextLayout, GLWEPublicKey, GLWEPublicKeyPreparedAlloc, GLWESecret, GLWE, GLWELayout, GLWEPlaintext, GLWEPlaintextLayout, GLWEPublicKey, GLWEPublicKeyPreparedFactory, GLWESecret,
GLWESecretPreparedApi, LWEInfos, GLWESecretPreparedFactory, LWEInfos,
compressed::GLWECompressed, compressed::GLWECompressed,
prepared::{GLWEPublicKeyPrepared, GLWESecretPrepared}, prepared::{GLWEPublicKeyPrepared, GLWESecretPrepared},
}, },
@@ -18,7 +18,7 @@ use crate::{
pub fn test_glwe_encrypt_sk<BE: Backend>(module: &Module<BE>) pub fn test_glwe_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWEEncryptSk<BE> + GLWEDecrypt<BE> + GLWESecretPreparedApi<BE> + VecZnxFillUniform + GLWESub, Module<BE>: GLWEEncryptSk<BE> + GLWEDecrypt<BE> + GLWESecretPreparedFactory<BE> + VecZnxFillUniform + GLWESub,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {
@@ -83,7 +83,7 @@ where
pub fn test_glwe_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>) pub fn test_glwe_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWECompressedEncryptSk<BE> + GLWEDecrypt<BE> + GLWESecretPreparedApi<BE> + VecZnxFillUniform + GLWESub, Module<BE>: GLWECompressedEncryptSk<BE> + GLWEDecrypt<BE> + GLWESecretPreparedFactory<BE> + VecZnxFillUniform + GLWESub,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {
@@ -160,7 +160,7 @@ where
pub fn test_glwe_encrypt_zero_sk<BE: Backend>(module: &Module<BE>) pub fn test_glwe_encrypt_zero_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWEEncryptSk<BE> + GLWEDecrypt<BE> + GLWESecretPreparedApi<BE> + VecZnxFillUniform + GLWESub, Module<BE>: GLWEEncryptSk<BE> + GLWEDecrypt<BE> + GLWESecretPreparedFactory<BE> + VecZnxFillUniform + GLWESub,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {
@@ -210,10 +210,10 @@ where
pub fn test_glwe_encrypt_pk<BE: Backend>(module: &Module<BE>) pub fn test_glwe_encrypt_pk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWEEncryptPk<BE> Module<BE>: GLWEEncryptPk<BE>
+ GLWEPublicKeyPreparedAlloc<BE> + GLWEPublicKeyPreparedFactory<BE>
+ GLWEPublicKeyGenerate<BE> + GLWEPublicKeyGenerate<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GLWESub, + GLWESub,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -13,7 +13,7 @@ use crate::{
decryption::GLWEDecrypt, decryption::GLWEDecrypt,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
Dsize, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GLWETensorKeyCompressed, TensorKey, TensorKeyLayout, Dsize, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, GLWETensorKeyCompressed, TensorKey, TensorKeyLayout,
prepared::GLWESecretPrepared, prepared::GLWESecretPrepared,
}, },
}; };
@@ -21,7 +21,7 @@ use crate::{
pub fn test_gglwe_tensor_key_encrypt_sk<BE: Backend>(module: &Module<BE>) pub fn test_gglwe_tensor_key_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: TensorKeyEncryptSk<BE> Module<BE>: TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ VecZnxDftAlloc<BE> + VecZnxDftAlloc<BE>
+ VecZnxBigAlloc<BE> + VecZnxBigAlloc<BE>
@@ -112,7 +112,7 @@ where
pub fn test_gglwe_tensor_key_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>) pub fn test_gglwe_tensor_key_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: TensorKeyEncryptSk<BE> Module<BE>: TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GGLWETensorKeyCompressedEncryptSk<BE> + GGLWETensorKeyCompressedEncryptSk<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ VecZnxDftAlloc<BE> + VecZnxDftAlloc<BE>

View File

@@ -8,7 +8,7 @@ use crate::{
GGLWEExternalProduct, GGLWENoise, GGSWEncryptSk, GLWESwitchingKeyEncryptSk, ScratchTakeCore, GGLWEExternalProduct, GGLWENoise, GGSWEncryptSk, GLWESwitchingKeyEncryptSk, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GGSW, GGSWLayout, GGSWPreparedAlloc, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, GGSW, GGSWLayout, GGSWPreparedFactory, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout,
prepared::{GGSWPrepared, GLWESecretPrepared}, prepared::{GGSWPrepared, GLWESecretPrepared},
}, },
noise::noise_ggsw_product, noise::noise_ggsw_product,
@@ -20,9 +20,9 @@ where
Module<BE>: GGLWEExternalProduct<BE> Module<BE>: GGLWEExternalProduct<BE>
+ GGSWEncryptSk<BE> + GGSWEncryptSk<BE>
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxRotateInplace<BE> + VecZnxRotateInplace<BE>
+ GGSWPreparedAlloc<BE> + GGSWPreparedFactory<BE>
+ GGLWENoise<BE>, + GGLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -169,9 +169,9 @@ where
Module<BE>: GGLWEExternalProduct<BE> Module<BE>: GGLWEExternalProduct<BE>
+ GGSWEncryptSk<BE> + GGSWEncryptSk<BE>
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxRotateInplace<BE> + VecZnxRotateInplace<BE>
+ GGSWPreparedAlloc<BE> + GGSWPreparedFactory<BE>
+ GGLWENoise<BE>, + GGLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -8,7 +8,7 @@ use crate::{
GGSWEncryptSk, GGSWExternalProduct, GGSWNoise, ScratchTakeCore, GGSWEncryptSk, GGSWExternalProduct, GGSWNoise, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GGSW, GGSWLayout, GGSWPreparedAlloc, GLWESecret, GLWESecretPreparedApi, GGSW, GGSWLayout, GGSWPreparedFactory, GLWESecret, GLWESecretPreparedFactory,
prepared::{GGSWPrepared, GLWESecretPrepared}, prepared::{GGSWPrepared, GLWESecretPrepared},
}, },
noise::noise_ggsw_product, noise::noise_ggsw_product,
@@ -19,8 +19,8 @@ pub fn test_ggsw_external_product<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGSWEncryptSk<BE> Module<BE>: GGSWEncryptSk<BE>
+ GGSWExternalProduct<BE> + GGSWExternalProduct<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GGSWPreparedAlloc<BE> + GGSWPreparedFactory<BE>
+ VecZnxRotateInplace<BE> + VecZnxRotateInplace<BE>
+ GGSWNoise<BE>, + GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
@@ -153,8 +153,8 @@ pub fn test_ggsw_external_product_inplace<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGSWEncryptSk<BE> Module<BE>: GGSWEncryptSk<BE>
+ GGSWExternalProduct<BE> + GGSWExternalProduct<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GGSWPreparedAlloc<BE> + GGSWPreparedFactory<BE>
+ VecZnxRotateInplace<BE> + VecZnxRotateInplace<BE>
+ GGSWNoise<BE>, + GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -8,7 +8,7 @@ use crate::{
GGSWEncryptSk, GLWEEncryptSk, GLWEExternalProduct, GLWENoise, ScratchTakeCore, GGSWEncryptSk, GLWEEncryptSk, GLWEExternalProduct, GLWENoise, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GGSW, GGSWLayout, GGSWPreparedAlloc, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GGSW, GGSWLayout, GGSWPreparedFactory, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory,
prepared::{GGSWPrepared, GLWESecretPrepared}, prepared::{GGSWPrepared, GLWESecretPrepared},
}, },
noise::noise_ggsw_product, noise::noise_ggsw_product,
@@ -18,13 +18,13 @@ use crate::{
pub fn test_glwe_external_product<BE: Backend>(module: &Module<BE>) pub fn test_glwe_external_product<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGSWEncryptSk<BE> Module<BE>: GGSWEncryptSk<BE>
+ GGSWPreparedAlloc<BE> + GGSWPreparedFactory<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GLWEExternalProduct<BE> + GLWEExternalProduct<BE>
+ GLWEEncryptSk<BE> + GLWEEncryptSk<BE>
+ GLWENoise<BE> + GLWENoise<BE>
+ VecZnxRotateInplace<BE> + VecZnxRotateInplace<BE>
+ GLWESecretPreparedApi<BE>, + GLWESecretPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {
@@ -148,13 +148,13 @@ where
pub fn test_glwe_external_product_inplace<BE: Backend>(module: &Module<BE>) pub fn test_glwe_external_product_inplace<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GGSWEncryptSk<BE> Module<BE>: GGSWEncryptSk<BE>
+ GGSWPreparedAlloc<BE> + GGSWPreparedFactory<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GLWEExternalProduct<BE> + GLWEExternalProduct<BE>
+ GLWEEncryptSk<BE> + GLWEEncryptSk<BE>
+ GLWENoise<BE> + GLWENoise<BE>
+ VecZnxRotateInplace<BE> + VecZnxRotateInplace<BE>
+ GLWESecretPreparedApi<BE>, + GLWESecretPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {

View File

@@ -8,7 +8,7 @@ use crate::{
GGLWEKeyswitch, GGLWENoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, GGLWEKeyswitch, GGLWENoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, GLWESwitchingKeyPreparedAlloc, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout, GLWESwitchingKeyPreparedFactory,
prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared}, prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared},
}, },
noise::log2_std_noise_gglwe_product, noise::log2_std_noise_gglwe_product,
@@ -18,8 +18,8 @@ pub fn test_gglwe_switching_key_keyswitch<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWESwitchingKeyEncryptSk<BE> Module<BE>: GLWESwitchingKeyEncryptSk<BE>
+ GGLWEKeyswitch<BE> + GGLWEKeyswitch<BE>
+ GLWESwitchingKeyPreparedAlloc<BE> + GLWESwitchingKeyPreparedFactory<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GGLWENoise<BE>, + GGLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -162,9 +162,9 @@ pub fn test_gglwe_switching_key_keyswitch_inplace<BE: Backend>(module: &Module<B
where where
Module<BE>: GLWESwitchingKeyEncryptSk<BE> Module<BE>: GLWESwitchingKeyEncryptSk<BE>
+ GGLWEKeyswitch<BE> + GGLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GGLWENoise<BE> + GGLWENoise<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>, + GLWESwitchingKeyPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {

View File

@@ -8,8 +8,8 @@ use crate::{
GGSWEncryptSk, GGSWKeyswitch, GGSWNoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, TensorKeyEncryptSk, GGSWEncryptSk, GGSWKeyswitch, GGSWNoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, TensorKeyEncryptSk,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GGSW, GGSWLayout, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, GGSW, GGSWLayout, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout,
GLWESwitchingKeyPreparedAlloc, TensorKey, TensorKeyLayout, TensorKeyPreparedAlloc, GLWESwitchingKeyPreparedFactory, TensorKey, TensorKeyLayout, TensorKeyPreparedFactory,
prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared, TensorKeyPrepared}, prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared, TensorKeyPrepared},
}, },
noise::noise_ggsw_keyswitch, noise::noise_ggsw_keyswitch,
@@ -22,9 +22,9 @@ where
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ TensorKeyEncryptSk<BE> + TensorKeyEncryptSk<BE>
+ GGSWKeyswitch<BE> + GGSWKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ TensorKeyPreparedAlloc<BE> + TensorKeyPreparedFactory<BE>
+ GLWESwitchingKeyPreparedAlloc<BE> + GLWESwitchingKeyPreparedFactory<BE>
+ GGSWNoise<BE>, + GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -187,9 +187,9 @@ where
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ TensorKeyEncryptSk<BE> + TensorKeyEncryptSk<BE>
+ GGSWKeyswitch<BE> + GGSWKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ TensorKeyPreparedAlloc<BE> + TensorKeyPreparedFactory<BE>
+ GLWESwitchingKeyPreparedAlloc<BE> + GLWESwitchingKeyPreparedFactory<BE>
+ GGSWNoise<BE>, + GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -8,8 +8,8 @@ use crate::{
GLWEEncryptSk, GLWEKeyswitch, GLWENoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore, GLWEEncryptSk, GLWEKeyswitch, GLWENoise, GLWESwitchingKeyEncryptSk, ScratchTakeCore,
encryption::SIGMA, encryption::SIGMA,
layouts::{ layouts::{
GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedApi, GLWESwitchingKey, GLWESwitchingKeyLayout, GLWE, GLWELayout, GLWEPlaintext, GLWESecret, GLWESecretPreparedFactory, GLWESwitchingKey, GLWESwitchingKeyLayout,
GLWESwitchingKeyPreparedAlloc, GLWESwitchingKeyPreparedFactory,
prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared}, prepared::{GLWESecretPrepared, GLWESwitchingKeyPrepared},
}, },
noise::log2_std_noise_gglwe_product, noise::log2_std_noise_gglwe_product,
@@ -22,8 +22,8 @@ where
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWEEncryptSk<BE> + GLWEEncryptSk<BE>
+ GLWEKeyswitch<BE> + GLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyPreparedAlloc<BE> + GLWESwitchingKeyPreparedFactory<BE>
+ GLWENoise<BE>, + GLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -143,8 +143,8 @@ where
+ GLWESwitchingKeyEncryptSk<BE> + GLWESwitchingKeyEncryptSk<BE>
+ GLWEEncryptSk<BE> + GLWEEncryptSk<BE>
+ GLWEKeyswitch<BE> + GLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyPreparedAlloc<BE> + GLWESwitchingKeyPreparedFactory<BE>
+ GLWENoise<BE>, + GLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -7,7 +7,7 @@ use poulpy_hal::{
use crate::{ use crate::{
LWEDecrypt, LWEEncryptSk, LWEKeySwitch, LWESwitchingKeyEncrypt, ScratchTakeCore, LWEDecrypt, LWEEncryptSk, LWEKeySwitch, LWESwitchingKeyEncrypt, ScratchTakeCore,
layouts::{ layouts::{
LWE, LWELayout, LWEPlaintext, LWESecret, LWESwitchingKey, LWESwitchingKeyLayout, LWESwitchingKeyPreparedAlloc, LWE, LWELayout, LWEPlaintext, LWESecret, LWESwitchingKey, LWESwitchingKeyLayout, LWESwitchingKeyPreparedFactory,
prepared::LWESwitchingKeyPrepared, prepared::LWESwitchingKeyPrepared,
}, },
}; };
@@ -15,7 +15,7 @@ use crate::{
pub fn test_lwe_keyswitch<BE: Backend>(module: &Module<BE>) pub fn test_lwe_keyswitch<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: Module<BE>:
LWEKeySwitch<BE> + LWESwitchingKeyEncrypt<BE> + LWEEncryptSk<BE> + LWESwitchingKeyPreparedAlloc<BE> + LWEDecrypt<BE>, LWEKeySwitch<BE> + LWESwitchingKeyEncrypt<BE> + LWEEncryptSk<BE> + LWESwitchingKeyPreparedFactory<BE> + LWEDecrypt<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>, Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{ {

View File

@@ -9,8 +9,8 @@ use poulpy_hal::{
use crate::{ use crate::{
AutomorphismKeyEncryptSk, GLWEDecrypt, GLWEEncryptSk, GLWEPacker, GLWEPacking, GLWERotate, GLWESub, ScratchTakeCore, AutomorphismKeyEncryptSk, GLWEDecrypt, GLWEEncryptSk, GLWEPacker, GLWEPacking, GLWERotate, GLWESub, ScratchTakeCore,
layouts::{ layouts::{
AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedApi, GLWELayout, GLWEPlaintext, GLWESecret, AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedFactory, GLWELayout, GLWEPlaintext, GLWESecret,
GLWESecretPreparedApi, GLWESecretPreparedFactory,
prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared},
}, },
}; };
@@ -19,9 +19,9 @@ pub fn test_glwe_packing<BE: Backend>(module: &Module<BE>)
where where
Module<BE>: GLWEEncryptSk<BE> Module<BE>: GLWEEncryptSk<BE>
+ AutomorphismKeyEncryptSk<BE> + AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWEPacking<BE> + GLWEPacking<BE>
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ GLWESub + GLWESub
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ GLWERotate<BE>, + GLWERotate<BE>,

View File

@@ -11,8 +11,8 @@ use crate::{
encryption::SIGMA, encryption::SIGMA,
glwe_trace::GLWETrace, glwe_trace::GLWETrace,
layouts::{ layouts::{
AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedApi, GLWELayout, GLWEPlaintext, GLWESecret, AutomorphismKey, AutomorphismKeyLayout, GLWE, GLWEAutomorphismKeyPreparedFactory, GLWELayout, GLWEPlaintext, GLWESecret,
GLWESecretPreparedApi, LWEInfos, GLWESecretPreparedFactory, LWEInfos,
prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared}, prepared::{GLWEAutomorphismKeyPrepared, GLWESecretPrepared},
}, },
noise::var_noise_gglwe_product, noise::var_noise_gglwe_product,
@@ -24,9 +24,9 @@ where
+ GLWEEncryptSk<BE> + GLWEEncryptSk<BE>
+ GLWEDecrypt<BE> + GLWEDecrypt<BE>
+ AutomorphismKeyEncryptSk<BE> + AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE> + GLWEAutomorphismKeyPreparedFactory<BE>
+ VecZnxFillUniform + VecZnxFillUniform
+ GLWESecretPreparedApi<BE> + GLWESecretPreparedFactory<BE>
+ VecZnxSubInplace + VecZnxSubInplace
+ VecZnxNormalizeInplace<BE>, + VecZnxNormalizeInplace<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>, ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,