From 312ecc7f2f0ebbe6bc3143bfc587637c23d99f32 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bossuat Date: Thu, 9 Oct 2025 17:13:43 +0200 Subject: [PATCH] removed self from PrepareScratch trait --- poulpy-core/src/layouts/prepared/gglwe_atk.rs | 4 ++-- poulpy-core/src/layouts/prepared/gglwe_ct.rs | 2 +- poulpy-core/src/layouts/prepared/gglwe_ksk.rs | 4 ++-- poulpy-core/src/layouts/prepared/gglwe_tsk.rs | 4 ++-- poulpy-core/src/layouts/prepared/ggsw_ct.rs | 2 +- poulpy-core/src/layouts/prepared/glwe_pk.rs | 2 +- poulpy-core/src/layouts/prepared/glwe_sk.rs | 2 +- poulpy-core/src/layouts/prepared/glwe_to_lwe_ksk.rs | 4 ++-- poulpy-core/src/layouts/prepared/lwe_ksk.rs | 4 ++-- poulpy-core/src/layouts/prepared/lwe_to_glwe_ksk.rs | 4 ++-- poulpy-core/src/layouts/prepared/mod.rs | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/poulpy-core/src/layouts/prepared/gglwe_atk.rs b/poulpy-core/src/layouts/prepared/gglwe_atk.rs index fadb9f3..3f59b97 100644 --- a/poulpy-core/src/layouts/prepared/gglwe_atk.rs +++ b/poulpy-core/src/layouts/prepared/gglwe_atk.rs @@ -114,8 +114,8 @@ impl PrepareScratchSpace for GGLWE where GGLWESwitchingKeyPrepared: PrepareScratchSpace, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { - self.key.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::::prepare_scratch_space(module, infos) } } diff --git a/poulpy-core/src/layouts/prepared/gglwe_ct.rs b/poulpy-core/src/layouts/prepared/gglwe_ct.rs index 18b437f..a0c93fc 100644 --- a/poulpy-core/src/layouts/prepared/gglwe_ct.rs +++ b/poulpy-core/src/layouts/prepared/gglwe_ct.rs @@ -264,7 +264,7 @@ impl PrepareScratchSpace for GGLWE where Module: VmpPrepareTmpBytes, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { module.vmp_prepare_tmp_bytes( infos.dnum().into(), infos.rank_in().into(), diff --git a/poulpy-core/src/layouts/prepared/gglwe_ksk.rs b/poulpy-core/src/layouts/prepared/gglwe_ksk.rs index 495666f..f061641 100644 --- a/poulpy-core/src/layouts/prepared/gglwe_ksk.rs +++ b/poulpy-core/src/layouts/prepared/gglwe_ksk.rs @@ -119,8 +119,8 @@ impl PrepareScratchSpace for GGLWE where GGLWECiphertextPrepared: PrepareScratchSpace, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { - self.key.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { + GGLWECiphertextPrepared::::prepare_scratch_space(module, infos) } } diff --git a/poulpy-core/src/layouts/prepared/gglwe_tsk.rs b/poulpy-core/src/layouts/prepared/gglwe_tsk.rs index fd2700a..6a6dc01 100644 --- a/poulpy-core/src/layouts/prepared/gglwe_tsk.rs +++ b/poulpy-core/src/layouts/prepared/gglwe_tsk.rs @@ -155,8 +155,8 @@ impl PrepareScratchSpace for GGLWE where GGLWESwitchingKeyPrepared: PrepareScratchSpace, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { - self.keys[0].prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::::prepare_scratch_space(module, infos) } } diff --git a/poulpy-core/src/layouts/prepared/ggsw_ct.rs b/poulpy-core/src/layouts/prepared/ggsw_ct.rs index ccdf310..3d67467 100644 --- a/poulpy-core/src/layouts/prepared/ggsw_ct.rs +++ b/poulpy-core/src/layouts/prepared/ggsw_ct.rs @@ -262,7 +262,7 @@ impl PrepareScratchSpace for GGSWCi where Module: VmpPrepareTmpBytes, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { module.vmp_prepare_tmp_bytes( infos.dnum().into(), (infos.rank() + 1).into(), diff --git a/poulpy-core/src/layouts/prepared/glwe_pk.rs b/poulpy-core/src/layouts/prepared/glwe_pk.rs index d06fc30..c97dd4f 100644 --- a/poulpy-core/src/layouts/prepared/glwe_pk.rs +++ b/poulpy-core/src/layouts/prepared/glwe_pk.rs @@ -181,7 +181,7 @@ where } impl PrepareScratchSpace for GLWEPublicKeyPrepared { - fn prepare_scratch_space(&self, _module: &Module, _infos: &A) -> usize { + fn prepare_scratch_space(_module: &Module, _infos: &A) -> usize { 0 } } diff --git a/poulpy-core/src/layouts/prepared/glwe_sk.rs b/poulpy-core/src/layouts/prepared/glwe_sk.rs index 7aa0fd9..e8c42ee 100644 --- a/poulpy-core/src/layouts/prepared/glwe_sk.rs +++ b/poulpy-core/src/layouts/prepared/glwe_sk.rs @@ -86,7 +86,7 @@ impl GLWESecretPrepared { } impl PrepareScratchSpace for GLWESecretPrepared { - fn prepare_scratch_space(&self, _module: &Module, _infos: &A) -> usize { + fn prepare_scratch_space(_module: &Module, _infos: &A) -> usize { 0 } } diff --git a/poulpy-core/src/layouts/prepared/glwe_to_lwe_ksk.rs b/poulpy-core/src/layouts/prepared/glwe_to_lwe_ksk.rs index 2d5ba3e..59d2bbd 100644 --- a/poulpy-core/src/layouts/prepared/glwe_to_lwe_ksk.rs +++ b/poulpy-core/src/layouts/prepared/glwe_to_lwe_ksk.rs @@ -117,8 +117,8 @@ impl PrepareScratchSpace for GLWET where GGLWESwitchingKeyPrepared: PrepareScratchSpace, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { - self.0.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::::prepare_scratch_space(module, infos) } } diff --git a/poulpy-core/src/layouts/prepared/lwe_ksk.rs b/poulpy-core/src/layouts/prepared/lwe_ksk.rs index c938fe4..b120e37 100644 --- a/poulpy-core/src/layouts/prepared/lwe_ksk.rs +++ b/poulpy-core/src/layouts/prepared/lwe_ksk.rs @@ -126,8 +126,8 @@ impl PrepareScratchSpace for LWESw where GGLWESwitchingKeyPrepared: PrepareScratchSpace, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { - self.0.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::::prepare_scratch_space(module, infos) } } diff --git a/poulpy-core/src/layouts/prepared/lwe_to_glwe_ksk.rs b/poulpy-core/src/layouts/prepared/lwe_to_glwe_ksk.rs index bd8184b..fc792f0 100644 --- a/poulpy-core/src/layouts/prepared/lwe_to_glwe_ksk.rs +++ b/poulpy-core/src/layouts/prepared/lwe_to_glwe_ksk.rs @@ -118,8 +118,8 @@ impl PrepareScratchSpace for LWETo where GGLWESwitchingKeyPrepared: PrepareScratchSpace, { - fn prepare_scratch_space(&self, module: &Module, infos: &A) -> usize { - self.0.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::::prepare_scratch_space(module, infos) } } diff --git a/poulpy-core/src/layouts/prepared/mod.rs b/poulpy-core/src/layouts/prepared/mod.rs index fdf3f09..eb47848 100644 --- a/poulpy-core/src/layouts/prepared/mod.rs +++ b/poulpy-core/src/layouts/prepared/mod.rs @@ -22,7 +22,7 @@ pub use lwe_to_glwe_ksk::*; use poulpy_hal::layouts::{Backend, Module, Scratch}; pub trait PrepareScratchSpace { - fn prepare_scratch_space(&self, module: &Module, infos: &T) -> usize; + fn prepare_scratch_space(module: &Module, infos: &T) -> usize; } pub trait PrepareAlloc {