arnaucube
arnaucube/poulpyPublic Self-hosted repository
rename to what it actually does
Pro7ech jeanphilippe.bossuat@gmail.com
Sun, 26 Oct 2025 10:45:30 +0100
commit

96c32c531cde1cfd08031207454a53dc9ae145f3

parent

6dd93ceaeaa4090f19b7746d0d53fc930fba198a

M poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/blind_rotation.rs

@@ -21,16 +21,16 @@ where

Self: GLWEBlindRotation<T, BE> + VecZnxAddScalarInplace + VecZnxNormalizeInplace<BE>, Scratch<BE>: ScratchTakeCore<BE>, { - fn ggsw_blind_rotate_from_ggsw_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize + fn ggsw_to_ggsw_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize where R: GLWEInfos, K: GGSWInfos, { - self.glwe_blind_rotation_tmp_bytes(res_infos, k_infos) + self.glwe_to_glwe_blind_rotation_tmp_bytes(res_infos, k_infos) } /// res <- a * X^{((k>>bit_rsh) % 2^bit_mask) << bit_lsh}. - fn ggsw_blind_rotate_from_ggsw<R, A, K>( + fn ggsw_to_ggsw_blind_rotation<R, A, K>( &self, res: &mut R, a: &A,

@@ -53,7 +53,7 @@ assert_eq!(res.dsize(), a.dsize());

for col in 0..(res.rank() + 1).into() { for row in 0..res.dnum().into() { - self.glwe_blind_rotation( + self.glwe_to_glwe_blind_rotation( &mut res.at_mut(row, col), &a.at(row, col), k,

@@ -66,15 +66,15 @@ }

} } - fn ggsw_blind_rotate_from_scalar_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize + fn scalar_to_ggsw_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize where R: GLWEInfos, K: GGSWInfos, { - self.glwe_blind_rotation_tmp_bytes(res_infos, k_infos) + GLWE::bytes_of_from_infos(res_infos) + self.glwe_to_glwe_blind_rotation_tmp_bytes(res_infos, k_infos) + GLWE::bytes_of_from_infos(res_infos) } - fn ggsw_blind_rotate_from_scalar<R, S, K>( + fn scalar_to_ggsw_blind_rotation<R, S, K>( &self, res: &mut R, test_vector: &S,

@@ -109,7 +109,7 @@ 0,

); self.vec_znx_normalize_inplace(base2k, tmp_glwe.data_mut(), col, scratch_1); - self.glwe_blind_rotation( + self.glwe_to_glwe_blind_rotation( &mut res.at_mut(row, col), &tmp_glwe, k,

@@ -135,7 +135,7 @@ where

Self: GLWECopy + GLWERotate<BE> + Cmux<BE>, Scratch<BE>: ScratchTakeCore<BE>, { - fn glwe_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize + fn glwe_to_glwe_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize where R: GLWEInfos, K: GGSWInfos,

@@ -144,7 +144,7 @@ self.cmux_tmp_bytes(res_infos, res_infos, k_infos) + GLWE::bytes_of_from_infos(res_infos)

} /// res <- a * X^{((k>>bit_rsh) % 2^bit_mask) << bit_lsh}. - fn glwe_blind_rotation<R, A, K>( + fn glwe_to_glwe_blind_rotation<R, A, K>( &self, res: &mut R, a: &A,
M poulpy-schemes/src/tfhe/bdd_arithmetic/mod.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/mod.rs

@@ -1,12 +1,12 @@

mod bdd_2w_to_1w; -mod bdd_rotation; +mod blind_rotation; mod ciphertexts; mod circuits; mod eval; mod key; pub use bdd_2w_to_1w::*; -pub use bdd_rotation::*; +pub use blind_rotation::*; pub use ciphertexts::*; pub(crate) use circuits::*; pub(crate) use eval::*;
M poulpy-schemes/src/tfhe/bdd_arithmetic/tests/fft64_ref.rs → poulpy-schemes/src/tfhe/bdd_arithmetic/tests/fft64_ref.rs

@@ -3,19 +3,19 @@

use crate::tfhe::{ bdd_arithmetic::tests::test_suite::{ test_bdd_add, test_bdd_and, test_bdd_or, test_bdd_prepare, test_bdd_sll, test_bdd_slt, test_bdd_sltu, test_bdd_sra, - test_bdd_srl, test_bdd_sub, test_bdd_xor, test_ggsw_blind_rotation, test_glwe_blind_rotation, + test_bdd_srl, test_bdd_sub, test_bdd_xor, test_scalar_to_ggsw_blind_rotation, test_glwe_to_glwe_blind_rotation, }, blind_rotation::CGGI, }; #[test] -fn test_glwe_blind_rotation_fft64_ref() { - test_glwe_blind_rotation::<FFT64Ref>() +fn test_glwe_to_glwe_blind_rotation_fft64_ref() { + test_glwe_to_glwe_blind_rotation::<FFT64Ref>() } #[test] -fn test_ggsw_blind_rotation_fft64_ref() { - test_ggsw_blind_rotation::<FFT64Ref>() +fn test_scalar_to_ggsw_blind_rotation_fft64_ref() { + test_scalar_to_ggsw_blind_rotation::<FFT64Ref>() } #[test]
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

@@ -14,7 +14,7 @@ use rand::RngCore;

use crate::tfhe::bdd_arithmetic::{FheUintBlocksPrepared, GGSWBlindRotation}; -pub fn test_ggsw_blind_rotation<BE: Backend>() +pub fn test_scalar_to_ggsw_blind_rotation<BE: Backend>() where Module<BE>: ModuleNew<BE> + GLWESecretPreparedFactory<BE>

@@ -117,7 +117,7 @@

// How many bits to take let bit_size: usize = (32 - bit_start).min(digit); - module.ggsw_blind_rotate_from_scalar( + module.scalar_to_ggsw_blind_rotation( &mut res, &scalar, &k_enc_prep,
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

@@ -14,7 +14,7 @@ use rand::RngCore;

use crate::tfhe::bdd_arithmetic::{FheUintBlocksPrepared, GLWEBlindRotation}; -pub fn test_glwe_blind_rotation<BE: Backend>() +pub fn test_glwe_to_glwe_blind_rotation<BE: Backend>() where Module<BE>: ModuleNew<BE> + GLWESecretPreparedFactory<BE>

@@ -106,7 +106,7 @@

// How many bits to take let bit_size: usize = (32 - bit_start).min(digit); - module.glwe_blind_rotation( + module.glwe_to_glwe_blind_rotation( &mut res, &test_glwe, &k_enc_prep,