From 6d6d00e9e45613b099516251b1880c37bfedfeee Mon Sep 17 00:00:00 2001 From: Pro7ech Date: Sat, 25 Oct 2025 15:56:26 +0200 Subject: [PATCH] Add scratch space for ggsw blind rotation --- .../src/tfhe/bdd_arithmetic/bdd_rotation.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs b/poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs index 7124907..bf2116e 100644 --- a/poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs +++ b/poulpy-schemes/src/tfhe/bdd_arithmetic/bdd_rotation.rs @@ -11,6 +11,14 @@ where Self: GLWEBlindRotation, Scratch: ScratchTakeCore, { + fn 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) + } + fn ggsw_blind_rotation( &self, res: &mut R, @@ -46,12 +54,12 @@ where Self: GLWECopy + GLWERotate + Cmux, Scratch: ScratchTakeCore, { - fn glwe_blind_rotation_tmp_bytes(&self, res_infos: &R, b_infos: &B) -> usize + fn glwe_blind_rotation_tmp_bytes(&self, res_infos: &R, k_infos: &K) -> usize where R: GLWEInfos, - B: GGSWInfos, + K: GGSWInfos, { - self.cmux_tmp_bytes(res_infos, res_infos, b_infos) + GLWE::bytes_of_from_infos(res_infos) + self.cmux_tmp_bytes(res_infos, res_infos, k_infos) + GLWE::bytes_of_from_infos(res_infos) } /// Homomorphic multiplication of res by X^{k[bit_start..bit_start + bit_size] * bit_step}.