mirror of
https://github.com/arnaucube/phantom-zone.git
synced 2026-01-09 15:41:30 +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 {
|
fn sub(&self, a: &Self::Element, b: &Self::Element) -> Self::Element {
|
||||||
T::Element::wrapping_sub(a, b)
|
T::Element::wrapping_sub(a, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// fn modulus(&self) -> &T {
|
|
||||||
// &self.modulus
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> VectorOps for WordSizeModulus<T>
|
impl<T> VectorOps for WordSizeModulus<T>
|
||||||
@@ -420,3 +416,14 @@ where
|
|||||||
// &self.modulus
|
// &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 rand_distr::Uniform;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
backend::ModularOpsU64,
|
backend::{GetModulus, ModInit, ModularOpsU64, WordSizeModulus},
|
||||||
bool,
|
bool,
|
||||||
ntt::NttBackendU64,
|
ntt::NttBackendU64,
|
||||||
random::DEFAULT_RNG,
|
random::DEFAULT_RNG,
|
||||||
@@ -1922,10 +1922,12 @@ mod tests {
|
|||||||
*r = rng;
|
*r = rng;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// let mog = WordSizeModulus::<CiphertextModulus<u64>>::new(12u64);
|
||||||
|
|
||||||
let mut bool_evaluator = BoolEvaluator::<
|
let mut bool_evaluator = BoolEvaluator::<
|
||||||
Vec<Vec<u64>>,
|
Vec<Vec<u64>>,
|
||||||
NttBackendU64,
|
NttBackendU64,
|
||||||
ModularOpsU64<CiphertextModulus<u64>>,
|
WordSizeModulus<CiphertextModulus<u64>>,
|
||||||
ModularOpsU64<CiphertextModulus<u64>>,
|
ModularOpsU64<CiphertextModulus<u64>>,
|
||||||
>::new(SP_BOOL_PARAMS);
|
>::new(SP_BOOL_PARAMS);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user