arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/mod.rs
poulpy-schemes/src/tfhe/bdd_arithmetic/tests/test_suite/mod.rsRaw
 1mod add;
 2mod and;
 3mod ggsw_blind_rotations;
 4mod glwe_blind_rotation;
 5mod or;
 6mod prepare;
 7mod sll;
 8mod slt;
 9mod sltu;
10mod sra;
11mod srl;
12mod sub;
13mod xor;
14
15pub use add::*;
16pub use and::*;
17pub use ggsw_blind_rotations::*;
18pub use glwe_blind_rotation::*;
19pub use or::*;
20pub use prepare::*;
21pub use sll::*;
22pub use slt::*;
23pub use sltu::*;
24pub use sra::*;
25pub use srl::*;
26pub use sub::*;
27pub use xor::*;
28
29use poulpy_core::layouts::{
30    Base2K, Degree, Dnum, Dsize, GGSWLayout, GLWEAutomorphismKeyLayout, GLWELayout, GLWETensorKeyLayout, GLWEToLWEKeyLayout,
31    Rank, TorusPrecision,
32};
33
34use crate::tfhe::{
35    bdd_arithmetic::BDDKeyLayout, blind_rotation::BlindRotationKeyLayout, circuit_bootstrapping::CircuitBootstrappingKeyLayout,
36};
37
38pub(crate) const TEST_N_GLWE: u32 = 512;
39pub(crate) const TEST_N_LWE: u32 = 77;
40pub(crate) const TEST_BASE2K: u32 = 13;
41pub(crate) const TEST_K_GLWE: u32 = 26;
42pub(crate) const TEST_K_GGSW: u32 = 39;
43pub(crate) const TEST_BLOCK_SIZE: u32 = 7;
44pub(crate) const TEST_RANK: u32 = 2;
45
46pub(crate) static TEST_GLWE_INFOS: GLWELayout = GLWELayout {
47    n: Degree(TEST_N_GLWE),
48    base2k: Base2K(TEST_BASE2K),
49    k: TorusPrecision(TEST_K_GLWE),
50    rank: Rank(TEST_RANK),
51};
52
53pub(crate) static TEST_GGSW_INFOS: GGSWLayout = GGSWLayout {
54    n: Degree(TEST_N_GLWE),
55    base2k: Base2K(TEST_BASE2K),
56    k: TorusPrecision(TEST_K_GGSW),
57    rank: Rank(TEST_RANK),
58    dnum: Dnum(2),
59    dsize: Dsize(1),
60};
61
62pub(crate) static TEST_BDD_KEY_LAYOUT: BDDKeyLayout = BDDKeyLayout {
63    cbt: CircuitBootstrappingKeyLayout {
64        layout_brk: BlindRotationKeyLayout {
65            n_glwe: Degree(TEST_N_GLWE),
66            n_lwe: Degree(TEST_N_LWE),
67            base2k: Base2K(TEST_BASE2K),
68            k: TorusPrecision(52),
69            dnum: Dnum(3),
70            rank: Rank(TEST_RANK),
71        },
72        layout_atk: GLWEAutomorphismKeyLayout {
73            n: Degree(TEST_N_GLWE),
74            base2k: Base2K(TEST_BASE2K),
75            k: TorusPrecision(52),
76            rank: Rank(TEST_RANK),
77            dnum: Dnum(3),
78            dsize: Dsize(1),
79        },
80        layout_tsk: GLWETensorKeyLayout {
81            n: Degree(TEST_N_GLWE),
82            base2k: Base2K(TEST_BASE2K),
83            k: TorusPrecision(52),
84            rank: Rank(TEST_RANK),
85            dnum: Dnum(3),
86            dsize: Dsize(1),
87        },
88    },
89    ks: GLWEToLWEKeyLayout {
90        n: Degree(TEST_N_GLWE),
91        base2k: Base2K(TEST_BASE2K),
92        k: TorusPrecision(39),
93        rank_in: Rank(TEST_RANK),
94        dnum: Dnum(2),
95    },
96};