mirror of
https://github.com/arnaucube/phantom-zone.git
synced 2026-01-07 22:51:29 +01:00
impl GetModulus for WordSizeModulus
This commit is contained in:
@@ -345,10 +345,6 @@ where
|
||||
fn sub(&self, a: &Self::Element, b: &Self::Element) -> Self::Element {
|
||||
T::Element::wrapping_sub(a, b)
|
||||
}
|
||||
|
||||
// fn modulus(&self) -> &T {
|
||||
// &self.modulus
|
||||
// }
|
||||
}
|
||||
|
||||
impl<T> VectorOps for WordSizeModulus<T>
|
||||
@@ -420,3 +416,14 @@ where
|
||||
// &self.modulus
|
||||
// }
|
||||
}
|
||||
|
||||
impl<T> GetModulus for WordSizeModulus<T>
|
||||
where
|
||||
T: Modulus,
|
||||
{
|
||||
type Element = T::Element;
|
||||
type M = T;
|
||||
fn modulus(&self) -> &Self::M {
|
||||
&self.modulus
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1881,7 +1881,7 @@ mod tests {
|
||||
use rand_distr::Uniform;
|
||||
|
||||
use crate::{
|
||||
backend::ModularOpsU64,
|
||||
backend::{GetModulus, ModInit, ModularOpsU64, WordSizeModulus},
|
||||
bool,
|
||||
ntt::NttBackendU64,
|
||||
random::DEFAULT_RNG,
|
||||
@@ -1922,10 +1922,12 @@ mod tests {
|
||||
*r = rng;
|
||||
});
|
||||
|
||||
// let mog = WordSizeModulus::<CiphertextModulus<u64>>::new(12u64);
|
||||
|
||||
let mut bool_evaluator = BoolEvaluator::<
|
||||
Vec<Vec<u64>>,
|
||||
NttBackendU64,
|
||||
ModularOpsU64<CiphertextModulus<u64>>,
|
||||
WordSizeModulus<CiphertextModulus<u64>>,
|
||||
ModularOpsU64<CiphertextModulus<u64>>,
|
||||
>::new(SP_BOOL_PARAMS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user