Add BDD Arithmetic (#98)

* Added some circuit, evaluation + some layouts

* Refactor + memory reduction

* Rows -> Dnum, Digits -> Dsize

* fix #96 + glwe_packing (indirectly CBT)

* clippy
This commit is contained in:
Jean-Philippe Bossuat
2025-10-08 17:52:03 +02:00
committed by GitHub
parent 37e13b965c
commit 6357a05509
119 changed files with 15996 additions and 1659 deletions

View File

@@ -56,25 +56,25 @@ fn main() {
// LWE block binary key block size
let block_size: usize = 7;
// GGSW output number of rows
// GGSW output number of dnum
let rows_ggsw_res: usize = 2;
// GGSW output modulus
let k_ggsw_res: usize = (rows_ggsw_res + 1) * base2k;
// Blind rotation key GGSW number of rows
// Blind rotation key GGSW number of dnum
let rows_brk: usize = rows_ggsw_res + 1;
// Blind rotation key GGSW modulus
let k_brk: usize = (rows_brk + 1) * base2k;
// GGLWE automorphism keys number of rows
// GGLWE automorphism keys number of dnum
let rows_trace: usize = rows_ggsw_res + 1;
// GGLWE automorphism keys modulus
let k_trace: usize = (rows_trace + 1) * base2k;
// GGLWE tensor key number of rows
// GGLWE tensor key number of dnum
let rows_tsk: usize = rows_ggsw_res + 1;
// GGLWE tensor key modulus
@@ -86,23 +86,23 @@ fn main() {
n_lwe: n_lwe.into(),
base2k: base2k.into(),
k: k_brk.into(),
rows: rows_brk.into(),
dnum: rows_brk.into(),
rank: rank.into(),
},
layout_atk: GGLWEAutomorphismKeyLayout {
n: n_glwe.into(),
base2k: base2k.into(),
k: k_trace.into(),
rows: rows_trace.into(),
digits: 1_u32.into(),
dnum: rows_trace.into(),
dsize: 1_u32.into(),
rank: rank.into(),
},
layout_tsk: GGLWETensorKeyLayout {
n: n_glwe.into(),
base2k: base2k.into(),
k: k_tsk.into(),
rows: rows_tsk.into(),
digits: 1_u32.into(),
dnum: rows_tsk.into(),
dsize: 1_u32.into(),
rank: rank.into(),
},
};
@@ -111,8 +111,8 @@ fn main() {
n: n_glwe.into(),
base2k: base2k.into(),
k: k_ggsw_res.into(),
rows: rows_ggsw_res.into(),
digits: 1_u32.into(),
dnum: rows_ggsw_res.into(),
dsize: 1_u32.into(),
rank: rank.into(),
};