mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
removed self from PrepareScratch trait
This commit is contained in:
@@ -114,8 +114,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GGLWE
|
||||
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 GGLWE
|
||||
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 GGLWE
|
||||
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 GGLWE
|
||||
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 GGSWCi
|
||||
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 @@ where
|
||||
}
|
||||
|
||||
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<D: Data, B: Backend> GLWESecretPrepared<D, 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ impl<DR: DataRef, B: Backend, A: GGLWEInfos> PrepareScratchSpace<B, A> for GLWET
|
||||
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 LWESw
|
||||
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 LWETo
|
||||
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> {
|
||||
|
||||
Reference in New Issue
Block a user