Ref. + AVX code & generic tests + benches (#85)

This commit is contained in:
Jean-Philippe Bossuat
2025-09-15 16:16:11 +02:00
committed by GitHub
parent 99b9e3e10e
commit 56dbd29c59
286 changed files with 27797 additions and 7270 deletions

View File

@@ -1,5 +1,5 @@
use poulpy_hal::{
api::{DFT, VecZnxDftAlloc, VecZnxDftAllocBytes},
api::{VecZnxDftAlloc, VecZnxDftAllocBytes, VecZnxDftApply},
layouts::{Backend, Data, DataMut, DataRef, Module, Scratch, VecZnxDft},
};
@@ -64,7 +64,7 @@ impl<B: Backend> GLWEPublicKeyPrepared<Vec<u8>, B> {
impl<D: DataRef, B: Backend> PrepareAlloc<B, GLWEPublicKeyPrepared<Vec<u8>, B>> for GLWEPublicKey<D>
where
Module<B>: VecZnxDftAlloc<B> + DFT<B>,
Module<B>: VecZnxDftAlloc<B> + VecZnxDftApply<B>,
{
fn prepare_alloc(&self, module: &Module<B>, scratch: &mut Scratch<B>) -> GLWEPublicKeyPrepared<Vec<u8>, B> {
let mut pk_prepared: GLWEPublicKeyPrepared<Vec<u8>, B> =
@@ -76,7 +76,7 @@ where
impl<DM: DataMut, DR: DataRef, B: Backend> Prepare<B, GLWEPublicKey<DR>> for GLWEPublicKeyPrepared<DM, B>
where
Module<B>: DFT<B>,
Module<B>: VecZnxDftApply<B>,
{
fn prepare(&mut self, module: &Module<B>, other: &GLWEPublicKey<DR>, _scratch: &mut Scratch<B>) {
#[cfg(debug_assertions)]
@@ -86,7 +86,7 @@ where
}
(0..self.cols()).for_each(|i| {
module.dft(1, 0, &mut self.data, i, &other.data, i);
module.vec_znx_dft_apply(1, 0, &mut self.data, i, &other.data, i);
});
self.k = other.k;
self.basek = other.basek;