diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/ciphertexts/fhe_uint_prepared.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/ciphertexts/fhe_uint_prepared.rs index 3068581..c8036ea 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/ciphertexts/fhe_uint_prepared.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/ciphertexts/fhe_uint_prepared.rs @@ -85,7 +85,7 @@ where } impl FheUintPrepared, T, BE> { - pub fn alloc(module: &M, infos: &A) -> Self + pub fn alloc_from_infos(module: &M, infos: &A) -> Self where A: GGSWInfos, M: FheUintBlocksPreparedFactory, @@ -93,7 +93,7 @@ impl FheUintPrepared, T, BE> { module.alloc_fhe_uint_prepared_from_infos(infos) } - pub fn alloc_with(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self + pub fn alloc(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self where M: FheUintBlocksPreparedFactory, { diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/add.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/add.rs index beff7fd..cd709d9 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/add.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/add.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32(); diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/and.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/and.rs index 5bb8ffc..0acd1a5 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/and.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/and.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32(); diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/ggsw_blind_rotations.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/ggsw_blind_rotations.rs index 5f7ae02..3f8effc 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/ggsw_blind_rotations.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/ggsw_blind_rotations.rs @@ -78,7 +78,7 @@ where // println!("k: {k}"); - let mut k_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_k_infos); + let mut k_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_k_infos); k_enc_prep.encrypt_sk( module, k, diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/glwe_blind_rotation.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/glwe_blind_rotation.rs index c7d503f..6bb4553 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/glwe_blind_rotation.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/glwe_blind_rotation.rs @@ -71,7 +71,7 @@ where let k: u32 = source.next_u32(); - let mut k_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut k_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); k_enc_prep.encrypt_sk( module, k, diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/or.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/or.rs index e76cc2f..b7be001 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/or.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/or.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32(); diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sll.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sll.rs index 951d55c..b947cf5 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sll.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sll.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32() & 15; diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/slt.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/slt.rs index 3abcb26..13d9170 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/slt.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/slt.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32(); diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sltu.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sltu.rs index b7e7cf3..908ad4a 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sltu.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sltu.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32(); diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sra.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sra.rs index 6d50bec..a1c04a7 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sra.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sra.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32() & 15; diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/srl.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/srl.rs index 0ddcad8..23a6bb1 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/srl.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/srl.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32() & 15; diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sub.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sub.rs index 1b96d9f..a7174b7 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sub.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sub.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32(); diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/xor.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/xor.rs index 82a0854..c9cd937 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/xor.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/xor.rs @@ -51,8 +51,8 @@ where let mut scratch: ScratchOwned = ScratchOwned::alloc(1 << 22); let mut res: FheUint, u32> = FheUint::, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared, u32, BE> = FheUintPrepared::, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();