removed self from PrepareScratch trait
jump to
@@ -114,8 +114,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWEAutomorphismKeyPrepared<DR, B>
where GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, { - fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { - self.key.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos) } }
@@ -264,7 +264,7 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWECiphertextPrepared<DR, B>
where 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( infos.dnum().into(), infos.rank_in().into(),
@@ -119,8 +119,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWESwitchingKeyPrepared<DR, B>
where GGLWECiphertextPrepared<DR, B>: PrepareScratchSpace<B, A>, { - fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { - self.key.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize { + GGLWECiphertextPrepared::<DR, B>::prepare_scratch_space(module, infos) } }
@@ -155,8 +155,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWETensorKeyPrepared<DR, B>
where GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, { - fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { - self.keys[0].prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos) } }
@@ -262,7 +262,7 @@ impl<DR: DataRef, B: Backend, A: GGSWInfos> PrepareScratchSpace<B, A> for GGSWCiphertextPrepared<DR, B>
where 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( infos.dnum().into(), (infos.rank() + 1).into(),
@@ -181,7 +181,7 @@ }
} 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 } }
@@ -86,7 +86,7 @@ }
} 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 } }
@@ -117,8 +117,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GLWEToLWESwitchingKeyPrepared<DR, B>
where GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, { - fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { - self.0.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos) } }
@@ -126,8 +126,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for LWESwitchingKeyPrepared<DR, B>
where GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, { - fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { - self.0.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos) } }
@@ -118,8 +118,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for LWEToGLWESwitchingKeyPrepared<DR, B>
where GGLWESwitchingKeyPrepared<DR, B>: PrepareScratchSpace<B, A>, { - fn prepare_scratch_space(&self, module: &Module<B>, infos: &A) -> usize { - self.0.prepare_scratch_space(module, infos) + fn prepare_scratch_space(module: &Module<B>, infos: &A) -> usize { + GGLWESwitchingKeyPrepared::<DR, B>::prepare_scratch_space(module, infos) } }
@@ -22,7 +22,7 @@ pub use lwe_to_glwe_ksk::*;
use poulpy_hal::layouts::{Backend, Module, Scratch}; 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> {