mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 21:26:41 +01:00
Fix compressed encryptions & add GGSW compressed encryption (#67)
* Added decompress test * updated encryption sampling & fixed bug in glwe -> lwe test * Added GGSW compressed encryption
This commit is contained in:
committed by
GitHub
parent
9aa4b1f1e2
commit
068470783e
@@ -192,6 +192,7 @@ impl<D: DataMut> GGLWECiphertextCompressed<D> {
|
||||
let basek: usize = self.basek();
|
||||
let k: usize = self.k();
|
||||
let rank_in: usize = self.rank_in();
|
||||
let cols: usize = self.rank_out() + 1;
|
||||
|
||||
let mut source_xa = Source::new(seed);
|
||||
|
||||
@@ -217,6 +218,7 @@ impl<D: DataMut> GGLWECiphertextCompressed<D> {
|
||||
self.basek(),
|
||||
self.k(),
|
||||
&mut self.at_mut(row_i, col_i).data,
|
||||
cols,
|
||||
true,
|
||||
Some((&tmp_pt, 0)),
|
||||
sk,
|
||||
|
||||
@@ -3,7 +3,7 @@ use backend::hal::{
|
||||
layouts::{Backend, Data, DataMut, DataRef, MatZnx, Module, ReaderFrom, WriterTo},
|
||||
};
|
||||
|
||||
use crate::{AutomorphismKey, GGLWECiphertext, GLWECiphertextCompressed, GLWESwitchingKey, GLWETensorKey, Infos};
|
||||
use crate::{AutomorphismKey, Decompress, GGLWECiphertext, GLWECiphertextCompressed, GLWESwitchingKey, GLWETensorKey, Infos};
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
@@ -169,8 +169,8 @@ impl<D: DataRef> WriterTo for GGLWECiphertextCompressed<D> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: DataMut> GGLWECiphertext<D> {
|
||||
pub fn decompress<DataOther: DataRef, B: Backend>(&mut self, module: &Module<B>, other: &GGLWECiphertextCompressed<DataOther>)
|
||||
impl<D: DataMut, B: Backend, DR: DataRef> Decompress<B, GGLWECiphertextCompressed<DR>> for GGLWECiphertext<D> {
|
||||
fn decompress(&mut self, module: &Module<B>, other: &GGLWECiphertextCompressed<DR>)
|
||||
where
|
||||
Module<B>: VecZnxFillUniform + VecZnxCopy,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user