use crate::{ hal::{ api::{ZnxInfos, ZnxSliceSize, ZnxView}, layouts::{Data, DataRef, SvpPPol, SvpPPolBytesOf, SvpPPolOwned}, oep::{SvpPPolAllocBytesImpl, SvpPPolAllocImpl, SvpPPolFromBytesImpl}, }, implementation::cpu_spqlios::module_ntt120::NTT120, }; const SVP_PPOL_NTT120_WORD_SIZE: usize = 4; impl SvpPPolBytesOf for SvpPPol { fn bytes_of(n: usize, cols: usize) -> usize { SVP_PPOL_NTT120_WORD_SIZE * n * cols * size_of::() } } impl ZnxSliceSize for SvpPPol { fn sl(&self) -> usize { SVP_PPOL_NTT120_WORD_SIZE * self.n() } } impl ZnxView for SvpPPol { type Scalar = i64; } unsafe impl SvpPPolFromBytesImpl for NTT120 { fn svp_ppol_from_bytes_impl(n: usize, cols: usize, bytes: Vec) -> SvpPPolOwned { SvpPPolOwned::from_bytes(n, cols, bytes) } } unsafe impl SvpPPolAllocImpl for NTT120 { fn svp_ppol_alloc_impl(n: usize, cols: usize) -> SvpPPolOwned { SvpPPolOwned::alloc(n, cols) } } unsafe impl SvpPPolAllocBytesImpl for NTT120 { fn svp_ppol_alloc_bytes_impl(n: usize, cols: usize) -> usize { SvpPPol::, Self>::bytes_of(n, cols) } }