arnaucube
arnaucube/poulpyPublic Self-hosted repository
Small API consistency fix
Pro7ech jeanphilippe.bossuat@gmail.com
Thu, 30 Oct 2025 12:05:42 +0100
commit

a6970669dd677500cb3eb622ed9adf7711fe9e85

parent

201a1f64eb3d0891138248c0eed61e070354e573

M poulpy-schemes/src/tfhe/bdd_arithmetic/ciphertexts/fhe_uint_prepared.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/ciphertexts/fhe_uint_prepared.rs

@@ -85,7 +85,7 @@ }

} impl<T: UnsignedInteger, BE: Backend> FheUintPrepared<Vec<u8>, T, BE> { - pub fn alloc<A, M>(module: &M, infos: &A) -> Self + pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self where A: GGSWInfos, M: FheUintBlocksPreparedFactory<T, BE>,

@@ -93,7 +93,7 @@ {

module.alloc_fhe_uint_prepared_from_infos(infos) } - pub fn alloc_with<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self + pub fn alloc<M>(module: &M, base2k: Base2K, k: TorusPrecision, dnum: Dnum, dsize: Dsize, rank: Rank) -> Self where M: FheUintBlocksPreparedFactory<T, BE>, {
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/add.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/add.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/and.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/and.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/ggsw_blind_rotations.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/ggsw_blind_rotations.rs

@@ -78,7 +78,7 @@ let k: u32 = source.next_u32();

// println!("k: {k}"); - let mut k_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_k_infos); + let mut k_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_k_infos); k_enc_prep.encrypt_sk( module, k,
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/glwe_blind_rotation.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/glwe_blind_rotation.rs

@@ -71,7 +71,7 @@ test_glwe.encode_vec_i64(&data, base2k.as_usize().into());

let k: u32 = source.next_u32(); - let mut k_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut k_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); k_enc_prep.encrypt_sk( module, k,
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/or.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/or.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sll.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sll.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32() & 15;
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/slt.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/slt.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sltu.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sltu.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sra.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sra.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32() & 15;
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/srl.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/srl.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32() & 15;
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sub.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/sub.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/xor.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/xor.rs

@@ -51,8 +51,8 @@

let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(1 << 22); let mut res: FheUint<Vec<u8>, u32> = FheUint::<Vec<u8>, u32>::alloc_from_infos(&glwe_infos); - let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); - let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc(module, &ggsw_infos); + let mut a_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); + let mut b_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> = FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_infos); let a: u32 = source.next_u32(); let b: u32 = source.next_u32();