Add scratch space for ggsw blind rotation

This commit is contained in:
Pro7ech
2025-10-25 15:56:26 +02:00
parent e6e685c00e
commit 6d6d00e9e4

View File

@@ -11,6 +11,14 @@ where
Self: GLWEBlindRotation<T, BE>, Self: GLWEBlindRotation<T, BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn 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)
}
fn ggsw_blind_rotation<R, K>( fn ggsw_blind_rotation<R, K>(
&self, &self,
res: &mut R, res: &mut R,
@@ -46,12 +54,12 @@ where
Self: GLWECopy + GLWERotate<BE> + Cmux<BE>, Self: GLWECopy + GLWERotate<BE> + Cmux<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn glwe_blind_rotation_tmp_bytes<R, A, B>(&self, res_infos: &R, b_infos: &B) -> usize fn glwe_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
where where
R: GLWEInfos, 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}. /// Homomorphic multiplication of res by X^{k[bit_start..bit_start + bit_size] * bit_step}.