use crate::poly_array::PolynomialArray;
use crate::Plaintext;
mod sealed {
pub trait Sealed {}
impl Sealed for super::Sym {}
impl Sealed for super::Asym {}
impl Sealed for super::SymAsym {}
}
pub mod marker {
pub trait Sym: super::sealed::Sealed {}
pub trait Asym: super::sealed::Sealed {}
}
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Sym;
impl marker::Sym for Sym {}
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Asym;
impl marker::Asym for Asym {}
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct SymAsym;
impl marker::Sym for SymAsym {}
impl marker::Asym for SymAsym {}
pub struct AsymmetricComponents {
pub u: PolynomialArray,
pub e: PolynomialArray,
pub r: Plaintext,
}
impl AsymmetricComponents {
pub fn new(u: PolynomialArray, e: PolynomialArray, r: Plaintext) -> Self {
Self {
u,
e,
r,
}
}
}
pub struct SymmetricComponents {
pub e: PolynomialArray,
pub r: Plaintext,
}
impl SymmetricComponents {
pub fn new(e: PolynomialArray, r: Plaintext) -> Self {
Self {
e,
r,
}
}
}
impl core::fmt::Debug for AsymmetricComponents {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AsymmetricComponents")
.field("u", &"<ELIDED>")
.field("e", &"<ELIDED>")
.field("r", &"<ELIDED>")
.finish()
}
}
impl core::fmt::Debug for SymmetricComponents {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SymmetricComponents")
.field("e", &"<ELIDED>")
.field("r", &"<ELIDED>")
.finish()
}
}