mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
wip
This commit is contained in:
@@ -4,7 +4,8 @@ use poulpy_hal::{
|
||||
};
|
||||
|
||||
use crate::layouts::{
|
||||
Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWESwitchingKey, GLWECiphertext, GLWEInfos, LWEInfos, Rank, TorusPrecision,
|
||||
Base2K, Degree, Dnum, Dsize, GGLWEInfos, GGLWESwitchingKey, GGLWESwitchingKeyToMut, GLWECiphertext, GLWEInfos, LWEInfos,
|
||||
Rank, TorusPrecision,
|
||||
};
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
|
||||
@@ -170,6 +171,26 @@ impl GGLWEAutomorphismKey<Vec<u8>> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GGLWEAutomorphismKeyToMut {
|
||||
fn to_mut(&mut self) -> GGLWEAutomorphismKey<&mut [u8]>;
|
||||
}
|
||||
|
||||
impl<D: DataMut> GGLWEAutomorphismKeyToMut for GGLWEAutomorphismKey<D>
|
||||
where
|
||||
GGLWESwitchingKey<D>: GGLWESwitchingKeyToMut,
|
||||
{
|
||||
fn to_mut(&mut self) -> GGLWEAutomorphismKey<&mut [u8]> {
|
||||
GGLWEAutomorphismKey {
|
||||
key: self.key.to_mut(),
|
||||
p: self.p,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GGLWEAutomorphismKeyToRef {
|
||||
fn to_ref(&self) -> GGLWEAutomorphismKey<&[u8]>;
|
||||
}
|
||||
|
||||
impl<D: DataRef> GGLWEAutomorphismKey<D> {
|
||||
pub fn at(&self, row: usize, col: usize) -> GLWECiphertext<&[u8]> {
|
||||
self.key.at(row, col)
|
||||
|
||||
Reference in New Issue
Block a user