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,
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<BE: Backend> {
impl<BE: Backend> AutomorphismKeyCompressedEncryptSk<BE> for Module<BE>
where
Self: ModuleN + GaloisElement + VecZnxAutomorphism + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedApi<BE>,
Self: ModuleN + GaloisElement + VecZnxAutomorphism + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedFactory<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
{
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,
GLWESwitchingKeyDegreesMut, LWEInfos,
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>
where
Self: ModuleN + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedApi<BE> + VecZnxSwitchRing,
Self: ModuleN + GGLWECompressedEncryptSk<BE> + GLWESecretPreparedFactory<BE> + VecZnxSwitchRing,
Scratch<BE>: ScratchTakeCore<BE>,
{
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::{
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<BE>,
+ GLWESecretPreparedFactory<BE>,
Scratch<BE>: ScratchTakeBasic + ScratchTakeCore<BE>,
{
fn tensor_key_compressed_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -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<BE: Backend> {
impl<BE: Backend> AutomorphismKeyEncryptSk<BE> for Module<BE>
where
Self: GGLWEEncryptSk<BE> + VecZnxAutomorphism + GaloisElement + SvpPPolBytesOf + GLWESecretPreparedApi<BE>,
Self: GGLWEEncryptSk<BE> + VecZnxAutomorphism + GaloisElement + SvpPPolBytesOf + GLWESecretPreparedFactory<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
{
fn automorphism_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -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<BE: Backend> {
impl<BE: Backend> GLWESwitchingKeyEncryptSk<BE> for Module<BE>
where
Self: ModuleN + GGLWEEncryptSk<BE> + GLWESecretPreparedApi<BE> + VecZnxSwitchRing + SvpPrepare<BE>,
Self: ModuleN + GGLWEEncryptSk<BE> + GLWESecretPreparedFactory<BE> + VecZnxSwitchRing + SvpPrepare<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
{
fn glwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -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<BE>
+ VecZnxDftBytesOf
+ VecZnxBigBytesOf
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxDftApply<BE>
+ SvpApplyDftToDft<BE>
+ VecZnxIdftApplyTmpA<BE>

View File

@@ -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<BE: Backend> GLWEToLWESwitchingKeyEncryptSk<BE> for Module<BE>
where
Self: ModuleN
+ GGLWEEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplace<BE>
+ VecZnxAutomorphismInplaceTmpBytes,
Scratch<BE>: ScratchTakeCore<BE>,

View File

@@ -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<BE: Backend> {
impl<BE: Backend> LWESwitchingKeyEncrypt<BE> for Module<BE>
where
Self: ModuleN + GLWESwitchingKeyEncryptSk<BE> + GLWESecretPreparedApi<BE> + VecZnxAutomorphismInplace<BE>,
Self: ModuleN + GLWESwitchingKeyEncryptSk<BE> + GLWESecretPreparedFactory<BE> + VecZnxAutomorphismInplace<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
{
fn lwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize

View File

@@ -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<BE>
+ VecZnxAutomorphismInplace<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplaceTmpBytes,
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
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
{
}
@@ -187,7 +187,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: GGLWEPreparedAlloc<B>,
M: GGLWEPreparedFactory<B>,
{
module.alloc_gglwe_prepared_from_infos(infos)
}
@@ -202,7 +202,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
dsize: Dsize,
) -> Self
where
M: GGLWEPreparedAlloc<B>,
M: GGLWEPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: GGLWEPreparedAlloc<B>,
M: GGLWEPreparedFactory<B>,
{
module.bytes_of_gglwe_prepared_from_infos(infos)
}
@@ -225,7 +225,7 @@ impl<B: Backend> GGLWEPrepared<Vec<u8>, B> {
dsize: Dsize,
) -> usize
where
M: GGLWEPreparedAlloc<B>,
M: GGLWEPreparedFactory<B>,
{
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>)
where
O: GGLWEToRef,
M: GGLWEPreparedAlloc<B>,
M: GGLWEPreparedFactory<B>,
{
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> {
pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize
where
M: GGLWEPreparedAlloc<B>,
M: GGLWEPreparedFactory<B>,
{
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
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>
{
}
@@ -171,14 +171,14 @@ impl<B: Backend> GGSWPrepared<Vec<u8>, B> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGSWInfos,
M: GGSWPreparedAlloc<B>,
M: GGSWPreparedFactory<B>,
{
module.alloc_ggsw_prepared_from_infos(infos)
}
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self
where
M: GGSWPreparedAlloc<B>,
M: GGSWPreparedFactory<B>,
{
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
where
A: GGSWInfos,
M: GGSWPreparedAlloc<B>,
M: GGSWPreparedFactory<B>,
{
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
where
M: GGSWPreparedAlloc<B>,
M: GGSWPreparedFactory<B>,
{
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
where
A: GGSWInfos,
M: GGSWPreparedAlloc<B>,
M: GGSWPreparedFactory<B>,
{
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>)
where
O: GGSWToRef,
M: GGSWPreparedAlloc<B>,
M: GGSWPreparedFactory<B>,
{
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
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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GLWEInfos,
M: GLWEPreparedAlloc<B>,
M: GLWEPreparedFactory<B>,
{
module.alloc_glwe_prepared_from_infos(infos)
}
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self
where
M: GLWEPreparedAlloc<B>,
M: GLWEPreparedFactory<B>,
{
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
where
A: GLWEInfos,
M: GLWEPreparedAlloc<B>,
M: GLWEPreparedFactory<B>,
{
module.bytes_of_glwe_prepared_from_infos(infos)
}
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize
where
M: GLWEPreparedAlloc<B>,
M: GLWEPreparedFactory<B>,
{
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)
where
O: GLWEToRef,
M: GLWEPreparedAlloc<B>,
M: GLWEPreparedFactory<B>,
{
module.prepare_glwe(self, other);
}

View File

@@ -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<D: Data, B: Backend> GGLWEInfos for GLWEAutomorphismKeyPrepared<D, B> {
}
}
pub trait GLWEAutomorphismKeyPreparedApi<B: Backend>
pub trait GLWEAutomorphismKeyPreparedFactory<B: Backend>
where
Self: GGLWEPreparedAlloc<B>,
Self: GGLWEPreparedFactory<B>,
{
fn alloc_automorphism_key_prepared(
&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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: GLWEAutomorphismKeyPreparedApi<B>,
M: GLWEAutomorphismKeyPreparedFactory<B>,
{
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
where
M: GLWEAutomorphismKeyPreparedApi<B>,
M: GLWEAutomorphismKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: GLWEAutomorphismKeyPreparedApi<B>,
M: GLWEAutomorphismKeyPreparedFactory<B>,
{
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
where
M: GLWEAutomorphismKeyPreparedApi<B>,
M: GLWEAutomorphismKeyPreparedFactory<B>,
{
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> {
pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize
where
M: GLWEAutomorphismKeyPreparedApi<B>,
M: GLWEAutomorphismKeyPreparedFactory<B>,
{
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>)
where
O: GGLWEToRef + GetGaloisElement,
M: GLWEAutomorphismKeyPreparedApi<B>,
M: GLWEAutomorphismKeyPreparedFactory<B>,
{
module.prepare_automorphism_key(self, other, scratch);
}

View File

@@ -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<D: Data, B: Backend> GLWEInfos for GLWEPublicKeyPrepared<D, B> {
}
}
pub trait GLWEPublicKeyPreparedAlloc<B: Backend>
pub trait GLWEPublicKeyPreparedFactory<B: Backend>
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> {
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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GLWEInfos,
M: GLWEPublicKeyPreparedAlloc<B>,
M: GLWEPublicKeyPreparedFactory<B>,
{
module.alloc_glwe_public_key_prepared_from_infos(infos)
}
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> Self
where
M: GLWEPublicKeyPreparedAlloc<B>,
M: GLWEPublicKeyPreparedFactory<B>,
{
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
where
A: GLWEInfos,
M: GLWEPublicKeyPreparedAlloc<B>,
M: GLWEPublicKeyPreparedFactory<B>,
{
module.bytes_of_glwe_public_key_prepared_from_infos(infos)
}
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, rank: Rank) -> usize
where
M: GLWEPublicKeyPreparedAlloc<B>,
M: GLWEPublicKeyPreparedFactory<B>,
{
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)
where
O: GLWEToRef + GetDistribution,
M: GLWEPublicKeyPreparedAlloc<B>,
M: GLWEPublicKeyPreparedFactory<B>,
{
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
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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GLWEInfos,
M: GLWESecretPreparedApi<B>,
M: GLWESecretPreparedFactory<B>,
{
module.alloc_glwe_secret_prepared_from_infos(infos)
}
pub fn alloc<M>(module: &M, rank: Rank) -> Self
where
M: GLWESecretPreparedApi<B>,
M: GLWESecretPreparedFactory<B>,
{
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
where
A: GLWEInfos,
M: GLWESecretPreparedApi<B>,
M: GLWESecretPreparedFactory<B>,
{
module.bytes_of_glwe_secret_prepared_from_infos(infos)
}
pub fn bytes_of<M>(module: &M, rank: Rank) -> usize
where
M: GLWESecretPreparedApi<B>,
M: GLWESecretPreparedFactory<B>,
{
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> {
pub fn prepare<M, O>(&mut self, module: &M, other: &O)
where
M: GLWESecretPreparedApi<B>,
M: GLWESecretPreparedFactory<B>,
O: GLWESecretToRef + GetDistribution,
{
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::{
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<D: Data, B: Backend> GGLWEInfos for GLWESwitchingKeyPrepared<D, B> {
}
}
pub trait GLWESwitchingKeyPreparedAlloc<B: Backend>
pub trait GLWESwitchingKeyPreparedFactory<B: Backend>
where
Self: GGLWEPreparedAlloc<B>,
Self: GGLWEPreparedFactory<B>,
{
fn alloc_glwe_switching_key_prepared(
&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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: GLWESwitchingKeyPreparedAlloc<B>,
M: GLWESwitchingKeyPreparedFactory<B>,
{
module.alloc_glwe_switching_key_prepared_from_infos(infos)
}
@@ -174,7 +174,7 @@ impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
dsize: Dsize,
) -> Self
where
M: GLWESwitchingKeyPreparedAlloc<B>,
M: GLWESwitchingKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: GLWESwitchingKeyPreparedAlloc<B>,
M: GLWESwitchingKeyPreparedFactory<B>,
{
module.bytes_of_glwe_switching_key_prepared_from_infos(infos)
}
@@ -197,7 +197,7 @@ impl<B: Backend> GLWESwitchingKeyPrepared<Vec<u8>, B> {
dsize: Dsize,
) -> usize
where
M: GLWESwitchingKeyPreparedAlloc<B>,
M: GLWESwitchingKeyPreparedFactory<B>,
{
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>)
where
O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: GLWESwitchingKeyPreparedAlloc<B>,
M: GLWESwitchingKeyPreparedFactory<B>,
{
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> {
pub fn prepare_tmp_bytes<M>(&self, module: &M) -> usize
where
M: GLWESwitchingKeyPreparedAlloc<B>,
M: GLWESwitchingKeyPreparedFactory<B>,
{
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 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<D: Data, B: Backend> GGLWEInfos for TensorKeyPrepared<D, B> {
}
}
pub trait TensorKeyPreparedAlloc<B: Backend>
pub trait TensorKeyPreparedFactory<B: Backend>
where
Self: GGLWEPreparedAlloc<B>,
Self: GGLWEPreparedFactory<B>,
{
fn alloc_tensor_key_prepared(
&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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: TensorKeyPreparedAlloc<B>,
M: TensorKeyPreparedFactory<B>,
{
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
where
M: TensorKeyPreparedAlloc<B>,
M: TensorKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: TensorKeyPreparedAlloc<B>,
M: TensorKeyPreparedFactory<B>,
{
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
where
M: TensorKeyPreparedAlloc<B>,
M: TensorKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: TensorKeyPreparedAlloc<B>,
M: TensorKeyPreparedFactory<B>,
{
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>)
where
O: TensorKeyToRef,
M: TensorKeyPreparedAlloc<B>,
M: TensorKeyPreparedFactory<B>,
{
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::{
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<D: Data, B: Backend> GGLWEInfos for GLWEToLWESwitchingKeyPrepared<D, B> {
}
}
pub trait GLWEToLWESwitchingKeyPreparedAlloc<B: Backend>
pub trait GLWEToLWESwitchingKeyPreparedFactory<B: Backend>
where
Self: GLWESwitchingKeyPreparedAlloc<B>,
Self: GLWESwitchingKeyPreparedFactory<B>,
{
fn alloc_glwe_to_lwe_switching_key_prepared(
&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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>,
M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{
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
where
M: GLWEToLWESwitchingKeyPreparedAlloc<B>,
M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>,
M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{
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
where
M: GLWEToLWESwitchingKeyPreparedAlloc<B>,
M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{
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)
where
A: GGLWEInfos,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>,
M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{
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>)
where
O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: GLWEToLWESwitchingKeyPreparedAlloc<B>,
M: GLWEToLWESwitchingKeyPreparedFactory<B>,
{
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::{
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<D: Data, B: Backend> GGLWEInfos for LWESwitchingKeyPrepared<D, B> {
}
}
pub trait LWESwitchingKeyPreparedAlloc<B: Backend>
pub trait LWESwitchingKeyPreparedFactory<B: Backend>
where
Self: GLWESwitchingKeyPreparedAlloc<B>,
Self: GLWESwitchingKeyPreparedFactory<B>,
{
fn alloc_lwe_switching_key_prepared(
&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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: LWESwitchingKeyPreparedAlloc<B>,
M: LWESwitchingKeyPreparedFactory<B>,
{
module.alloc_lwe_switching_key_prepared_from_infos(infos)
}
pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> Self
where
M: LWESwitchingKeyPreparedAlloc<B>,
M: LWESwitchingKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: LWESwitchingKeyPreparedAlloc<B>,
M: LWESwitchingKeyPreparedFactory<B>,
{
module.bytes_of_lwe_switching_key_prepared_from_infos(infos)
}
pub fn bytes_of<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum) -> usize
where
M: LWESwitchingKeyPreparedAlloc<B>,
M: LWESwitchingKeyPreparedFactory<B>,
{
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)
where
A: GGLWEInfos,
M: LWESwitchingKeyPreparedAlloc<B>,
M: LWESwitchingKeyPreparedFactory<B>,
{
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>)
where
O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: LWESwitchingKeyPreparedAlloc<B>,
M: LWESwitchingKeyPreparedFactory<B>,
{
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::{
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<D: Data, B: Backend> GGLWEInfos for LWEToGLWESwitchingKeyPrepared<D, B> {
}
}
pub trait LWEToGLWESwitchingKeyPreparedAlloc<B: Backend>
pub trait LWEToGLWESwitchingKeyPreparedFactory<B: Backend>
where
Self: GLWESwitchingKeyPreparedAlloc<B>,
Self: GLWESwitchingKeyPreparedFactory<B>,
{
fn alloc_lwe_to_glwe_switching_key_prepared(
&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> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self
where
A: GGLWEInfos,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>,
M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{
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
where
M: LWEToGLWESwitchingKeyPreparedAlloc<B>,
M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{
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
where
A: GGLWEInfos,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>,
M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{
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
where
M: LWEToGLWESwitchingKeyPreparedAlloc<B>,
M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{
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)
where
A: GGLWEInfos,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>,
M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{
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>)
where
O: GGLWEToRef + GLWESwitchingKeyDegrees,
M: LWEToGLWESwitchingKeyPreparedAlloc<B>,
M: LWEToGLWESwitchingKeyPreparedFactory<B>,
{
module.prepare_lwe_to_glwe_switching_key(self, other, scratch);
}

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWEAutomorphismKeyAutomorphism<BE>
+ VecZnxAutomorphism
+ GaloisElement
+ VecZnxSubScalarInplace
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWEDecrypt<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -188,12 +188,12 @@ where
pub fn test_gglwe_automorphism_key_automorphism_inplace<BE: Backend>(module: &Module<BE>)
where
Module<BE>: AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWEAutomorphismKeyAutomorphism<BE>
+ VecZnxAutomorphism
+ GaloisElement
+ VecZnxSubScalarInplace
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWEDecrypt<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGSWEncryptSk<BE>
+ AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GGSWAutomorphism<BE>
+ TensorKeyPreparedAlloc<BE>
+ TensorKeyPreparedFactory<BE>
+ TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplace<BE>
+ GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
@@ -178,11 +178,11 @@ pub fn test_ggsw_automorphism_inplace<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGSWEncryptSk<BE>
+ AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GGSWAutomorphism<BE>
+ TensorKeyPreparedAlloc<BE>
+ TensorKeyPreparedFactory<BE>
+ TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxAutomorphismInplace<BE>
+ GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GLWEEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxFillUniform
+ GLWEDecrypt<BE>
+ GLWEAutomorphism<BE>
+ AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWENoise<BE>
+ VecZnxAutomorphismInplace<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
@@ -136,12 +136,12 @@ where
pub fn test_glwe_automorphism_inplace<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GLWEEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxFillUniform
+ GLWEDecrypt<BE>
+ GLWEAutomorphism<BE>
+ AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWENoise<BE>
+ VecZnxAutomorphismInplace<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -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<BE>: GLWEFromLWE<BE>
+ LWEToGLWESwitchingKeyEncryptSk<BE>
+ GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ LWEEncryptSk<BE>
+ LWEToGLWESwitchingKeyPreparedAlloc<BE>,
+ LWEToGLWESwitchingKeyPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{
@@ -112,9 +112,9 @@ where
+ GLWEEncryptSk<BE>
+ LWEDecrypt<BE>
+ GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWEToLWESwitchingKeyEncryptSk<BE>
+ GLWEToLWESwitchingKeyPreparedAlloc<BE>,
+ GLWEToLWESwitchingKeyPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: AutomorphismKeyEncryptSk<BE>
+ GGLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE>
+ GLWESwitchingKeyCompressedEncryptSk<BE>
+ GLWESwitchingKeyDecompress
@@ -91,7 +91,7 @@ pub fn test_gglwe_automorphism_key_compressed_encrypt_sk<BE: Backend>(module: &M
where
Module<BE>: AutomorphismKeyCompressedEncryptSk<BE>
+ GGLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE>
+ GLWESwitchingKeyCompressedEncryptSk<BE>
+ AutomorphismKeyDecompress

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGLWEEncryptSk<BE>
+ GGLWEPreparedAlloc<BE>
+ GGLWEPreparedFactory<BE>
+ GGLWEKeyswitch<BE>
+ GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE>
+ VecZnxFillUniform
+ GGLWENoise<BE>,
@@ -83,10 +83,10 @@ where
pub fn test_gglwe_switching_key_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGLWEEncryptSk<BE>
+ GGLWEPreparedAlloc<BE>
+ GGLWEPreparedFactory<BE>
+ GGLWEKeyswitch<BE>
+ GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyEncryptSk<BE>
+ GLWESwitchingKeyCompressedEncryptSk<BE>
+ GLWESwitchingKeyDecompress

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<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 k: usize = 54;
@@ -74,7 +74,7 @@ pub fn test_ggsw_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<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 k: usize = 54;

View File

@@ -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<BE: Backend>(module: &Module<BE>)
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>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{
@@ -83,7 +83,7 @@ where
pub fn test_glwe_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
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>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{
@@ -160,7 +160,7 @@ where
pub fn test_glwe_encrypt_zero_sk<BE: Backend>(module: &Module<BE>)
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>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{
@@ -210,10 +210,10 @@ where
pub fn test_glwe_encrypt_pk<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GLWEEncryptPk<BE>
+ GLWEPublicKeyPreparedAlloc<BE>
+ GLWEPublicKeyPreparedFactory<BE>
+ GLWEPublicKeyGenerate<BE>
+ GLWEDecrypt<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxFillUniform
+ GLWESub,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWEDecrypt<BE>
+ VecZnxDftAlloc<BE>
+ VecZnxBigAlloc<BE>
@@ -112,7 +112,7 @@ where
pub fn test_gglwe_tensor_key_compressed_encrypt_sk<BE: Backend>(module: &Module<BE>)
where
Module<BE>: TensorKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GGLWETensorKeyCompressedEncryptSk<BE>
+ GLWEDecrypt<BE>
+ VecZnxDftAlloc<BE>

View File

@@ -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<BE>: GGLWEExternalProduct<BE>
+ GGSWEncryptSk<BE>
+ GLWESwitchingKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxRotateInplace<BE>
+ GGSWPreparedAlloc<BE>
+ GGSWPreparedFactory<BE>
+ GGLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -169,9 +169,9 @@ where
Module<BE>: GGLWEExternalProduct<BE>
+ GGSWEncryptSk<BE>
+ GLWESwitchingKeyEncryptSk<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxRotateInplace<BE>
+ GGSWPreparedAlloc<BE>
+ GGSWPreparedFactory<BE>
+ GGLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGSWEncryptSk<BE>
+ GGSWExternalProduct<BE>
+ GLWESecretPreparedApi<BE>
+ GGSWPreparedAlloc<BE>
+ GLWESecretPreparedFactory<BE>
+ GGSWPreparedFactory<BE>
+ VecZnxRotateInplace<BE>
+ GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
@@ -153,8 +153,8 @@ pub fn test_ggsw_external_product_inplace<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGSWEncryptSk<BE>
+ GGSWExternalProduct<BE>
+ GLWESecretPreparedApi<BE>
+ GGSWPreparedAlloc<BE>
+ GLWESecretPreparedFactory<BE>
+ GGSWPreparedFactory<BE>
+ VecZnxRotateInplace<BE>
+ GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGSWEncryptSk<BE>
+ GGSWPreparedAlloc<BE>
+ GGSWPreparedFactory<BE>
+ VecZnxFillUniform
+ GLWEExternalProduct<BE>
+ GLWEEncryptSk<BE>
+ GLWENoise<BE>
+ VecZnxRotateInplace<BE>
+ GLWESecretPreparedApi<BE>,
+ GLWESecretPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{
@@ -148,13 +148,13 @@ where
pub fn test_glwe_external_product_inplace<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GGSWEncryptSk<BE>
+ GGSWPreparedAlloc<BE>
+ GGSWPreparedFactory<BE>
+ VecZnxFillUniform
+ GLWEExternalProduct<BE>
+ GLWEEncryptSk<BE>
+ GLWENoise<BE>
+ VecZnxRotateInplace<BE>
+ GLWESecretPreparedApi<BE>,
+ GLWESecretPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GLWESwitchingKeyEncryptSk<BE>
+ GGLWEKeyswitch<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESwitchingKeyPreparedFactory<BE>
+ GLWESecretPreparedFactory<BE>
+ GGLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -162,9 +162,9 @@ pub fn test_gglwe_switching_key_keyswitch_inplace<BE: Backend>(module: &Module<B
where
Module<BE>: GLWESwitchingKeyEncryptSk<BE>
+ GGLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GGLWENoise<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>,
+ GLWESwitchingKeyPreparedFactory<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{

View File

@@ -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<BE>
+ TensorKeyEncryptSk<BE>
+ GGSWKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ TensorKeyPreparedAlloc<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>
+ GLWESecretPreparedFactory<BE>
+ TensorKeyPreparedFactory<BE>
+ GLWESwitchingKeyPreparedFactory<BE>
+ GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -187,9 +187,9 @@ where
+ GLWESwitchingKeyEncryptSk<BE>
+ TensorKeyEncryptSk<BE>
+ GGSWKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ TensorKeyPreparedAlloc<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>
+ GLWESecretPreparedFactory<BE>
+ TensorKeyPreparedFactory<BE>
+ GLWESwitchingKeyPreparedFactory<BE>
+ GGSWNoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -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<BE>
+ GLWEEncryptSk<BE>
+ GLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyPreparedFactory<BE>
+ GLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
@@ -143,8 +143,8 @@ where
+ GLWESwitchingKeyEncryptSk<BE>
+ GLWEEncryptSk<BE>
+ GLWEKeyswitch<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESwitchingKeyPreparedAlloc<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESwitchingKeyPreparedFactory<BE>
+ GLWENoise<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
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>,
Scratch<BE>: ScratchAvailable + ScratchTakeCore<BE>,
{

View File

@@ -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<BE: Backend>(module: &Module<BE>)
where
Module<BE>: GLWEEncryptSk<BE>
+ AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ GLWEPacking<BE>
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ GLWESub
+ GLWEDecrypt<BE>
+ GLWERotate<BE>,

View File

@@ -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<BE>
+ GLWEDecrypt<BE>
+ AutomorphismKeyEncryptSk<BE>
+ GLWEAutomorphismKeyPreparedApi<BE>
+ GLWEAutomorphismKeyPreparedFactory<BE>
+ VecZnxFillUniform
+ GLWESecretPreparedApi<BE>
+ GLWESecretPreparedFactory<BE>
+ VecZnxSubInplace
+ VecZnxNormalizeInplace<BE>,
ScratchOwned<BE>: ScratchOwnedAlloc<BE> + ScratchOwnedBorrow<BE>,