mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 14:47:56 -05:00
chore(shortint): update classic gaussian param
This commit is contained in:
committed by
Nicolas Sarlin
parent
58801cf7a5
commit
8ee1bdd9a9
@@ -1,6 +1,6 @@
|
||||
use criterion::Criterion;
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::shortint::prelude::*;
|
||||
use tfhe::{generate_keys, ConfigBuilder, FheUint64};
|
||||
use tfhe_trivium::{KreyviumStreamShortint, TransCiphering};
|
||||
@@ -12,7 +12,7 @@ pub fn kreyvium_shortint_warmup(c: &mut Criterion) {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
@@ -63,7 +63,7 @@ pub fn kreyvium_shortint_gen(c: &mut Criterion) {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
@@ -109,7 +109,7 @@ pub fn kreyvium_shortint_trans(c: &mut Criterion) {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use criterion::Criterion;
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::shortint::prelude::*;
|
||||
use tfhe::{generate_keys, ConfigBuilder, FheUint64};
|
||||
use tfhe_trivium::{TransCiphering, TriviumStreamShortint};
|
||||
@@ -12,7 +12,7 @@ pub fn trivium_shortint_warmup(c: &mut Criterion) {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
@@ -63,7 +63,7 @@ pub fn trivium_shortint_gen(c: &mut Criterion) {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
@@ -109,7 +109,7 @@ pub fn trivium_shortint_trans(c: &mut Criterion) {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{KreyviumStream, KreyviumStreamByte, KreyviumStreamShortint, TransCiphering};
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::{generate_keys, ConfigBuilder, FheBool, FheUint64, FheUint8};
|
||||
// Values for these tests come from the github repo renaud1239/Kreyvium,
|
||||
// commit fd6828f68711276c25f55e605935028f5e843f43
|
||||
@@ -222,7 +222,7 @@ fn kreyvium_test_shortint_long() {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{TransCiphering, TriviumStream, TriviumStreamByte, TriviumStreamShortint};
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
use tfhe::{generate_keys, ConfigBuilder, FheBool, FheUint64, FheUint8};
|
||||
// Values for these tests come from the github repo cantora/avr-crypto-lib, commit 2a5b018,
|
||||
// file testvectors/trivium-80.80.test-vectors
|
||||
@@ -358,7 +358,7 @@ fn trivium_test_shortint_long() {
|
||||
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into();
|
||||
|
||||
let (client_key, server_key): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ksk = KeySwitchingKey::new(
|
||||
(&client_key, Some(&server_key)),
|
||||
|
||||
@@ -237,7 +237,7 @@ TEST_P(ClassicalProgrammableBootstrapTestPrimitives_u64, bootstrap) {
|
||||
(ClassicalProgrammableBootstrapTestParams){
|
||||
887, 1, 2048, new_t_uniform(46), new_t_uniform(17), 22, 1, 4, 4,
|
||||
100, 1, 1},
|
||||
// PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64
|
||||
// V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64
|
||||
(ClassicalProgrammableBootstrapTestParams){
|
||||
977, 1, 8192, new_gaussian_from_std_dev(3.0144389706858286e-07),
|
||||
new_gaussian_from_std_dev(2.168404344971009e-19), 16, 2, 8, 8, 100,
|
||||
|
||||
@@ -9,8 +9,10 @@ use tfhe::core_crypto::prelude::*;
|
||||
use tfhe::keycache::NamedParam;
|
||||
use tfhe::shortint::parameters::{
|
||||
COMP_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
#[cfg(feature = "gpu")]
|
||||
use tfhe::shortint::parameters::{
|
||||
@@ -21,13 +23,13 @@ use tfhe::shortint::parameters::{
|
||||
};
|
||||
#[cfg(not(feature = "gpu"))]
|
||||
use tfhe::shortint::parameters::{
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
use tfhe::shortint::prelude::*;
|
||||
use tfhe::shortint::{MultiBitPBSParameters, PBSParameters};
|
||||
@@ -35,18 +37,18 @@ use tfhe::shortint::{MultiBitPBSParameters, PBSParameters};
|
||||
#[cfg(not(feature = "gpu"))]
|
||||
const SHORTINT_BENCH_PARAMS: [ClassicPBSParameters; 5] = [
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
|
||||
#[cfg(feature = "gpu")]
|
||||
const SHORTINT_BENCH_PARAMS: [ClassicPBSParameters; 4] = [
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
|
||||
#[cfg(not(feature = "gpu"))]
|
||||
|
||||
@@ -17,10 +17,10 @@ const SHORTINT_BENCH_PARAMS_TUNIFORM: [ClassicPBSParameters; 1] =
|
||||
[PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64];
|
||||
|
||||
const SHORTINT_BENCH_PARAMS_GAUSSIAN: [ClassicPBSParameters; 4] = [
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
|
||||
const BOOLEAN_BENCH_PARAMS: [(&str, BooleanParameters); 2] = [
|
||||
@@ -57,17 +57,17 @@ fn throughput_benchmark_parameters_64bits() -> Vec<(String, CryptoParametersReco
|
||||
let parameters = if cfg!(feature = "gpu") {
|
||||
vec![
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
]
|
||||
} else {
|
||||
vec![
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
]
|
||||
};
|
||||
|
||||
@@ -832,13 +832,20 @@ mod cuda {
|
||||
use tfhe::core_crypto::prelude::*;
|
||||
use tfhe::keycache::NamedParam;
|
||||
use tfhe::shortint::parameters::{
|
||||
PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
use tfhe::shortint::{ClassicPBSParameters, PBSParameters};
|
||||
|
||||
@@ -846,19 +853,19 @@ mod cuda {
|
||||
// TUniform
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// Gaussian
|
||||
PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
|
||||
fn cuda_benchmark_parameters_64bits() -> Vec<(String, CryptoParametersRecord<u64>)> {
|
||||
|
||||
@@ -12,29 +12,29 @@ use tfhe::shortint::{Ciphertext, CompressedServerKey, ServerKey};
|
||||
|
||||
const SERVER_KEY_BENCH_PARAMS: [ClassicPBSParameters; 5] = [
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
|
||||
const SERVER_KEY_BENCH_PARAMS_EXTENDED: [ClassicPBSParameters; 16] = [
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
|
||||
const SERVER_KEY_MULTI_BIT_BENCH_PARAMS: [MultiBitPBSParameters; 2] = [
|
||||
|
||||
@@ -2,7 +2,8 @@ use crate::utilities::{write_to_json, OperatorType};
|
||||
use criterion::Criterion;
|
||||
use rayon::prelude::*;
|
||||
use tfhe::shortint::parameters::{
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
use tfhe::shortint::prelude::*;
|
||||
|
||||
@@ -11,9 +12,9 @@ pub fn pack_cast_64(c: &mut Criterion) {
|
||||
let mut bench_group = c.benchmark_group(bench_name);
|
||||
|
||||
let (client_key_1, server_key_1): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
let (client_key_2, server_key_2): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ks_param = PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS;
|
||||
let ks_param_name = "PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS";
|
||||
@@ -62,9 +63,9 @@ pub fn pack_cast(c: &mut Criterion) {
|
||||
let mut bench_group = c.benchmark_group(bench_name);
|
||||
|
||||
let (client_key_1, server_key_1): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
let (client_key_2, server_key_2): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ks_param = PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS;
|
||||
let ks_param_name = "PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS";
|
||||
@@ -103,9 +104,9 @@ pub fn cast(c: &mut Criterion) {
|
||||
let mut bench_group = c.benchmark_group(bench_name);
|
||||
|
||||
let (client_key_1, server_key_1): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
|
||||
let (client_key_2, server_key_2): (ClientKey, ServerKey) =
|
||||
gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
let ks_param = PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS;
|
||||
let ks_param_name = "PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS";
|
||||
|
||||
@@ -215,7 +215,7 @@ int main(void) {
|
||||
|
||||
config_builder_default(&builder);
|
||||
config_builder_use_custom_parameters(&builder,
|
||||
SHORTINT_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64);
|
||||
SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64);
|
||||
config_builder_build(builder, &config);
|
||||
|
||||
ClientKey *client_key = NULL;
|
||||
@@ -243,7 +243,7 @@ int main(void) {
|
||||
|
||||
config_builder_default(&builder);
|
||||
config_builder_use_custom_parameters(&builder,
|
||||
SHORTINT_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
config_builder_build(builder, &config);
|
||||
|
||||
ClientKey *client_key = NULL;
|
||||
|
||||
@@ -647,7 +647,7 @@ int main(void) {
|
||||
assert(ok == 0);
|
||||
// Then use small parameters, those are gaussians as we don't have small TUniform params
|
||||
ok = config_builder_use_custom_parameters(
|
||||
&builder, SHORTINT_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64);
|
||||
&builder, SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64);
|
||||
ok = config_builder_build(builder, &config);
|
||||
assert(ok == 0);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ void test_predefined_keygen_w_serde(void) {
|
||||
ShortintCompressedCiphertext *cct = NULL;
|
||||
ShortintCompressedCiphertext *deser_cct = NULL;
|
||||
ShortintCiphertext *decompressed_ct = NULL;
|
||||
ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
ShortintPBSParameters params = SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
|
||||
int gen_keys_ok = shortint_gen_keys_with_parameters(params, &cks, &sks);
|
||||
assert(gen_keys_ok == 0);
|
||||
@@ -79,7 +79,7 @@ void test_server_key_trivial_encrypt(void) {
|
||||
ShortintClientKey *cks = NULL;
|
||||
ShortintServerKey *sks = NULL;
|
||||
ShortintCiphertext *ct = NULL;
|
||||
ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
ShortintPBSParameters params = SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
|
||||
int gen_keys_ok = shortint_gen_keys_with_parameters(params, &cks, &sks);
|
||||
assert(gen_keys_ok == 0);
|
||||
@@ -219,10 +219,10 @@ void test_compressed_public_keygen(ShortintPBSParameters params) {
|
||||
int main(void) {
|
||||
test_predefined_keygen_w_serde();
|
||||
test_custom_keygen();
|
||||
test_public_keygen(SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
test_public_keygen(SHORTINT_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64);
|
||||
test_compressed_public_keygen(SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
test_compressed_public_keygen(SHORTINT_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64);
|
||||
test_public_keygen(SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
test_public_keygen(SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64);
|
||||
test_compressed_public_keygen(SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
test_compressed_public_keygen(SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64);
|
||||
test_server_key_trivial_encrypt();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void test_shortint_pbs_2_bits_message(void) {
|
||||
ShortintPBSLookupTable *lookup_table = NULL;
|
||||
ShortintClientKey *cks = NULL;
|
||||
ShortintServerKey *sks = NULL;
|
||||
ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
ShortintPBSParameters params = SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
|
||||
int gen_keys_ok = shortint_gen_keys_with_parameters(params, &cks, &sks);
|
||||
assert(gen_keys_ok == 0);
|
||||
@@ -115,7 +115,7 @@ void test_shortint_bivariate_pbs_2_bits_message(void) {
|
||||
ShortintBivariatePBSLookupTable *lookup_table = NULL;
|
||||
ShortintClientKey *cks = NULL;
|
||||
ShortintServerKey *sks = NULL;
|
||||
ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
ShortintPBSParameters params = SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
|
||||
int gen_keys_ok = shortint_gen_keys_with_parameters(params, &cks, &sks);
|
||||
assert(gen_keys_ok == 0);
|
||||
|
||||
@@ -541,7 +541,7 @@ void test_server_key(void) {
|
||||
|
||||
ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
|
||||
// We don't have TUniform small params, use gaussian instead
|
||||
ShortintPBSParameters params_small = SHORTINT_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
ShortintPBSParameters params_small = SHORTINT_V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
|
||||
assert(params.message_modulus == 1 << message_bits);
|
||||
assert(params.carry_modulus == 1 << carry_bits);
|
||||
|
||||
@@ -55,7 +55,7 @@ Here is a more complete example:
|
||||
use tfhe::conformance::ParameterSetConformant;
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::safe_serialization::{safe_serialize, safe_deserialize_conformant};
|
||||
use tfhe::shortint::parameters::{PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64};
|
||||
use tfhe::shortint::parameters::{PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64};
|
||||
use tfhe::conformance::ListSizeConstraint;
|
||||
use tfhe::{
|
||||
generate_keys, FheUint8, CompactCiphertextList, FheUint8ConformanceParams,
|
||||
@@ -64,7 +64,7 @@ use tfhe::{
|
||||
|
||||
fn main() {
|
||||
let params_1 = PARAM_MESSAGE_2_CARRY_2_KS_PBS;
|
||||
let params_2 = PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_2 = V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
|
||||
let config = ConfigBuilder::with_custom_parameters(params_1).build();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ function fhe_uint32_example() {
|
||||
// the error message will be displayed in the console
|
||||
init_panic_hook();
|
||||
|
||||
const block_params = new ShortintParameters(ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
const block_params = new ShortintParameters(ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
let config = TfheConfigBuilder.default()
|
||||
.build();
|
||||
|
||||
@@ -79,7 +79,7 @@ async function example() {
|
||||
await initThreadPool(navigator.hardwareConcurrency);
|
||||
await init_panic_hook();
|
||||
|
||||
const block_params = new ShortintParameters(ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
const block_params = new ShortintParameters(ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
// ....
|
||||
}
|
||||
```
|
||||
|
||||
@@ -25,14 +25,20 @@ use tfhe::shortint::parameters::multi_bit::gaussian::p_fail_2_minus_64::ks_pbs::
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
use tfhe::shortint::parameters::{
|
||||
ClassicPBSParameters, PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
ClassicPBSParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
#[cfg(feature = "experimental")]
|
||||
use tfhe::shortint::parameters::{
|
||||
@@ -102,13 +108,13 @@ fn client_server_keys() {
|
||||
ShortintKeySwitchingParameters,
|
||||
); 2] = [
|
||||
(
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS,
|
||||
),
|
||||
(
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS,
|
||||
),
|
||||
];
|
||||
@@ -118,7 +124,7 @@ fn client_server_keys() {
|
||||
#[cfg(feature = "experimental")]
|
||||
{
|
||||
const WOPBS_PARAMS: [(ClassicPBSParameters, WopbsParameters); 1] = [(
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS,
|
||||
)];
|
||||
generate_wopbs_keys(&WOPBS_PARAMS);
|
||||
@@ -132,19 +138,19 @@ fn client_server_keys() {
|
||||
// TUniform
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// Gaussian
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
];
|
||||
generate_pbs_keys(&PBS_KEYS);
|
||||
|
||||
@@ -152,19 +158,19 @@ fn client_server_keys() {
|
||||
{
|
||||
const WOPBS_PARAMS: [(ClassicPBSParameters, WopbsParameters); 4] = [
|
||||
(
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
LEGACY_WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS,
|
||||
),
|
||||
(
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS,
|
||||
),
|
||||
(
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
LEGACY_WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
),
|
||||
(
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
LEGACY_WOPBS_PARAM_MESSAGE_4_CARRY_4_KS_PBS,
|
||||
),
|
||||
];
|
||||
|
||||
@@ -15,15 +15,17 @@ use tfhe::shortint::parameters::{
|
||||
PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
use tfhe::shortint::{
|
||||
ClassicPBSParameters, ClientKey, CompactPrivateKey, CompressedCompactPublicKey,
|
||||
@@ -39,10 +41,10 @@ fn write_result(file: &mut File, name: &str, value: usize) {
|
||||
fn client_server_key_sizes(results_file: &Path) {
|
||||
let shortint_params_vec: Vec<PBSParameters> = vec![
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64.into(),
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
|
||||
@@ -10,11 +10,11 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
use tfhe::keycache::NamedParam;
|
||||
use tfhe::shortint::keycache::{
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64_NAME,
|
||||
PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64_NAME,
|
||||
PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64_NAME,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64_NAME,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64_NAME,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64_NAME,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64_NAME,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64_NAME,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64_NAME,
|
||||
};
|
||||
use tfhe::shortint::parameters::classic::compact_pk::{
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -22,7 +22,8 @@ use tfhe::shortint::parameters::classic::compact_pk::{
|
||||
};
|
||||
use tfhe::shortint::parameters::classic::tuniform::p_fail_2_minus_64::ks_pbs::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
|
||||
use tfhe::shortint::parameters::{
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
use tfhe::shortint::{ClassicPBSParameters, PBSParameters};
|
||||
|
||||
@@ -36,17 +37,17 @@ struct Args {
|
||||
|
||||
fn params_from_name(name: &str) -> ClassicPBSParameters {
|
||||
match name.to_uppercase().as_str() {
|
||||
PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64_NAME => {
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64_NAME => {
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64
|
||||
}
|
||||
PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64_NAME => {
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64_NAME => {
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64
|
||||
}
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64_NAME => {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64_NAME => {
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64
|
||||
}
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64_NAME => {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64_NAME => {
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
|
||||
}
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64_NAME => {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64
|
||||
|
||||
@@ -87,7 +87,7 @@ test('hlapi_compressed_public_client_int8_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_public_key_encrypt_decrypt_int32_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -111,7 +111,7 @@ test('hlapi_public_key_encrypt_decrypt_int32_small', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_decompress_public_key_then_encrypt_decrypt_int32_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -184,7 +184,7 @@ test('hlapi_client_key_encrypt_decrypt_int128_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_client_key_encrypt_decrypt_int128_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -272,7 +272,7 @@ test('hlapi_client_key_encrypt_decrypt_int256_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_client_key_encrypt_decrypt_int256_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -321,7 +321,7 @@ test('hlapi_client_key_encrypt_decrypt_int256_small', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_decompress_public_key_then_encrypt_decrypt_int256_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -348,7 +348,7 @@ test('hlapi_decompress_public_key_then_encrypt_decrypt_int256_small', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_public_key_encrypt_decrypt_int256_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -401,7 +401,7 @@ function hlapi_compact_public_key_encrypt_decrypt_int32_single(config) {
|
||||
}
|
||||
|
||||
test('hlapi_compact_public_key_encrypt_decrypt_int32_big_single', (t) => {
|
||||
const block_params = new ShortintParameters(ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64);
|
||||
const block_params = new ShortintParameters(ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64);
|
||||
let config = TfheConfigBuilder.default()
|
||||
.use_custom_parameters(block_params)
|
||||
.build();
|
||||
@@ -410,7 +410,7 @@ test('hlapi_compact_public_key_encrypt_decrypt_int32_big_single', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_compact_public_key_encrypt_decrypt_int32_small_single', (t) => {
|
||||
const block_params = new ShortintParameters(ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
const block_params = new ShortintParameters(ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64);
|
||||
let config = TfheConfigBuilder.default()
|
||||
.use_custom_parameters(block_params)
|
||||
.build();
|
||||
|
||||
@@ -81,7 +81,7 @@ test('hlapi_key_gen_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_key_gen_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -142,7 +142,7 @@ test('hlapi_compressed_public_client_uint8_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_public_key_encrypt_decrypt_uint32_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -166,7 +166,7 @@ test('hlapi_public_key_encrypt_decrypt_uint32_small', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_decompress_public_key_then_encrypt_decrypt_uint32_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -239,7 +239,7 @@ test('hlapi_client_key_encrypt_decrypt_uint128_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_client_key_encrypt_decrypt_uint128_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -316,7 +316,7 @@ test('hlapi_client_key_encrypt_decrypt_uint256_big', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_client_key_encrypt_decrypt_uint256_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -355,7 +355,7 @@ test('hlapi_client_key_encrypt_decrypt_uint256_small', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_decompress_public_key_then_encrypt_decrypt_uint256_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
@@ -381,7 +381,7 @@ test('hlapi_decompress_public_key_then_encrypt_decrypt_uint256_small', (t) => {
|
||||
});
|
||||
|
||||
test('hlapi_public_key_encrypt_decrypt_uint256_small', (t) => {
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let config = TfheConfigBuilder.with_custom_parameters(params_small)
|
||||
.build();
|
||||
|
||||
@@ -110,7 +110,7 @@ test('shortint_encrypt_decrypt', (t) => {
|
||||
// No equality tests here, as wasm stores pointers which will always differ
|
||||
|
||||
// Encryption using small keys
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let cks_small = Shortint.new_client_key(params_small);
|
||||
|
||||
@@ -142,7 +142,7 @@ test('shortint_compressed_encrypt_decrypt', (t) => {
|
||||
|
||||
// Encryption using small keys
|
||||
// We don't have TUniform small params so use previous gaussian ones.
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let cks_small = Shortint.new_client_key(params_small);
|
||||
|
||||
@@ -158,7 +158,7 @@ test('shortint_compressed_encrypt_decrypt', (t) => {
|
||||
});
|
||||
|
||||
test('shortint_public_encrypt_decrypt', (t) => {
|
||||
let params_name_2_0 = ShortintParametersName.PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64;
|
||||
let params_name_2_0 = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64;
|
||||
let params_2_0 = new ShortintParameters(params_name_2_0);
|
||||
let cks = Shortint.new_client_key(params_2_0);
|
||||
let pk = Shortint.new_public_key(cks);
|
||||
@@ -172,7 +172,7 @@ test('shortint_public_encrypt_decrypt', (t) => {
|
||||
assert.deepStrictEqual(decrypted, BigInt(3));
|
||||
|
||||
// Small
|
||||
let params_name_2_2_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_2_2_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_2_2_small = new ShortintParameters(params_name_2_2_small);
|
||||
let cks_small = Shortint.new_client_key(params_2_2_small);
|
||||
|
||||
@@ -205,7 +205,7 @@ test('shortint_compressed_public_encrypt_decrypt', (t) => {
|
||||
assert.deepStrictEqual(decrypted, BigInt(1));
|
||||
|
||||
// Small
|
||||
let params_name_small = ShortintParametersName.PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_name_small = ShortintParametersName.V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64;
|
||||
let params_small = new ShortintParameters(params_name_small);
|
||||
let cks_small = Shortint.new_client_key(params_small);
|
||||
|
||||
|
||||
@@ -284,47 +284,47 @@ macro_rules! expose_as_shortint_pbs_parameters(
|
||||
);
|
||||
|
||||
expose_as_shortint_pbs_parameters!(
|
||||
PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64,
|
||||
// Small params
|
||||
PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64,
|
||||
// CPK
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -26,7 +26,7 @@ fn test_integer_compressed_small() {
|
||||
let mut rng = thread_rng();
|
||||
|
||||
let config = ConfigBuilder::with_custom_parameters(
|
||||
crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
)
|
||||
.build();
|
||||
let (client_key, _) = generate_keys(config);
|
||||
@@ -533,7 +533,7 @@ fn test_trivial_fhe_int8() {
|
||||
#[test]
|
||||
fn test_trivial_fhe_int256_small() {
|
||||
let config = ConfigBuilder::with_custom_parameters(
|
||||
crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
)
|
||||
.build();
|
||||
let (client_key, sks) = generate_keys(config);
|
||||
|
||||
@@ -66,7 +66,7 @@ fn test_integer_compressed() {
|
||||
#[test]
|
||||
fn test_integer_compressed_small() {
|
||||
let config = ConfigBuilder::with_custom_parameters(
|
||||
crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
)
|
||||
.build();
|
||||
let (client_key, _) = generate_keys(config);
|
||||
@@ -157,7 +157,7 @@ fn test_multi_div_rem() {
|
||||
#[test]
|
||||
fn test_small_uint128() {
|
||||
let config = ConfigBuilder::with_custom_parameters(
|
||||
crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
)
|
||||
.build();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ fn test_tag_propagation_cpu() {
|
||||
)),
|
||||
Some(COMP_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64),
|
||||
Some((
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_KEYSWITCH_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
)),
|
||||
)
|
||||
@@ -144,7 +144,7 @@ fn test_tag_propagation_gpu() {
|
||||
None,
|
||||
Some(COMP_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64),
|
||||
Some((
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_KEYSWITCH_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
)),
|
||||
)
|
||||
|
||||
@@ -68,10 +68,10 @@ impl RadixCiphertext {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // 8 bits
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
///
|
||||
/// let msg = 124u8;
|
||||
/// let msg2 = 17u8;
|
||||
@@ -170,10 +170,10 @@ impl SignedRadixCiphertext {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, SignedRadixCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // 8 bits
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
///
|
||||
/// let msg = -35i8;
|
||||
/// let msg2 = 17i8;
|
||||
|
||||
@@ -24,11 +24,11 @@ use tfhe_versionable::Versionize;
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let a = 128u8;
|
||||
/// let b = 55u8;
|
||||
@@ -83,11 +83,11 @@ impl BooleanBlock {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, BooleanBlock};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let a = 128u8;
|
||||
/// let ct_a = cks.encrypt(a);
|
||||
@@ -142,10 +142,10 @@ impl BooleanBlock {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // 8 bits
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
///
|
||||
/// let msg = false;
|
||||
/// let msg2 = true;
|
||||
|
||||
@@ -17,13 +17,15 @@ use crate::shortint::parameters::Degree;
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::PBSParameters;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) =
|
||||
/// gen_keys_radix::<PBSParameters>(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(), size);
|
||||
/// let (cks, sks) = gen_keys_radix::<PBSParameters>(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
/// size,
|
||||
/// );
|
||||
///
|
||||
/// let clear = 3u8;
|
||||
///
|
||||
@@ -60,13 +62,15 @@ impl ParameterSetConformant for CompressedModulusSwitchedRadixCiphertext {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::PBSParameters;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) =
|
||||
/// gen_keys_radix::<PBSParameters>(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(), size);
|
||||
/// let (cks, sks) = gen_keys_radix::<PBSParameters>(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(),
|
||||
/// size,
|
||||
/// );
|
||||
///
|
||||
/// let clear = -3i8;
|
||||
///
|
||||
|
||||
@@ -13,10 +13,10 @@ use tfhe_versionable::Versionize;
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::CrtClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let cks = CrtClientKey::new(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let cks = CrtClientKey::new(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let msg = 13_u64;
|
||||
///
|
||||
|
||||
@@ -132,12 +132,12 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key, that can encrypt in
|
||||
/// // radix and crt decomposition, where each block of the decomposition
|
||||
/// // have over 2 bits of message modulus.
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// ```
|
||||
pub fn new<P>(parameter_set: P) -> Self
|
||||
where
|
||||
@@ -155,12 +155,12 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key, that can encrypt in
|
||||
/// // radix and crt decomposition, where each block of the decomposition
|
||||
/// // have over 2 bits of message modulus.
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let key = cks.into_raw_parts();
|
||||
/// ```
|
||||
@@ -174,12 +174,12 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key, that can encrypt in
|
||||
/// // radix and crt decomposition, where each block of the decomposition
|
||||
/// // have over 2 bits of message modulus.
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let key = cks.into_raw_parts();
|
||||
///
|
||||
@@ -213,9 +213,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let num_block = 4;
|
||||
///
|
||||
/// let msg = 167_u64;
|
||||
@@ -239,9 +239,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let num_block = 4;
|
||||
///
|
||||
/// let msg = 167_u64;
|
||||
@@ -314,9 +314,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let num_block = 4;
|
||||
///
|
||||
/// let msg = 191_u64;
|
||||
@@ -342,9 +342,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let num_block = 4;
|
||||
///
|
||||
/// let msg = 191_u64;
|
||||
@@ -489,9 +489,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let msg = 2_u64;
|
||||
///
|
||||
@@ -510,11 +510,11 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let a = cks.encrypt_bool(false);
|
||||
/// let dec = cks.decrypt_bool(&a);
|
||||
@@ -545,9 +545,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{BooleanBlock, ClientKey};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let a = cks.encrypt_one_block(1u64);
|
||||
/// let wrapped = BooleanBlock::new_unchecked(a);
|
||||
@@ -564,9 +564,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let msg = 13_u64;
|
||||
///
|
||||
@@ -604,10 +604,10 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let msg = 27_u64;
|
||||
/// let basis: Vec<u64> = vec![2, 3, 5];
|
||||
@@ -642,9 +642,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let msg = 13_u64;
|
||||
///
|
||||
@@ -683,9 +683,9 @@ impl ClientKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::ClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// let msg = 27_u64;
|
||||
/// let basis: Vec<u64> = vec![2, 3, 5];
|
||||
|
||||
@@ -22,11 +22,14 @@ use tfhe_versionable::Versionize;
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::RadixClientKey;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // 2 * 4 = 8 bits of message
|
||||
/// let num_block = 4;
|
||||
/// let cks = RadixClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_block);
|
||||
/// let cks = RadixClientKey::new(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_block,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 167_u64;
|
||||
///
|
||||
|
||||
@@ -108,7 +108,7 @@ impl CudaBooleanBlock {
|
||||
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
|
||||
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
|
||||
/// use tfhe::integer::BooleanBlock;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let gpu_index = 0;
|
||||
/// let mut stream = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
|
||||
@@ -116,7 +116,7 @@ impl CudaBooleanBlock {
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 1;
|
||||
/// let (cks, sks) = gen_keys_radix_gpu(
|
||||
/// PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// &mut stream,
|
||||
/// );
|
||||
|
||||
@@ -967,7 +967,7 @@ impl CudaServerKey {
|
||||
/// use tfhe::shortint::gen_keys;
|
||||
/// use tfhe::shortint::parameters::{
|
||||
/// PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
/// PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// };
|
||||
/// {
|
||||
/// // Generate the client key and the server key:
|
||||
@@ -1007,11 +1007,11 @@ impl CudaServerKey {
|
||||
/// }
|
||||
/// {
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let gpu_index = 0;
|
||||
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_gpu(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, &streams);
|
||||
/// let (cks, sks) = gen_keys_gpu(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, &streams);
|
||||
/// let num_blocks = 2;
|
||||
/// let msg = 3;
|
||||
/// let ct = cks.encrypt_radix(msg, num_blocks);
|
||||
|
||||
@@ -44,7 +44,7 @@ macro_rules! create_gpu_parameterized_test{
|
||||
create_gpu_parameterized_test!($name
|
||||
{
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -12,19 +12,23 @@ use crate::shortint::parameters::key_switching::p_fail_2_minus_64::ks_pbs::{
|
||||
};
|
||||
use crate::shortint::parameters::{
|
||||
ClassicPBSParameters, CompactPublicKeyEncryptionParameters, ShortintKeySwitchingParameters,
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn gen_multi_keys_test_rdxinteger_to_rdxinteger_ci_run_filter() {
|
||||
let num_block = 4;
|
||||
|
||||
let client_key_1 = RadixClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_block);
|
||||
let client_key_1 = RadixClientKey::new(
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
num_block,
|
||||
);
|
||||
|
||||
// We generate a set of client/server keys, using the default parameters:
|
||||
let (client_key_2, server_key_2) = KEY_CACHE.get_from_params(
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
IntegerKeyKind::Radix,
|
||||
);
|
||||
let client_key_2 = RadixClientKey::from((client_key_2, num_block));
|
||||
@@ -60,12 +64,14 @@ fn gen_multi_keys_test_rdxinteger_to_rdxinteger_ci_run_filter() {
|
||||
fn gen_multi_keys_test_crtinteger_to_crtinteger_ci_run_filter() {
|
||||
let basis = vec![2, 3, 5, 7, 11];
|
||||
|
||||
let client_key_1 =
|
||||
CrtClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, basis.clone());
|
||||
let client_key_1 = CrtClientKey::new(
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
basis.clone(),
|
||||
);
|
||||
|
||||
// We generate a set of client/server keys, using the default parameters:
|
||||
let (client_key_2, server_key_2) = KEY_CACHE.get_from_params(
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
IntegerKeyKind::CRT,
|
||||
);
|
||||
let client_key_2 = CrtClientKey::from((client_key_2, basis));
|
||||
@@ -105,13 +111,13 @@ fn gen_multi_keys_test_crtinteger_to_crtinteger_fail_ci_run_filter() {
|
||||
let basis = vec![2, 3, 5, 7, 11];
|
||||
|
||||
let (client_key_1, server_key_1) = KEY_CACHE.get_from_params(
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
IntegerKeyKind::CRT,
|
||||
);
|
||||
let client_key_1 = CrtClientKey::from((client_key_1, basis.clone()));
|
||||
|
||||
let (client_key_2, server_key_2) = KEY_CACHE.get_from_params(
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
IntegerKeyKind::CRT,
|
||||
);
|
||||
let client_key_2 = CrtClientKey::from((client_key_2, basis));
|
||||
@@ -138,11 +144,11 @@ fn gen_multi_keys_test_crtinteger_to_crtinteger_fail_ci_run_filter() {
|
||||
#[test]
|
||||
fn gen_multi_keys_test_integer_to_integer_ci_run_filter() {
|
||||
// We generate a set of client keys, using the default parameters:
|
||||
let client_key_1 = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
let client_key_1 = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
|
||||
// We generate a set of client/server keys, using the default parameters:
|
||||
let (client_key_2, server_key_2) = KEY_CACHE.get_from_params(
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
IntegerKeyKind::Radix,
|
||||
);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
//!
|
||||
//! ```rust
|
||||
//! use tfhe::integer::gen_keys_radix;
|
||||
//! use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
//! use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
//!
|
||||
//! //4 blocks for the radix decomposition
|
||||
//! let number_of_blocks = 4;
|
||||
@@ -24,7 +24,7 @@
|
||||
//!
|
||||
//! // Generation of the client/server keys, using the default parameters:
|
||||
//! let (client_key, server_key) = gen_keys_radix(
|
||||
//! PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
//! V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
//! number_of_blocks,
|
||||
//! );
|
||||
//!
|
||||
@@ -185,11 +185,14 @@ where
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
/// ```
|
||||
pub fn gen_keys_radix<P>(parameters_set: P, num_blocks: usize) -> (RadixClientKey, ServerKey)
|
||||
where
|
||||
@@ -208,11 +211,11 @@ where
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// ```
|
||||
pub fn gen_keys_crt<P>(parameters_set: P, basis: Vec<u64>) -> (CrtClientKey, ServerKey)
|
||||
where
|
||||
|
||||
@@ -13,13 +13,13 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::Seed;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let ct_res = sks.par_generate_oblivious_pseudo_random_unsigned_integer(Seed(0), size as u64);
|
||||
///
|
||||
@@ -83,13 +83,13 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::Seed;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let random_bits_count = 3;
|
||||
///
|
||||
@@ -164,13 +164,13 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::Seed;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let ct_res = sks.par_generate_oblivious_pseudo_random_signed_integer(Seed(0), size as u64);
|
||||
///
|
||||
@@ -211,7 +211,7 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::Seed;
|
||||
///
|
||||
/// let size = 4;
|
||||
@@ -219,7 +219,7 @@ impl ServerKey {
|
||||
/// let random_bits_count = 3;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let ct_res = sks.par_generate_oblivious_pseudo_random_signed_integer_bounded(
|
||||
/// Seed(0),
|
||||
@@ -306,8 +306,11 @@ pub(crate) mod test {
|
||||
let num_blocks = 2;
|
||||
|
||||
use crate::integer::gen_keys_radix;
|
||||
use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
let (ck, sk) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
use crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
let (ck, sk) = gen_keys_radix(
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
num_blocks,
|
||||
);
|
||||
|
||||
let test_uniformity = |distinct_values: u64, f: &(dyn Fn(usize) -> u64 + Sync)| {
|
||||
test_uniformity(sample_count, p_value_limit, distinct_values, f)
|
||||
|
||||
@@ -121,7 +121,7 @@ mod tests {
|
||||
use crate::shortint::parameters::*;
|
||||
|
||||
create_parameterized_test!(integer_public_key_decompression_small {
|
||||
PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64,
|
||||
});
|
||||
|
||||
fn integer_public_key_decompression_small(param: ClassicPBSParameters) {
|
||||
|
||||
@@ -14,7 +14,7 @@ create_parameterized_test!(big_radix_encrypt_decrypt_128_bits {
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS,
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
/* PARAM_MESSAGE_3_CARRY_3_KS_PBS, Skipped as the key requires 32GB
|
||||
* PARAM_MESSAGE_4_CARRY_4_KS_PBS, Skipped as the key requires 550GB */
|
||||
@@ -28,7 +28,7 @@ create_parameterized_test!(
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS,
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
/* PARAM_MESSAGE_3_CARRY_3_KS_PBS, Skipped as its slow
|
||||
* PARAM_MESSAGE_4_CARRY_4_KS_PBS, Skipped as its slow */
|
||||
|
||||
@@ -8,12 +8,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
|
||||
@@ -30,12 +30,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -69,12 +69,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 28;
|
||||
///
|
||||
|
||||
@@ -8,12 +8,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 29;
|
||||
/// let clear_2 = 23;
|
||||
@@ -66,11 +66,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 29;
|
||||
/// let clear_2 = 29;
|
||||
|
||||
@@ -12,11 +12,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear = 14_u64;
|
||||
///
|
||||
@@ -54,11 +54,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear = 14_u64;
|
||||
///
|
||||
|
||||
@@ -13,12 +13,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -58,11 +58,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -95,12 +95,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -145,12 +145,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -183,12 +183,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
|
||||
@@ -13,12 +13,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 2;
|
||||
@@ -66,11 +66,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 2;
|
||||
@@ -100,12 +100,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 2;
|
||||
@@ -152,7 +152,7 @@ impl ServerKey {
|
||||
/// Computes homomorphically a multiplication between a scalar and a ciphertext.
|
||||
///
|
||||
/// `small` means the scalar value shall fit in a __shortint block__.
|
||||
/// For example, if the parameters are PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// For example, if the parameters are V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// the scalar should fit in 2 bits.
|
||||
///
|
||||
/// The result is returned as a new ciphertext.
|
||||
@@ -161,12 +161,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -192,7 +192,7 @@ impl ServerKey {
|
||||
/// Computes homomorphically a multiplication between a scalar and a ciphertext.
|
||||
///
|
||||
/// `small` means the scalar shall value fit in a __shortint block__.
|
||||
/// For example, if the parameters are PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// For example, if the parameters are V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// the scalar should fit in 2 bits.
|
||||
///
|
||||
/// The result is assigned to the input ciphertext
|
||||
@@ -201,12 +201,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
|
||||
@@ -13,12 +13,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
@@ -52,10 +52,10 @@ impl ServerKey {
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
@@ -90,12 +90,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 8;
|
||||
@@ -126,12 +126,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
@@ -161,12 +161,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
|
||||
@@ -12,12 +12,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
@@ -51,12 +51,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
@@ -85,12 +85,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
@@ -129,12 +129,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
|
||||
@@ -34,7 +34,7 @@ const NB_TESTS: usize = 1;
|
||||
const NB_TESTS_SMALLER: usize = 1;
|
||||
|
||||
#[cfg(not(tarpaulin))]
|
||||
const PARAM: ClassicPBSParameters = PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
const PARAM: ClassicPBSParameters = V0_11_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
#[cfg(tarpaulin)]
|
||||
const PARAM: ClassicPBSParameters = COVERAGE_PARAM_MESSAGE_5_CARRY_1_KS_PBS;
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -65,12 +65,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 29;
|
||||
/// let clear_2 = 29;
|
||||
|
||||
@@ -19,12 +19,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -59,12 +59,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 28;
|
||||
///
|
||||
|
||||
@@ -10,12 +10,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 29;
|
||||
/// let clear_2 = 23;
|
||||
@@ -77,11 +77,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 29;
|
||||
/// let clear_2 = 29;
|
||||
|
||||
@@ -12,11 +12,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear = 14_u64;
|
||||
///
|
||||
@@ -52,11 +52,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear = 14_u64;
|
||||
///
|
||||
|
||||
@@ -14,12 +14,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -72,12 +72,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -122,12 +122,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -164,12 +164,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
|
||||
@@ -14,12 +14,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 2;
|
||||
@@ -80,12 +80,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 2;
|
||||
@@ -132,7 +132,7 @@ impl ServerKey {
|
||||
/// Computes homomorphically a multiplication between a scalar and a ciphertext.
|
||||
///
|
||||
/// `small` means the scalar value shall fit in a __shortint block__.
|
||||
/// For example, if the parameters are PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// For example, if the parameters are V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// the scalar should fit in 2 bits.
|
||||
///
|
||||
/// The result is returned as a new ciphertext.
|
||||
@@ -141,12 +141,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
@@ -174,7 +174,7 @@ impl ServerKey {
|
||||
/// Computes homomorphically a multiplication between a scalar and a ciphertext.
|
||||
///
|
||||
/// `small` means the scalar shall value fit in a __shortint block__.
|
||||
/// For example, if the parameters are PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// For example, if the parameters are V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
/// the scalar should fit in 2 bits.
|
||||
///
|
||||
/// The result is assigned to the input ciphertext
|
||||
@@ -183,12 +183,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 14;
|
||||
|
||||
@@ -14,12 +14,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
@@ -66,12 +66,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 8;
|
||||
@@ -104,12 +104,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
@@ -139,12 +139,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 7;
|
||||
|
||||
@@ -11,12 +11,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
@@ -50,12 +50,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
@@ -84,12 +84,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
@@ -127,12 +127,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_crt;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let basis = vec![2, 3, 5];
|
||||
/// let modulus: u64 = basis.iter().product();
|
||||
/// let (cks, sks) = gen_keys_crt(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
/// let (cks, sks) = gen_keys_crt(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, basis);
|
||||
///
|
||||
/// let clear_1 = 14;
|
||||
/// let clear_2 = 5;
|
||||
|
||||
@@ -14,7 +14,7 @@ const NB_TESTS: usize = 30;
|
||||
const NB_TESTS: usize = 1;
|
||||
|
||||
#[cfg(not(tarpaulin))]
|
||||
const PARAM: ClassicPBSParameters = PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
const PARAM: ClassicPBSParameters = V0_11_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64;
|
||||
#[cfg(tarpaulin)]
|
||||
const PARAM: ClassicPBSParameters = COVERAGE_PARAM_MESSAGE_5_CARRY_1_KS_PBS;
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{ClientKey, ServerKey};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key:
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// // Generate the server key:
|
||||
/// let sks = ServerKey::new_radix_server_key(cks);
|
||||
@@ -134,11 +134,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{ClientKey, ServerKey};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::ServerKey as ShortintServerKey;
|
||||
///
|
||||
/// // Generate the client key:
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// // Generate the shortint server key:
|
||||
/// let shortint_sks = ShortintServerKey::new(cks.as_ref());
|
||||
@@ -165,11 +165,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{ClientKey, ServerKey};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::ServerKey as ShortintServerKey;
|
||||
///
|
||||
/// // Generate the client key:
|
||||
/// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
/// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64);
|
||||
///
|
||||
/// // Generate the shortint server key:
|
||||
/// let shortint_sks = ShortintServerKey::new(cks.as_ref());
|
||||
@@ -340,7 +340,7 @@ mod test {
|
||||
fn test_compressed_server_key_max_degree() {
|
||||
{
|
||||
let cks = ClientKey::new(
|
||||
crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
);
|
||||
// msg_mod = 4, carry_mod = 4, (msg_mod * carry_mod - 1) - (carry_mod - 1) = 12
|
||||
let expected_radix_max_degree = MaxDegree::new(12);
|
||||
@@ -357,7 +357,7 @@ mod test {
|
||||
|
||||
{
|
||||
let cks = ClientKey::new(
|
||||
crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
);
|
||||
// msg_mod = 4, carry_mod = 4, msg_mod * carrymod - 1 = 15
|
||||
let expected_crt_max_degree = MaxDegree::new(15);
|
||||
|
||||
@@ -16,11 +16,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 10;
|
||||
/// let msg2 = 127;
|
||||
@@ -52,10 +55,13 @@ impl ServerKey {
|
||||
/// The result is assigned to the `ct_left` ciphertext.
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 28;
|
||||
/// let msg2 = 127;
|
||||
@@ -89,11 +95,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 46u64;
|
||||
/// let msg2 = 87u64;
|
||||
@@ -143,11 +152,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -183,11 +195,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -216,11 +231,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
|
||||
@@ -14,11 +14,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 201u64;
|
||||
/// let msg2 = 1u64;
|
||||
@@ -61,12 +61,12 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 46u64;
|
||||
/// let msg2 = 87u64;
|
||||
@@ -104,12 +104,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -144,12 +144,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -177,12 +177,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -239,11 +239,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 200;
|
||||
/// let msg2 = 1;
|
||||
@@ -289,12 +289,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -330,12 +330,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -364,12 +364,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -428,11 +428,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 49;
|
||||
/// let msg2 = 64;
|
||||
@@ -478,12 +478,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -519,12 +519,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 41;
|
||||
/// let msg2 = 101;
|
||||
@@ -553,12 +553,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -610,11 +610,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 14u8;
|
||||
///
|
||||
@@ -644,11 +647,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 14u8;
|
||||
///
|
||||
@@ -678,11 +684,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 14u8;
|
||||
///
|
||||
@@ -713,11 +722,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = true;
|
||||
///
|
||||
|
||||
@@ -15,12 +15,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -145,12 +145,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -181,12 +181,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 97u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -217,12 +217,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 237u64;
|
||||
/// let msg2 = 23u64;
|
||||
@@ -253,12 +253,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 237u64;
|
||||
/// let msg2 = 23u64;
|
||||
@@ -288,12 +288,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 237u64;
|
||||
/// let msg2 = 23u64;
|
||||
@@ -323,12 +323,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 237u64;
|
||||
/// let msg2 = 23u64;
|
||||
@@ -357,12 +357,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -410,12 +410,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -444,12 +444,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -478,12 +478,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -512,12 +512,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -546,12 +546,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
@@ -580,12 +580,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
|
||||
@@ -36,12 +36,15 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let ctxt: RadixCiphertext = sks.create_trivial_zero_radix(num_blocks);
|
||||
///
|
||||
@@ -110,12 +113,15 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let ctxt: RadixCiphertext = sks.create_trivial_radix(212u64, num_blocks);
|
||||
///
|
||||
@@ -143,12 +149,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 7u64;
|
||||
///
|
||||
@@ -162,7 +171,7 @@ impl ServerKey {
|
||||
/// // Decrypt
|
||||
/// let res: u64 = cks.decrypt(&ct1);
|
||||
/// assert_eq!(
|
||||
/// 7 * (PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
|
||||
/// 7 * (V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
|
||||
/// .message_modulus
|
||||
/// .0)
|
||||
/// .pow(added_blocks as u32),
|
||||
@@ -185,12 +194,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 7u64;
|
||||
///
|
||||
@@ -204,7 +216,7 @@ impl ServerKey {
|
||||
/// // Decrypt
|
||||
/// let res: u64 = cks.decrypt(&ct_res);
|
||||
/// assert_eq!(
|
||||
/// 7 * (PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
|
||||
/// 7 * (V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
|
||||
/// .message_modulus
|
||||
/// .0)
|
||||
/// .pow(added_blocks as u32),
|
||||
@@ -228,12 +240,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 7u64;
|
||||
///
|
||||
@@ -264,12 +279,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 7u64;
|
||||
///
|
||||
@@ -300,12 +318,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 119u64;
|
||||
///
|
||||
@@ -331,12 +352,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 119u64;
|
||||
///
|
||||
@@ -367,12 +391,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 119u64;
|
||||
///
|
||||
@@ -401,12 +428,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 119u64;
|
||||
///
|
||||
@@ -437,12 +467,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = -1i8;
|
||||
///
|
||||
@@ -492,12 +525,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = -2i8;
|
||||
///
|
||||
@@ -528,12 +564,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = -2i8;
|
||||
///
|
||||
@@ -604,12 +643,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 8;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = u16::MAX;
|
||||
///
|
||||
@@ -678,12 +720,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 7u64;
|
||||
///
|
||||
@@ -719,12 +764,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 10;
|
||||
///
|
||||
|
||||
@@ -14,11 +14,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 3;
|
||||
@@ -57,11 +57,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let clear_1 = 55;
|
||||
/// let clear_2 = 3;
|
||||
@@ -114,11 +114,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 3;
|
||||
@@ -188,11 +188,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let clear_1 = 255;
|
||||
/// let clear_2 = 143;
|
||||
@@ -244,11 +244,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 6;
|
||||
|
||||
@@ -62,12 +62,12 @@ impl ServerKey {
|
||||
/// ```rust
|
||||
/// // Encrypt two messages:
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let modulus = 1 << 8;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 159u64;
|
||||
///
|
||||
@@ -123,11 +123,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 2u64;
|
||||
///
|
||||
@@ -180,11 +180,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
///
|
||||
@@ -222,12 +222,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let modulus = 1 << 8;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1;
|
||||
///
|
||||
@@ -258,11 +258,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
///
|
||||
@@ -295,11 +295,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
///
|
||||
|
||||
@@ -16,11 +16,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 4;
|
||||
/// let scalar = 40;
|
||||
@@ -70,11 +70,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 2u64;
|
||||
/// let scalar = 40;
|
||||
@@ -122,11 +122,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 4;
|
||||
/// let scalar = 40;
|
||||
@@ -171,11 +171,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 4;
|
||||
/// let scalar = 40;
|
||||
@@ -213,11 +213,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 129;
|
||||
/// let scalar = 40;
|
||||
|
||||
@@ -83,11 +83,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 30;
|
||||
/// let scalar = 3;
|
||||
@@ -123,11 +123,11 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 25u64;
|
||||
/// let scalar1 = 3;
|
||||
@@ -163,11 +163,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 33;
|
||||
/// let scalar = 3;
|
||||
@@ -209,11 +209,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 33;
|
||||
/// let scalar = 3;
|
||||
@@ -241,7 +241,7 @@ impl ServerKey {
|
||||
/// Computes homomorphically a multiplication between a scalar and a ciphertext.
|
||||
///
|
||||
/// `small` means the scalar value shall fit in a __shortint block__.
|
||||
/// For example, if the parameters are PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// For example, if the parameters are V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// the scalar should fit in 2 bits.
|
||||
///
|
||||
/// The result is returned as a new ciphertext.
|
||||
@@ -250,12 +250,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let modulus = 1 << 8;
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 13;
|
||||
/// let scalar = 2;
|
||||
@@ -284,7 +284,7 @@ impl ServerKey {
|
||||
/// Computes homomorphically a multiplication between a scalar and a ciphertext.
|
||||
///
|
||||
/// `small` means the scalar shall value fit in a __shortint block__.
|
||||
/// For example, if the parameters are PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// For example, if the parameters are V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// the scalar should fit in 2 bits.
|
||||
///
|
||||
/// The result is assigned to the input ciphertext
|
||||
@@ -293,12 +293,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let modulus = 1 << 8;
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 9;
|
||||
/// let scalar = 3;
|
||||
@@ -325,11 +325,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
/// let power = 2;
|
||||
@@ -362,12 +362,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let modulus = 1 << 8;
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 230;
|
||||
/// let scalar = 376;
|
||||
|
||||
@@ -30,11 +30,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 40;
|
||||
/// let scalar = 3;
|
||||
@@ -127,11 +130,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 40u64;
|
||||
/// let scalar = 2u64;
|
||||
@@ -174,11 +180,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 40;
|
||||
/// let scalar = 4;
|
||||
@@ -210,11 +219,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 232;
|
||||
/// let scalar = 83;
|
||||
@@ -248,11 +260,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 165;
|
||||
/// let scalar = 112;
|
||||
|
||||
@@ -13,11 +13,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 16;
|
||||
/// let shift = 2;
|
||||
@@ -60,11 +63,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 128u64;
|
||||
/// let shift = 2;
|
||||
@@ -96,11 +102,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 18u64;
|
||||
/// let shift = 4;
|
||||
@@ -200,11 +209,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 21u64;
|
||||
/// let shift = 2;
|
||||
@@ -249,11 +261,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 13u64;
|
||||
/// let shift = 2;
|
||||
|
||||
@@ -57,11 +57,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_block = 1;
|
||||
@@ -101,11 +104,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_block = 1;
|
||||
@@ -246,11 +252,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -336,11 +345,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -379,11 +391,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -426,11 +441,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -471,11 +489,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -518,11 +539,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
|
||||
@@ -16,10 +16,13 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 12;
|
||||
/// let msg_2 = 10;
|
||||
@@ -55,11 +58,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 128;
|
||||
/// let msg_2 = 99;
|
||||
@@ -89,11 +95,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 182u64;
|
||||
/// let msg_2 = 120u64;
|
||||
@@ -159,11 +168,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
///
|
||||
@@ -201,12 +213,15 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 41u8;
|
||||
/// let msg2 = 101u8;
|
||||
@@ -235,11 +250,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 120u8;
|
||||
/// let msg_2 = 181u8;
|
||||
@@ -284,11 +302,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 120u8;
|
||||
/// let msg_2 = 181u8;
|
||||
@@ -330,11 +351,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 1u8;
|
||||
/// let msg_2 = 2u8;
|
||||
|
||||
@@ -57,9 +57,9 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// Skip the 1_1 params for the smart add 128 bits which proved to be the slowest test in our test
|
||||
// suite
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -101,11 +101,11 @@ create_parameterized_test!(
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_3_KS_PBS, // Test case where carry_modulus > message_modulus
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, // Test case where carry_modulus > message_modulus
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, // Test case where carry_modulus > message_modulus
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -126,8 +126,8 @@ create_parameterized_test!(integer_unchecked_min {
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
}
|
||||
});
|
||||
|
||||
@@ -666,7 +666,7 @@ fn integer_smart_scalar_mul_decomposition_overflow() {
|
||||
|
||||
let mut rng = rand::thread_rng();
|
||||
|
||||
let param = PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
let param = V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
|
||||
let num_block = (128_f64 / (param.message_modulus.0 as f64).log(2.0)).ceil() as usize;
|
||||
|
||||
|
||||
@@ -131,11 +131,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -199,11 +202,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -266,11 +272,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = u8::MAX;
|
||||
/// let msg2 = 1;
|
||||
@@ -342,11 +351,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = u8::MAX;
|
||||
/// let msg2 = 1;
|
||||
@@ -1531,12 +1543,12 @@ fn overflow_flag_preparation_lut(
|
||||
mod tests {
|
||||
use super::should_parallel_propagation_be_faster;
|
||||
use crate::integer::gen_keys_radix;
|
||||
use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
use crate::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
|
||||
#[test]
|
||||
fn test_propagate_single_carry_on_empty_input_ci_run_filter() {
|
||||
// Parameters and num blocks do not matter here
|
||||
let (_, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
let (_, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 4);
|
||||
|
||||
sks.propagate_single_carry_parallelized(&mut []);
|
||||
// The most interesting part we test is that the code does not panic
|
||||
|
||||
@@ -35,11 +35,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -108,11 +111,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -200,11 +206,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -275,11 +284,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -367,11 +379,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -442,11 +457,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14;
|
||||
/// let msg2 = 97;
|
||||
@@ -518,11 +536,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 14;
|
||||
///
|
||||
|
||||
@@ -54,11 +54,11 @@ where
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::integer::prelude::*;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let a = 128u8;
|
||||
/// let b = 55u8;
|
||||
@@ -121,11 +121,11 @@ impl ServerKeyDefaultCMux<&BooleanBlock, &BooleanBlock> for ServerKey {
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::integer::prelude::*;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// for cond in [true, false] {
|
||||
/// for a in [true, false] {
|
||||
@@ -246,11 +246,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let a = 128u8;
|
||||
/// let b = 55u8;
|
||||
|
||||
@@ -54,11 +54,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 7u64;
|
||||
///
|
||||
@@ -197,11 +200,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 10u64;
|
||||
///
|
||||
|
||||
@@ -20,11 +20,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 3;
|
||||
@@ -67,11 +70,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 55;
|
||||
/// let clear_2 = 3;
|
||||
@@ -134,11 +140,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 3;
|
||||
@@ -220,11 +229,14 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 3;
|
||||
@@ -414,11 +426,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 255;
|
||||
/// let clear_2 = 143;
|
||||
@@ -490,11 +505,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 6;
|
||||
@@ -577,11 +595,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 170;
|
||||
/// let clear_2 = 6;
|
||||
@@ -728,11 +749,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = 128u8;
|
||||
/// let clear_2 = 5u8;
|
||||
@@ -798,11 +822,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let clear_1 = -128i8;
|
||||
/// let clear_2 = 5i8;
|
||||
|
||||
@@ -10,11 +10,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
///
|
||||
@@ -56,11 +56,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 1u64;
|
||||
///
|
||||
|
||||
@@ -9,12 +9,15 @@ impl ServerKey {
|
||||
///
|
||||
///```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let num_blocks = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg = 0b10110100_u8;
|
||||
///
|
||||
|
||||
@@ -72,11 +72,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -234,11 +234,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
|
||||
@@ -119,11 +119,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 4;
|
||||
/// let scalar = 40;
|
||||
@@ -157,11 +157,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 129;
|
||||
/// let scalar = 40;
|
||||
@@ -204,11 +204,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 4;
|
||||
/// let scalar = 40;
|
||||
@@ -249,11 +249,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 129;
|
||||
/// let scalar = 40;
|
||||
|
||||
@@ -74,11 +74,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14u8;
|
||||
/// let msg2 = 97u8;
|
||||
@@ -107,11 +110,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 123u8;
|
||||
/// let msg2 = 34u8;
|
||||
@@ -199,11 +205,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14u8;
|
||||
/// let msg2 = 97u8;
|
||||
@@ -232,11 +241,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 123u8;
|
||||
/// let msg2 = 34u8;
|
||||
@@ -327,11 +339,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 14u8;
|
||||
/// let msg2 = 97u8;
|
||||
@@ -360,11 +375,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg1 = 123u8;
|
||||
/// let msg2 = 34u8;
|
||||
|
||||
@@ -370,12 +370,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// let size = 4;
|
||||
///
|
||||
/// // Generate the client key and the server key:
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg1 = 14u64;
|
||||
/// let msg2 = 97u64;
|
||||
|
||||
@@ -91,12 +91,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let modulus = 1 << 8;
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 230;
|
||||
/// let scalar = 376;
|
||||
@@ -149,12 +149,12 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let modulus = 1 << 8;
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 230;
|
||||
/// let scalar = 376;
|
||||
|
||||
@@ -20,11 +20,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -61,11 +61,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -110,11 +110,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -148,11 +148,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -197,11 +197,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -244,11 +244,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2;
|
||||
@@ -351,11 +351,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2u32;
|
||||
@@ -392,11 +392,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2u32;
|
||||
@@ -441,11 +441,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2u32;
|
||||
@@ -479,11 +479,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2u32;
|
||||
@@ -528,11 +528,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2u32;
|
||||
@@ -575,11 +575,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128u8;
|
||||
/// let n = 2u32;
|
||||
|
||||
@@ -26,11 +26,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128;
|
||||
/// let shift = 2;
|
||||
@@ -69,11 +69,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 18;
|
||||
/// let shift = 4;
|
||||
@@ -374,11 +374,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128;
|
||||
/// let shift = 2;
|
||||
@@ -419,11 +419,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 18;
|
||||
/// let shift = 4;
|
||||
@@ -470,11 +470,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 21;
|
||||
/// let shift = 2;
|
||||
@@ -519,11 +519,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 13;
|
||||
/// let shift = 2;
|
||||
@@ -648,11 +648,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 21;
|
||||
/// let shift = 2;
|
||||
@@ -693,11 +693,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 13;
|
||||
/// let shift = 2;
|
||||
|
||||
@@ -13,11 +13,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 165;
|
||||
/// let scalar = 112;
|
||||
@@ -70,11 +70,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 165;
|
||||
/// let scalar = 112;
|
||||
|
||||
@@ -120,11 +120,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 128;
|
||||
/// let shift = 2;
|
||||
@@ -268,11 +268,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg = 21;
|
||||
/// let shift = 2;
|
||||
|
||||
@@ -58,11 +58,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -157,11 +160,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -200,11 +206,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -249,11 +258,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -295,11 +307,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
@@ -342,11 +357,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg: u64 = 225;
|
||||
/// let start_bit = 3;
|
||||
|
||||
@@ -14,11 +14,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg_1 = 120u8;
|
||||
/// let msg_2 = 181u8;
|
||||
@@ -65,11 +65,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg_1 = 120u8;
|
||||
/// let msg_2 = 181u8;
|
||||
@@ -121,11 +121,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg_1 = 120u8;
|
||||
/// let msg_2 = 181u8;
|
||||
@@ -165,11 +165,11 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let size = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
/// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, size);
|
||||
///
|
||||
/// let msg_1 = 120u8;
|
||||
/// let msg_2 = 181u8;
|
||||
@@ -231,11 +231,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = 1u8;
|
||||
/// let msg_2 = 255u8;
|
||||
@@ -720,11 +723,14 @@ impl ServerKey {
|
||||
///
|
||||
/// ```rust
|
||||
/// use tfhe::integer::gen_keys_radix;
|
||||
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
|
||||
///
|
||||
/// // We have 4 * 2 = 8 bits of message
|
||||
/// let num_blocks = 4;
|
||||
/// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, num_blocks);
|
||||
/// let (cks, sks) = gen_keys_radix(
|
||||
/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
/// num_blocks,
|
||||
/// );
|
||||
///
|
||||
/// let msg_1 = i8::MIN;
|
||||
/// let msg_2 = 1;
|
||||
|
||||
@@ -31,8 +31,8 @@ create_parameterized_test!(
|
||||
// Requires 4 bits, so 1_1 parameters are not supported
|
||||
// until they get their own version of the algorithm
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -58,8 +58,8 @@ create_parameterized_test!(
|
||||
// Requires 4 bits, so 1_1 parameters are not supported
|
||||
// until they get their own version of the algorithm
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -16,13 +16,13 @@ use std::sync::Arc;
|
||||
|
||||
create_parameterized_test!(integer_signed_unchecked_if_then_else {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_default_if_then_else {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
|
||||
fn integer_signed_unchecked_if_then_else<P>(param: P)
|
||||
|
||||
@@ -353,22 +353,22 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
|
||||
create_parameterized_test!([<integer_signed_unchecked_ $comparison_name _parallelized_ $clear_type>]
|
||||
{
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
@@ -383,14 +383,14 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
|
||||
create_parameterized_test!([<integer_signed_smart_ $comparison_name _parallelized_ $clear_type>]
|
||||
{
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
@@ -398,14 +398,14 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
|
||||
create_parameterized_test!([<integer_signed_default_ $comparison_name _parallelized_ $clear_type>]
|
||||
{
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
@@ -413,7 +413,7 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
@@ -715,40 +715,40 @@ mod no_coverage {
|
||||
create_parameterized_test!(integer_signed_unchecked_max_parallelized_128_bits);
|
||||
create_parameterized_test!(integer_signed_unchecked_min_parallelized_128_bits);
|
||||
create_parameterized_test!(integer_signed_smart_max_parallelized_128_bits {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_smart_min_parallelized_128_bits {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_max_parallelized_128_bits {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_min_parallelized_128_bits {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
|
||||
define_signed_comparison_test_functions!(eq, i128);
|
||||
|
||||
@@ -23,8 +23,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// Does not support 1_1
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -41,8 +41,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// Does not support 1_1
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -26,8 +26,8 @@ create_parameterized_test!(integer_signed_default_ilog2);
|
||||
create_parameterized_test!(integer_signed_default_checked_ilog2 {
|
||||
// uses comparison so 1_1 parameters are not supported
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -26,8 +26,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// Uses comparisons internally, so no 1_1
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -267,13 +267,13 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
create_parameterized_test!([<integer_signed_unchecked_scalar_ $comparison_name _parallelized_ $clear_type>]
|
||||
{
|
||||
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
@@ -281,7 +281,7 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
create_parameterized_test!([<integer_signed_smart_scalar_ $comparison_name _parallelized_ $clear_type>]
|
||||
{
|
||||
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
@@ -289,7 +289,7 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
// and when using 3_3 to represent 128 we actually have more than 128 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
@@ -297,7 +297,7 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
create_parameterized_test!([<integer_signed_default_scalar_ $comparison_name _parallelized_ $clear_type>]
|
||||
{
|
||||
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
@@ -305,7 +305,7 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
// and when using 3_3 to represent 128 we actually have more than 128 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
#[cfg(tarpaulin)]
|
||||
COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS
|
||||
});
|
||||
@@ -610,52 +610,52 @@ mod no_coverage {
|
||||
}
|
||||
|
||||
create_parameterized_test!(integer_signed_unchecked_scalar_max_parallelized_i128 {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_unchecked_scalar_min_parallelized_i128 {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_smart_scalar_max_parallelized_i128 {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_smart_scalar_min_parallelized_i128 {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_scalar_max_parallelized_i128 {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
create_parameterized_test!(integer_signed_scalar_min_parallelized_i128 {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as default test might overflow values
|
||||
// and when using 3_3 to represent 256 we actually have more than 256 bits
|
||||
// of message so the overflow behaviour is not the same, leading to false negatives
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64
|
||||
});
|
||||
|
||||
define_signed_scalar_comparison_test_functions!(eq, i128);
|
||||
@@ -666,12 +666,12 @@ mod no_coverage {
|
||||
define_signed_scalar_comparison_test_functions!(ge, i128);
|
||||
|
||||
create_parameterized_test!(integer_signed_is_scalar_out_of_bounds {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
// We don't use PARAM_MESSAGE_3_CARRY_3_KS_PBS,
|
||||
// as the test relies on the ciphertext to encrypt 128bits
|
||||
// but with param 3_3 we actually encrypt more that 128bits
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ create_parameterized_test!(integer_signed_default_overflowing_sub_parallel {
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -440,8 +440,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// This algorithm requires 3 bits
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -458,8 +458,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// This algorithm requires 3 bits
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -477,8 +477,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// This algorithm requires 3 bits
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -495,8 +495,8 @@ create_parameterized_test!(
|
||||
no_coverage => {
|
||||
// This algorithm requires 3 bits
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -514,11 +514,11 @@ create_parameterized_test!(
|
||||
COVERAGE_PARAM_MULTI_BIT_MESSAGE_2_CARRY_2_GROUP_2_KS_PBS,
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, // Test case where carry_modulus > message_modulus
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, // Test case where carry_modulus > message_modulus
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
@@ -30,8 +30,8 @@ create_parameterized_test!(integer_advanced_overflowing_add_assign_with_carry_at
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
@@ -46,8 +46,8 @@ create_parameterized_test!(integer_extensive_trivial_overflowing_advanced_add_as
|
||||
},
|
||||
no_coverage => {
|
||||
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
|
||||
PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
|
||||
PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user