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, GGLWECiphertext, GGLWEInfos, GLWECiphertext, GLWEInfos, LWEInfos, Rank, TorusPrecision,
|
||||
Base2K, Degree, Dnum, Dsize, GGLWECiphertext, GGLWECiphertextToMut, GGLWEInfos, GLWECiphertext, GLWEInfos, LWEInfos, Rank,
|
||||
TorusPrecision,
|
||||
};
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
|
||||
@@ -180,6 +181,23 @@ impl GGLWESwitchingKey<Vec<u8>> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GGLWESwitchingKeyToMut {
|
||||
fn to_mut(&mut self) -> GGLWESwitchingKey<&mut [u8]>;
|
||||
}
|
||||
|
||||
impl<D: DataMut> GGLWESwitchingKeyToMut for GGLWESwitchingKey<D>
|
||||
where
|
||||
GGLWECiphertext<D>: GGLWECiphertextToMut,
|
||||
{
|
||||
fn to_mut(&mut self) -> GGLWESwitchingKey<&mut [u8]> {
|
||||
GGLWESwitchingKey {
|
||||
key: self.key.to_mut(),
|
||||
sk_in_n: self.sk_in_n,
|
||||
sk_out_n: self.sk_out_n,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: DataRef> GGLWESwitchingKey<D> {
|
||||
pub fn at(&self, row: usize, col: usize) -> GLWECiphertext<&[u8]> {
|
||||
self.key.at(row, col)
|
||||
|
||||
Reference in New Issue
Block a user