Enforce extension factor to be a power of two

This commit is contained in:
Jean-Philippe Bossuat
2025-07-08 13:54:20 +02:00
parent af5bbbb55d
commit 2e0e7e11b4
2 changed files with 8 additions and 1 deletions

View File

@@ -82,7 +82,6 @@ pub fn cggi_blind_rotate<DataRes, DataIn>(
}
}
// TODO: ENSURE DOMAIN EXTENSION AS
pub(crate) fn cggi_blind_rotate_block_binary_extended<DataRes, DataIn>(
module: &Module<FFT64>,
res: &mut GLWECiphertext<DataRes>,

View File

@@ -8,6 +8,14 @@ pub struct LookUpTable {
impl LookUpTable {
pub fn alloc(module: &Module<FFT64>, basek: usize, k: usize, extension_factor: usize) -> Self {
#[cfg(debug_assertions)]
{
assert!(
extension_factor & (extension_factor - 1) == 0,
"extension_factor must be a power of two but is: {}",
extension_factor
);
}
let size: usize = k.div_ceil(basek);
let mut data: Vec<VecZnx<Vec<u8>>> = Vec::with_capacity(extension_factor);
(0..extension_factor).for_each(|_| {