rewrote all bindings, removed dependency on binding generation

This commit is contained in:
Jean-Philippe Bossuat
2025-01-30 17:34:57 +01:00
parent a7af4d6d1f
commit d3a8d20647
25 changed files with 1040 additions and 189 deletions

35
base2k/src/ffi/svp.rs Normal file
View File

@@ -0,0 +1,35 @@
use crate::ffi::module::MODULE;
use crate::ffi::vec_znx_dft::VEC_ZNX_DFT;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct svp_ppol_t {
_unused: [u8; 0],
}
pub type SVP_PPOL = svp_ppol_t;
unsafe extern "C" {
pub unsafe fn bytes_of_svp_ppol(module: *const MODULE) -> u64;
}
unsafe extern "C" {
pub unsafe fn new_svp_ppol(module: *const MODULE) -> *mut SVP_PPOL;
}
unsafe extern "C" {
pub unsafe fn delete_svp_ppol(res: *mut SVP_PPOL);
}
unsafe extern "C" {
pub unsafe fn svp_prepare(module: *const MODULE, ppol: *mut SVP_PPOL, pol: *const i64);
}
unsafe extern "C" {
pub unsafe fn svp_apply_dft(
module: *const MODULE,
res: *const VEC_ZNX_DFT,
res_size: u64,
ppol: *const SVP_PPOL,
a: *const i64,
a_size: u64,
a_sl: u64,
);
}