conversions tests

This commit is contained in:
Pro7ech
2025-10-20 17:20:34 +02:00
parent 1e2478852e
commit d4c936e04c
9 changed files with 99 additions and 125 deletions

View File

@@ -4,7 +4,7 @@ use poulpy_hal::{
};
use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWE, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESwitchingKey,
Base2K, Degree, Dnum, Dsize, GGLWE, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESwitchingKey, GLWESwitchingKeyDegrees,
GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision,
};
@@ -217,3 +217,13 @@ impl<D: DataMut> GLWESwitchingKeyDegreesMut for GLWEToLWESwitchingKey<D> {
&mut self.0.output_degree
}
}
impl<D: DataRef> GLWESwitchingKeyDegrees for GLWEToLWESwitchingKey<D> {
fn input_degree(&self) -> &Degree {
&self.0.input_degree
}
fn output_degree(&self) -> &Degree {
&self.0.output_degree
}
}

View File

@@ -6,7 +6,7 @@ use poulpy_hal::{
};
use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWE, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESwitchingKey,
Base2K, Degree, Dnum, Dsize, GGLWE, GGLWEInfos, GGLWEToMut, GGLWEToRef, GLWEInfos, GLWESwitchingKey, GLWESwitchingKeyDegrees,
GLWESwitchingKeyDegreesMut, LWEInfos, Rank, TorusPrecision,
};
@@ -217,3 +217,13 @@ impl<D: DataMut> GLWESwitchingKeyDegreesMut for LWEToGLWESwitchingKey<D> {
&mut self.0.output_degree
}
}
impl<D: DataRef> GLWESwitchingKeyDegrees for LWEToGLWESwitchingKey<D> {
fn input_degree(&self) -> &Degree {
&self.0.input_degree
}
fn output_degree(&self) -> &Degree {
&self.0.output_degree
}
}

View File

@@ -206,3 +206,13 @@ impl<D: DataMut, B: Backend> GLWESwitchingKeyDegreesMut for GLWEToLWESwitchingKe
&mut self.0.output_degree
}
}
impl<D: DataRef, B: Backend> GLWESwitchingKeyDegrees for GLWEToLWESwitchingKeyPrepared<D, B> {
fn input_degree(&self) -> &Degree {
&self.0.input_degree
}
fn output_degree(&self) -> &Degree {
&self.0.output_degree
}
}