mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
Add prepare multi thread
This commit is contained in:
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -75,6 +75,14 @@ where
|
||||
}
|
||||
|
||||
impl<BRA: BlindRotationAlgo, BE: Backend> TestContext<BRA, BE> {
|
||||
pub fn glwe_infos(&self) -> GLWELayout {
|
||||
TEST_GLWE_INFOS
|
||||
}
|
||||
|
||||
pub fn ggsw_infos(&self) -> GGSWLayout {
|
||||
TEST_GGSW_INFOS
|
||||
}
|
||||
|
||||
pub fn new() -> Self
|
||||
where
|
||||
Module<BE>: ModuleNew<BE>
|
||||
@@ -125,8 +133,8 @@ impl<BRA: BlindRotationAlgo, BE: Backend> TestContext<BRA, BE> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) const TEST_N_GLWE: u32 = 256;
|
||||
pub(crate) const TEST_N_LWE: u32 = 77;
|
||||
pub(crate) const TEST_N_GLWE: u32 = 1024;
|
||||
pub(crate) const TEST_N_LWE: u32 = 574;
|
||||
pub(crate) const TEST_BASE2K: u32 = 13;
|
||||
pub(crate) const TEST_K_GLWE: u32 = 26;
|
||||
pub(crate) const TEST_K_GGSW: u32 = 39;
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
@@ -67,8 +67,10 @@ where
|
||||
let mut c_enc_prep_debug: FheUintPreparedDebug<Vec<u8>, u32> =
|
||||
FheUintPreparedDebug::<Vec<u8>, u32>::alloc_from_infos(module, &ggsw_infos);
|
||||
|
||||
let mut scratch_2 = ScratchOwned::alloc(module.fhe_uint_prepare_tmp_bytes(7, 1, &c_enc_prep_debug, &c_enc, bdd_key_prepared));
|
||||
|
||||
// GGSW(value)
|
||||
c_enc_prep_debug.prepare(module, &c_enc, bdd_key_prepared, scratch.borrow());
|
||||
c_enc_prep_debug.prepare(module, &c_enc, bdd_key_prepared, scratch_2.borrow());
|
||||
|
||||
let max_noise = |col_i: usize| {
|
||||
let mut noise: f64 = -(ggsw_infos.size() as f64 * TEST_BASE2K as f64) + SIGMA.log2() + 2.0;
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
@@ -30,7 +30,7 @@ where
|
||||
+ BDDKeyEncryptSk<BRA, BE>
|
||||
+ BDDKeyPreparedFactory<BRA, BE>
|
||||
+ GGSWNoise<BE>
|
||||
+ FheUintPrepare<BRA, u32, BE>
|
||||
+ FheUintPrepare<BRA, BE>
|
||||
+ ExecuteBDDCircuit2WTo1W<u32, BE>
|
||||
+ GLWEEncryptSk<BE>,
|
||||
BlindRotationKey<Vec<u8>, BRA>: BlindRotationKeyFactory<BRA>,
|
||||
|
||||
Reference in New Issue
Block a user