From 96c32c531cde1cfd08031207454a53dc9ae145f3 Mon Sep 17 00:00:00 2001 From: Pro7ech Date: Sun, 26 Oct 2025 10:45:30 +0100 Subject: [PATCH] rename to what it actually does --- .../{bdd_rotation.rs => blind_rotation.rs} | 20 +++++++++---------- poulpy-schemes/src/tfhe/bdd_arithmetic/mod.rs | 4 ++-- .../tfhe/bdd_arithmetic/tests/fft64_ref.rs | 10 +++++----- .../tests/test_suite/ggsw_blind_rotations.rs | 4 ++-- .../tests/test_suite/glwe_blind_rotation.rs | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) rename poulpy-schemes/src/tfhe/bdd_arithmetic/{bdd_rotation.rs => blind_rotation.rs} (89%) diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/blind_rotation.rs similarity index 89% rename from poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs rename to poulpy-schemes/src/tfhe/bdd_arithmetic/blind_rotation.rs index 89965ef..27d97d5 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/blind_rotation.rs @@ -21,16 +21,16 @@ where Self: GLWEBlindRotation + VecZnxAddScalarInplace + VecZnxNormalizeInplace, Scratch: ScratchTakeCore, { - fn ggsw_blind_rotate_from_ggsw_tmp_bytes(&self, res_infos: &R, k_infos: &K) -> usize + fn ggsw_to_ggsw_blind_rotation_tmp_bytes(&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( + fn ggsw_to_ggsw_blind_rotation( &self, res: &mut R, a: &A, @@ -53,7 +53,7 @@ where 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 @@ where } } - fn ggsw_blind_rotate_from_scalar_tmp_bytes(&self, res_infos: &R, k_infos: &K) -> usize + fn scalar_to_ggsw_blind_rotation_tmp_bytes(&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( + fn scalar_to_ggsw_blind_rotation( &self, res: &mut R, test_vector: &S, @@ -109,7 +109,7 @@ where ); 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 + Cmux, Scratch: ScratchTakeCore, { - fn glwe_blind_rotation_tmp_bytes(&self, res_infos: &R, k_infos: &K) -> usize + fn glwe_to_glwe_blind_rotation_tmp_bytes(&self, res_infos: &R, k_infos: &K) -> usize where R: GLWEInfos, K: GGSWInfos, @@ -144,7 +144,7 @@ where } /// res <- a * X^{((k>>bit_rsh) % 2^bit_mask) << bit_lsh}. - fn glwe_blind_rotation( + fn glwe_to_glwe_blind_rotation( &self, res: &mut R, a: &A, diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/mod.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/mod.rs index 22e5073..f73eb30 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/mod.rs +++ b/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::*; diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/fft64_ref.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/fft64_ref.rs index 94c7352..a34cdae 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/fft64_ref.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/fft64_ref.rs @@ -3,19 +3,19 @@ use poulpy_backend::FFT64Ref; 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::() +fn test_glwe_to_glwe_blind_rotation_fft64_ref() { + test_glwe_to_glwe_blind_rotation::() } #[test] -fn test_ggsw_blind_rotation_fft64_ref() { - test_ggsw_blind_rotation::() +fn test_scalar_to_ggsw_blind_rotation_fft64_ref() { + test_scalar_to_ggsw_blind_rotation::() } #[test] 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 1e0146f..5a0f6bd 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 @@ -14,7 +14,7 @@ use rand::RngCore; use crate::tfhe::bdd_arithmetic::{FheUintBlocksPrepared, GGSWBlindRotation}; -pub fn test_ggsw_blind_rotation() +pub fn test_scalar_to_ggsw_blind_rotation() where Module: ModuleNew + GLWESecretPreparedFactory @@ -117,7 +117,7 @@ where // 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, 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 ed1fdd0..47f97f3 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 @@ -14,7 +14,7 @@ use rand::RngCore; use crate::tfhe::bdd_arithmetic::{FheUintBlocksPrepared, GLWEBlindRotation}; -pub fn test_glwe_blind_rotation() +pub fn test_glwe_to_glwe_blind_rotation() where Module: ModuleNew + GLWESecretPreparedFactory @@ -106,7 +106,7 @@ where // 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,