automorphism gglwe

This commit is contained in:
Jean-Philippe Bossuat
2025-10-16 10:52:55 +02:00
parent 3236e1be2c
commit bdd00b557f
6 changed files with 230 additions and 235 deletions

View File

@@ -6,6 +6,7 @@ use poulpy_hal::{
use crate::layouts::{
Base2K, Dnum, Dsize, GGLWEInfos, GLWE, GLWEInfos, GLWESwitchingKey, GLWESwitchingKeyAlloc, GLWESwitchingKeyToMut,
GLWESwitchingKeyToRef, LWEInfos, Rank, RingDegree, TorusPrecision,
prepared::{GetAutomorphismGaloisElement, SetAutomorphismGaloisElement},
};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
@@ -27,6 +28,18 @@ pub struct AutomorphismKey<D: Data> {
pub(crate) p: i64,
}
impl<D: DataMut> SetAutomorphismGaloisElement for AutomorphismKey<D> {
fn set_p(&mut self, p: i64) {
self.p = p
}
}
impl<D: DataRef> GetAutomorphismGaloisElement for AutomorphismKey<D> {
fn p(&self) -> i64 {
self.p
}
}
impl<D: Data> AutomorphismKey<D> {
pub fn p(&self) -> i64 {
self.p