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