Add prepare multi thread

This commit is contained in:
Pro7ech
2025-11-11 21:24:39 +01:00
parent af45595848
commit 6924ffd94a
27 changed files with 361 additions and 86 deletions

View File

@@ -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>,

View File

@@ -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>,

View File

@@ -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;

View File

@@ -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>,

View File

@@ -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;

View File

@@ -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>,

View File

@@ -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>,

View File

@@ -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>,

View File

@@ -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>,

View File

@@ -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>,

View File

@@ -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>,

View File

@@ -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>,