removed self from PrepareScratch trait

This commit is contained in:
Jean-Philippe Bossuat
2025-10-09 17:13:43 +02:00
parent 2884935a38
commit 312ecc7f2f
11 changed files with 17 additions and 17 deletions

View File

@@ -114,8 +114,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWE
where where
GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
self.key.prepare_scratch_space(module, infos) GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos)
} }
} }

View File

@@ -264,7 +264,7 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWE
where where
Module<B>: VmpPrepareTmpBytes, Module<B>: VmpPrepareTmpBytes,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
module.vmp_prepare_tmp_bytes( module.vmp_prepare_tmp_bytes(
infos.dnum().into(), infos.dnum().into(),
infos.rank_in().into(), infos.rank_in().into(),

View File

@@ -119,8 +119,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWE
where where
GGLWECiphertextPrepared<DR, B>: PrepareScratchSpace<B, A>, GGLWECiphertextPrepared<DR, B>: PrepareScratchSpace<B, A>,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
self.key.prepare_scratch_space(module, infos) GGLWECiphertextPrepared::<DR, B>::prepare_scratch_space(module, infos)
} }
} }

View File

@@ -155,8 +155,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWE
where where
GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
self.keys[0].prepare_scratch_space(module, infos) GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos)
} }
} }

View File

@@ -262,7 +262,7 @@ impl<DR: DataRef, B: Backend, A: GGSWInfos> PrepareScratchSpace<B, A> for GGSWCi
where where
Module<B>: VmpPrepareTmpBytes, Module<B>: VmpPrepareTmpBytes,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
module.vmp_prepare_tmp_bytes( module.vmp_prepare_tmp_bytes(
infos.dnum().into(), infos.dnum().into(),
(infos.rank() + 1).into(), (infos.rank() + 1).into(),

View File

@@ -181,7 +181,7 @@ where
} }
impl<DR: DataRef, B: Backend, A: GLWEInfos> PrepareScratchSpace<B, A> for GLWEPublicKeyPrepared<DR, B> { impl<DR: DataRef, B: Backend, A: GLWEInfos> PrepareScratchSpace<B, A> for GLWEPublicKeyPrepared<DR, B> {
fn prepare_scratch_space(&self, _module: &Module<B>, _infos: &A) -> usize { fn prepare_scratch_space(_module: &Module<B>, _infos: &A) -> usize {
0 0
} }
} }

View File

@@ -86,7 +86,7 @@ impl<D: Data, B: Backend> GLWESecretPrepared<D, B> {
} }
impl<DR: DataRef, B: Backend, A: GLWEInfos> PrepareScratchSpace<B, A> for GLWESecretPrepared<DR, B> { impl<DR: DataRef, B: Backend, A: GLWEInfos> PrepareScratchSpace<B, A> for GLWESecretPrepared<DR, B> {
fn prepare_scratch_space(&self, _module: &Module<B>, _infos: &A) -> usize { fn prepare_scratch_space(_module: &Module<B>, _infos: &A) -> usize {
0 0
} }
} }

View File

@@ -117,8 +117,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GLWET
where where
GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
self.0.prepare_scratch_space(module, infos) GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos)
} }
} }

View File

@@ -126,8 +126,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for LWESw
where where
GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
self.0.prepare_scratch_space(module, infos) GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos)
} }
} }

View File

@@ -118,8 +118,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for LWETo
where where
GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>,
{ {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize {
self.0.prepare_scratch_space(module, infos) GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos)
} }
} }

View File

@@ -22,7 +22,7 @@ pub use lwe_to_glwe_ksk::*;
use poulpy_hal::layouts::{Backend, Module, Scratch}; use poulpy_hal::layouts::{Backend, Module, Scratch};
pub trait PrepareScratchSpace<B: Backend, T> { pub trait PrepareScratchSpace<B: Backend, T> {
fn prepare_scratch_space(&self, module: &Module<B>, infos: &T) -> usize; fn prepare_scratch_space(module: &Module<B>, infos: &T) -> usize;
} }
pub trait PrepareAlloc<B: Backend, T> { pub trait PrepareAlloc<B: Backend, T> {