Browse Source

impl GetModulus for WordSizeModulus

par-agg-key-shares
Janmajaya Mall 11 months ago
parent
commit
28216110b2
2 changed files with 15 additions and 6 deletions
  1. +11
    -4
      src/backend.rs
  2. +4
    -2
      src/bool/evaluator.rs

+ 11
- 4
src/backend.rs

@ -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
}
}

+ 4
- 2
src/bool/evaluator.rs

@ -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);

Loading…
Cancel
Save