fixed missing implementations

This commit is contained in:
Jean-Philippe Bossuat
2025-10-18 12:56:30 +02:00
parent 0b8dcb1f16
commit a84ad06086
50 changed files with 444 additions and 419 deletions

View File

@@ -5,7 +5,7 @@ use poulpy_hal::{
source::Source,
};
use crate::layouts::{Base2K, Dnum, Dsize, GLWE, GLWEInfos, GetRingDegree, LWEInfos, Rank, RingDegree, TorusPrecision};
use crate::layouts::{Base2K, Degree, Dnum, Dsize, GLWE, GLWEInfos, GetDegree, LWEInfos, Rank, TorusPrecision};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use std::fmt;
@@ -37,7 +37,7 @@ pub trait SetGGLWEInfos {
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub struct GGLWELayout {
pub n: RingDegree,
pub n: Degree,
pub base2k: Base2K,
pub k: TorusPrecision,
pub rank_in: Rank,
@@ -55,7 +55,7 @@ impl LWEInfos for GGLWELayout {
self.k
}
fn n(&self) -> RingDegree {
fn n(&self) -> Degree {
self.n
}
}
@@ -101,8 +101,8 @@ impl<D: Data> LWEInfos for GGLWE<D> {
self.k
}
fn n(&self) -> RingDegree {
RingDegree(self.data.n() as u32)
fn n(&self) -> Degree {
Degree(self.data.n() as u32)
}
fn size(&self) -> usize {
@@ -193,7 +193,7 @@ impl<D: DataMut> GGLWE<D> {
pub trait GGLWEAlloc
where
Self: GetRingDegree,
Self: GetDegree,
{
fn alloc_gglwe(
&self,
@@ -293,7 +293,7 @@ where
}
}
impl<B: Backend> GGLWEAlloc for Module<B> where Self: GetRingDegree {}
impl<B: Backend> GGLWEAlloc for Module<B> where Self: GetDegree {}
impl GGLWE<Vec<u8>> {
pub fn alloc_from_infos<A, M>(module: &M, infos: &A) -> Self