multiples fixes to base2k, including svp to take into account column interleaving

This commit is contained in:
Jean-Philippe Bossuat
2025-05-07 15:51:01 +02:00
parent 6ce525e5a1
commit 64874dbda8
12 changed files with 99 additions and 14 deletions

View File

@@ -52,6 +52,10 @@ impl<D: AsRef<[u8]>> ZnxView for ScalarZnxDft<D, FFT64> {
type Scalar = f64;
}
pub(crate) fn bytes_of_scalar_znx_dft<B: Backend>(module: &Module<B>, cols: usize) -> usize {
ScalarZnxDftOwned::bytes_of(module, cols)
}
impl<D: From<Vec<u8>>, B: Backend> ScalarZnxDft<D, B> {
pub(crate) fn bytes_of(module: &Module<B>, cols: usize) -> usize {
unsafe { svp::bytes_of_svp_ppol(module.ptr) as usize * cols }
@@ -79,6 +83,17 @@ impl<D: From<Vec<u8>>, B: Backend> ScalarZnxDft<D, B> {
}
}
impl<D, B: Backend> ScalarZnxDft<D, B> {
pub(crate) fn from_data(data: D, n: usize, cols: usize) -> Self {
Self {
data,
n,
cols,
_phantom: PhantomData,
}
}
}
pub type ScalarZnxDftOwned<B> = ScalarZnxDft<Vec<u8>, B>;
pub trait ScalarZnxDftToRef<B: Backend> {