mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
conversions tests
This commit is contained in:
@@ -17,7 +17,7 @@ impl GLWEToLWESwitchingKey<Vec<u8>> {
|
||||
pub fn encrypt_sk_tmp_bytes<M, A, BE: Backend>(module: &M, infos: &A) -> usize
|
||||
where
|
||||
A: GGLWEInfos,
|
||||
M: GLWEToLWESwitchingKeyEncrypt<BE>,
|
||||
M: GLWEToLWESwitchingKeyEncryptSk<BE>,
|
||||
{
|
||||
module.glwe_to_lwe_switching_key_encrypt_sk_tmp_bytes(infos)
|
||||
}
|
||||
@@ -33,7 +33,7 @@ impl<D: DataMut> GLWEToLWESwitchingKey<D> {
|
||||
source_xe: &mut Source,
|
||||
scratch: &mut Scratch<BE>,
|
||||
) where
|
||||
M: GLWEToLWESwitchingKeyEncrypt<BE>,
|
||||
M: GLWEToLWESwitchingKeyEncryptSk<BE>,
|
||||
S1: LWESecretToRef,
|
||||
S2: GLWESecretToRef,
|
||||
Scratch<BE>: ScratchTakeCore<BE>,
|
||||
@@ -42,7 +42,7 @@ impl<D: DataMut> GLWEToLWESwitchingKey<D> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GLWEToLWESwitchingKeyEncrypt<BE: Backend> {
|
||||
pub trait GLWEToLWESwitchingKeyEncryptSk<BE: Backend> {
|
||||
fn glwe_to_lwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize
|
||||
where
|
||||
A: GGLWEInfos;
|
||||
@@ -61,7 +61,7 @@ pub trait GLWEToLWESwitchingKeyEncrypt<BE: Backend> {
|
||||
R: GGLWEToMut;
|
||||
}
|
||||
|
||||
impl<BE: Backend> GLWEToLWESwitchingKeyEncrypt<BE> for Module<BE>
|
||||
impl<BE: Backend> GLWEToLWESwitchingKeyEncryptSk<BE> for Module<BE>
|
||||
where
|
||||
Self: ModuleN
|
||||
+ GGLWEEncryptSk<BE>
|
||||
|
||||
@@ -16,7 +16,7 @@ impl LWEToGLWESwitchingKey<Vec<u8>> {
|
||||
pub fn encrypt_sk_tmp_bytes<M, A, BE: Backend>(module: &M, infos: &A) -> usize
|
||||
where
|
||||
A: GGLWEInfos,
|
||||
M: LWEToGLWESwitchingKeyEncrypt<BE>,
|
||||
M: LWEToGLWESwitchingKeyEncryptSk<BE>,
|
||||
{
|
||||
module.lwe_to_glwe_switching_key_encrypt_sk_tmp_bytes(infos)
|
||||
}
|
||||
@@ -34,14 +34,14 @@ impl<D: DataMut> LWEToGLWESwitchingKey<D> {
|
||||
) where
|
||||
S1: LWESecretToRef,
|
||||
S2: GLWESecretPreparedToRef<BE>,
|
||||
M: LWEToGLWESwitchingKeyEncrypt<BE>,
|
||||
M: LWEToGLWESwitchingKeyEncryptSk<BE>,
|
||||
Scratch<BE>: ScratchTakeCore<BE>,
|
||||
{
|
||||
module.lwe_to_glwe_switching_key_encrypt_sk(self, sk_lwe, sk_glwe, source_xa, source_xe, scratch);
|
||||
}
|
||||
}
|
||||
|
||||
pub trait LWEToGLWESwitchingKeyEncrypt<BE: Backend> {
|
||||
pub trait LWEToGLWESwitchingKeyEncryptSk<BE: Backend> {
|
||||
fn lwe_to_glwe_switching_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize
|
||||
where
|
||||
A: GGLWEInfos;
|
||||
@@ -60,7 +60,7 @@ pub trait LWEToGLWESwitchingKeyEncrypt<BE: Backend> {
|
||||
R: GGLWEToMut;
|
||||
}
|
||||
|
||||
impl<BE: Backend> LWEToGLWESwitchingKeyEncrypt<BE> for Module<BE>
|
||||
impl<BE: Backend> LWEToGLWESwitchingKeyEncryptSk<BE> for Module<BE>
|
||||
where
|
||||
Self: ModuleN
|
||||
+ GGLWEEncryptSk<BE>
|
||||
|
||||
Reference in New Issue
Block a user