mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 21:26:41 +01:00
fixed missing implementations
This commit is contained in:
@@ -8,7 +8,7 @@ use std::{fmt, marker::PhantomData};
|
||||
use poulpy_core::{
|
||||
Distribution,
|
||||
layouts::{
|
||||
Base2K, Dnum, Dsize, GGSW, GGSWInfos, GLWEInfos, LWEInfos, LWESecret, Rank, RingDegree, TorusPrecision,
|
||||
Base2K, Degree, Dnum, Dsize, GGSW, GGSWInfos, GLWEInfos, LWEInfos, LWESecret, Rank, TorusPrecision,
|
||||
prepared::GLWESecretPrepared,
|
||||
},
|
||||
};
|
||||
@@ -19,8 +19,8 @@ use crate::tfhe::blind_rotation::BlindRotationAlgo;
|
||||
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||
pub struct BlindRotationKeyLayout {
|
||||
pub n_glwe: RingDegree,
|
||||
pub n_lwe: RingDegree,
|
||||
pub n_glwe: Degree,
|
||||
pub n_lwe: Degree,
|
||||
pub base2k: Base2K,
|
||||
pub k: TorusPrecision,
|
||||
pub dnum: Dnum,
|
||||
@@ -28,11 +28,11 @@ pub struct BlindRotationKeyLayout {
|
||||
}
|
||||
|
||||
impl BlindRotationKeyInfos for BlindRotationKeyLayout {
|
||||
fn n_glwe(&self) -> RingDegree {
|
||||
fn n_glwe(&self) -> Degree {
|
||||
self.n_glwe
|
||||
}
|
||||
|
||||
fn n_lwe(&self) -> RingDegree {
|
||||
fn n_lwe(&self) -> Degree {
|
||||
self.n_lwe
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ impl LWEInfos for BlindRotationKeyLayout {
|
||||
self.k
|
||||
}
|
||||
|
||||
fn n(&self) -> RingDegree {
|
||||
fn n(&self) -> Degree {
|
||||
self.n_glwe
|
||||
}
|
||||
}
|
||||
@@ -71,8 +71,8 @@ pub trait BlindRotationKeyInfos
|
||||
where
|
||||
Self: GGSWInfos,
|
||||
{
|
||||
fn n_glwe(&self) -> RingDegree;
|
||||
fn n_lwe(&self) -> RingDegree;
|
||||
fn n_glwe(&self) -> Degree;
|
||||
fn n_lwe(&self) -> Degree;
|
||||
}
|
||||
|
||||
pub trait BlindRotationKeyAlloc {
|
||||
@@ -178,12 +178,12 @@ impl<D: DataRef, BRT: BlindRotationAlgo> WriterTo for BlindRotationKey<D, BRT> {
|
||||
}
|
||||
|
||||
impl<D: DataRef, BRT: BlindRotationAlgo> BlindRotationKeyInfos for BlindRotationKey<D, BRT> {
|
||||
fn n_glwe(&self) -> RingDegree {
|
||||
fn n_glwe(&self) -> Degree {
|
||||
self.n()
|
||||
}
|
||||
|
||||
fn n_lwe(&self) -> RingDegree {
|
||||
RingDegree(self.keys.len() as u32)
|
||||
fn n_lwe(&self) -> Degree {
|
||||
Degree(self.keys.len() as u32)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ impl<D: DataRef, BRT: BlindRotationAlgo> LWEInfos for BlindRotationKey<D, BRT> {
|
||||
self.keys[0].k()
|
||||
}
|
||||
|
||||
fn n(&self) -> RingDegree {
|
||||
fn n(&self) -> Degree {
|
||||
self.keys[0].n()
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::{fmt, marker::PhantomData};
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use poulpy_core::{
|
||||
Distribution,
|
||||
layouts::{Base2K, Dsize, GGSWInfos, GLWEInfos, LWEInfos, RingDegree, TorusPrecision, compressed::GGSWCompressed},
|
||||
layouts::{Base2K, Degree, Dsize, GGSWInfos, GLWEInfos, LWEInfos, TorusPrecision, compressed::GGSWCompressed},
|
||||
};
|
||||
|
||||
use crate::tfhe::blind_rotation::{BlindRotationAlgo, BlindRotationKeyInfos};
|
||||
@@ -94,17 +94,17 @@ impl<D: DataRef, BRT: BlindRotationAlgo> WriterTo for BlindRotationKeyCompressed
|
||||
}
|
||||
|
||||
impl<D: DataRef, BRA: BlindRotationAlgo> BlindRotationKeyInfos for BlindRotationKeyCompressed<D, BRA> {
|
||||
fn n_glwe(&self) -> RingDegree {
|
||||
fn n_glwe(&self) -> Degree {
|
||||
self.n()
|
||||
}
|
||||
|
||||
fn n_lwe(&self) -> RingDegree {
|
||||
RingDegree(self.keys.len() as u32)
|
||||
fn n_lwe(&self) -> Degree {
|
||||
Degree(self.keys.len() as u32)
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: DataRef, BRA: BlindRotationAlgo> LWEInfos for BlindRotationKeyCompressed<D, BRA> {
|
||||
fn n(&self) -> RingDegree {
|
||||
fn n(&self) -> Degree {
|
||||
self.keys[0].n()
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::marker::PhantomData;
|
||||
use poulpy_core::{
|
||||
Distribution,
|
||||
layouts::{
|
||||
Base2K, Dnum, Dsize, GGSWInfos, GLWEInfos, LWEInfos, Rank, RingDegree, TorusPrecision,
|
||||
Base2K, Degree, Dnum, Dsize, GGSWInfos, GLWEInfos, LWEInfos, Rank, TorusPrecision,
|
||||
prepared::{GGSWPrepared, Prepare, PrepareAlloc},
|
||||
},
|
||||
};
|
||||
@@ -30,12 +30,12 @@ pub struct BlindRotationKeyPrepared<D: Data, BRT: BlindRotationAlgo, B: Backend>
|
||||
}
|
||||
|
||||
impl<D: Data, BRT: BlindRotationAlgo, B: Backend> BlindRotationKeyInfos for BlindRotationKeyPrepared<D, BRT, B> {
|
||||
fn n_glwe(&self) -> RingDegree {
|
||||
fn n_glwe(&self) -> Degree {
|
||||
self.n()
|
||||
}
|
||||
|
||||
fn n_lwe(&self) -> RingDegree {
|
||||
RingDegree(self.data.len() as u32)
|
||||
fn n_lwe(&self) -> Degree {
|
||||
Degree(self.data.len() as u32)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ impl<D: Data, BRT: BlindRotationAlgo, B: Backend> LWEInfos for BlindRotationKeyP
|
||||
self.data[0].k()
|
||||
}
|
||||
|
||||
fn n(&self) -> RingDegree {
|
||||
fn n(&self) -> Degree {
|
||||
self.data[0].n()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user