VecZnx: added ring degree switching

This commit is contained in:
Jean-Philippe Bossuat
2025-01-31 12:01:28 +01:00
parent e10de441c6
commit 7704e14d45
6 changed files with 75 additions and 52 deletions

View File

@@ -1,3 +1,4 @@
use crate::Module;
use rand::seq::SliceRandom;
use rand_core::RngCore;
use rand_distr::{Distribution, WeightedIndex};
@@ -5,6 +6,12 @@ use sampling::source::Source;
pub struct Scalar(pub Vec<i64>);
impl Module {
pub fn new_scalar(&self) -> Scalar {
Scalar::new(self.n())
}
}
impl Scalar {
pub fn new(n: usize) -> Self {
Self(vec![i64::default(); Self::buffer_size(n)])