mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 05:06:44 +01:00
wip
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use poulpy_hal::{
|
||||
api::{SvpPPolAlloc, SvpPPolAllocBytes, SvpPrepare},
|
||||
layouts::{Backend, Data, DataMut, DataRef, Module, Scratch, SvpPPol, ZnxInfos},
|
||||
layouts::{Backend, Data, DataMut, DataRef, Module, Scratch, SvpPPol, SvpPPolToMut, SvpPPolToRef, ZnxInfos},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@@ -113,3 +113,29 @@ where
|
||||
self.dist = other.dist
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GLWESecretPreparedToRef<B: Backend> {
|
||||
fn to_ref(&self) -> GLWESecretPrepared<&[u8], B>;
|
||||
}
|
||||
|
||||
impl<D: DataRef, B: Backend> GLWESecretPreparedToRef<B> for GLWESecretPrepared<D, B> {
|
||||
fn to_ref(&self) -> GLWESecretPrepared<&[u8], B> {
|
||||
GLWESecretPrepared {
|
||||
data: self.data.to_ref(),
|
||||
dist: self.dist,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GLWESecretPreparedToMut<B: Backend> {
|
||||
fn to_ref(&mut self) -> GLWESecretPrepared<&mut [u8], B>;
|
||||
}
|
||||
|
||||
impl<D: DataMut, B: Backend> GLWESecretPreparedToMut<B> for GLWESecretPrepared<D, B> {
|
||||
fn to_ref(&mut self) -> GLWESecretPrepared<&mut [u8], B> {
|
||||
GLWESecretPrepared {
|
||||
dist: self.dist,
|
||||
data: self.data.to_mut(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user