From b1733588d3630cee34b633c35e4d438931961115 Mon Sep 17 00:00:00 2001 From: Nicolas Sarlin Date: Thu, 19 Dec 2024 19:06:22 +0100 Subject: [PATCH] chore(shortint): update classic gaussian param --- apps/trivium/benches/kreyvium_shortint.rs | 8 +- apps/trivium/benches/trivium_shortint.rs | 8 +- apps/trivium/src/kreyvium/test.rs | 4 +- apps/trivium/src/trivium/test.rs | 4 +- .../tests/test_classical_pbs.cpp | 2 +- tfhe/benches/core_crypto/ks_bench.rs | 22 +- tfhe/benches/core_crypto/pbs_bench.rs | 69 +- tfhe/benches/shortint/bench.rs | 38 +- tfhe/benches/shortint/casting.rs | 15 +- tfhe/docs/fundamentals/serialization.md | 4 +- .../examples/utilities/generates_test_keys.rs | 66 +- tfhe/examples/utilities/shortint_key_sizes.rs | 16 +- .../utilities/wasm_benchmarks_parser.rs | 23 +- tfhe/src/c_api/shortint/parameters.rs | 80 +- .../high_level_api/integers/signed/tests.rs | 4 +- .../integers/unsigned/tests/cpu.rs | 4 +- .../high_level_api/tests/tags_on_entities.rs | 4 +- tfhe/src/integer/ciphertext/base.rs | 8 +- tfhe/src/integer/ciphertext/boolean_value.rs | 12 +- .../compressed_modulus_switched_ciphertext.rs | 16 +- tfhe/src/integer/client_key/crt.rs | 4 +- tfhe/src/integer/client_key/mod.rs | 56 +- tfhe/src/integer/client_key/radix.rs | 7 +- .../integer/gpu/ciphertext/boolean_value.rs | 4 +- tfhe/src/integer/gpu/server_key/radix/mod.rs | 6 +- .../server_key/radix/tests_unsigned/mod.rs | 2 +- tfhe/src/integer/key_switching_key/test.rs | 26 +- tfhe/src/integer/mod.rs | 15 +- tfhe/src/integer/oprf.rs | 23 +- tfhe/src/integer/public_key/standard.rs | 2 +- tfhe/src/integer/public_key/tests.rs | 4 +- tfhe/src/integer/server_key/crt/add_crt.rs | 4 +- tfhe/src/integer/server_key/crt/mod.rs | 8 +- tfhe/src/integer/server_key/crt/mul_crt.rs | 8 +- tfhe/src/integer/server_key/crt/neg_crt.rs | 8 +- .../integer/server_key/crt/scalar_add_crt.rs | 20 +- .../integer/server_key/crt/scalar_mul_crt.rs | 24 +- .../integer/server_key/crt/scalar_sub_crt.rs | 20 +- tfhe/src/integer/server_key/crt/sub_crt.rs | 16 +- tfhe/src/integer/server_key/crt/tests.rs | 2 +- .../server_key/crt_parallel/add_crt.rs | 8 +- .../integer/server_key/crt_parallel/mod.rs | 8 +- .../server_key/crt_parallel/mul_crt.rs | 8 +- .../server_key/crt_parallel/neg_crt.rs | 8 +- .../server_key/crt_parallel/scalar_add_crt.rs | 16 +- .../server_key/crt_parallel/scalar_mul_crt.rs | 20 +- .../server_key/crt_parallel/scalar_sub_crt.rs | 16 +- .../server_key/crt_parallel/sub_crt.rs | 16 +- .../integer/server_key/crt_parallel/tests.rs | 2 +- tfhe/src/integer/server_key/mod.rs | 16 +- tfhe/src/integer/server_key/radix/add.rs | 42 +- .../integer/server_key/radix/bitwise_op.rs | 80 +- .../integer/server_key/radix/comparison.rs | 56 +- tfhe/src/integer/server_key/radix/mod.rs | 116 ++- tfhe/src/integer/server_key/radix/mul.rs | 20 +- tfhe/src/integer/server_key/radix/neg.rs | 24 +- .../integer/server_key/radix/scalar_add.rs | 20 +- .../integer/server_key/radix/scalar_mul.rs | 36 +- .../integer/server_key/radix/scalar_sub.rs | 35 +- tfhe/src/integer/server_key/radix/shift.rs | 35 +- tfhe/src/integer/server_key/radix/slice.rs | 56 +- tfhe/src/integer/server_key/radix/sub.rs | 56 +- tfhe/src/integer/server_key/radix/tests.rs | 22 +- .../integer/server_key/radix_parallel/add.rs | 32 +- .../server_key/radix_parallel/bitwise_op.rs | 49 +- .../integer/server_key/radix_parallel/cmux.rs | 12 +- .../integer/server_key/radix_parallel/mod.rs | 14 +- .../integer/server_key/radix_parallel/mul.rs | 63 +- .../integer/server_key/radix_parallel/neg.rs | 8 +- .../server_key/radix_parallel/reverse_bits.rs | 7 +- .../server_key/radix_parallel/rotate.rs | 8 +- .../server_key/radix_parallel/scalar_add.rs | 16 +- .../radix_parallel/scalar_bitwise_op.rs | 42 +- .../radix_parallel/scalar_comparison.rs | 4 +- .../server_key/radix_parallel/scalar_mul.rs | 8 +- .../radix_parallel/scalar_rotate.rs | 48 +- .../server_key/radix_parallel/scalar_shift.rs | 32 +- .../server_key/radix_parallel/scalar_sub.rs | 8 +- .../server_key/radix_parallel/shift.rs | 8 +- .../server_key/radix_parallel/slice.rs | 42 +- .../integer/server_key/radix_parallel/sub.rs | 30 +- .../radix_parallel/tests_signed/test_add.rs | 8 +- .../radix_parallel/tests_signed/test_cmux.rs | 8 +- .../tests_signed/test_comparison.rs | 36 +- .../tests_signed/test_div_rem.rs | 8 +- .../radix_parallel/tests_signed/test_ilog2.rs | 4 +- .../radix_parallel/tests_signed/test_mul.rs | 4 +- .../tests_signed/test_scalar_comparison.rs | 46 +- .../radix_parallel/tests_signed/test_sub.rs | 4 +- .../radix_parallel/tests_unsigned/mod.rs | 24 +- .../radix_parallel/tests_unsigned/test_add.rs | 8 +- .../tests_unsigned/test_comparison.rs | 36 +- .../tests_unsigned/test_div_mod.rs | 24 +- .../tests_unsigned/test_ilog2.rs | 4 +- .../tests_unsigned/test_scalar_comparison.rs | 56 +- .../tests_unsigned/test_scalar_mul.rs | 2 +- .../radix_parallel/tests_unsigned/test_sub.rs | 4 +- tfhe/src/integer/tests.rs | 16 +- tfhe/src/integer/wopbs/mod.rs | 32 +- tfhe/src/integer/wopbs/test.rs | 8 +- tfhe/src/js_on_wasm_api/shortint.rs | 80 +- tfhe/src/safe_serialization.rs | 14 +- tfhe/src/shortint/client_key/mod.rs | 23 +- tfhe/src/shortint/key_switching_key/mod.rs | 21 +- tfhe/src/shortint/key_switching_key/test.rs | 31 +- tfhe/src/shortint/keycache.rs | 80 +- .../parameters/classic/gaussian/mod.rs | 80 +- .../gaussian/p_fail_2_minus_64/ks_pbs.rs | 168 ++-- .../gaussian/p_fail_2_minus_64/pbs_ks.rs | 16 +- tfhe/src/shortint/parameters/mod.rs | 92 +- .../parameters/v0_10/classic/gaussian/mod.rs | 1 + .../gaussian/p_fail_2_minus_64/ks_pbs.rs | 869 ++++++++++++++++++ .../classic/gaussian/p_fail_2_minus_64/mod.rs | 2 + .../gaussian/p_fail_2_minus_64/pbs_ks.rs | 101 ++ .../shortint/parameters/v0_10/classic/mod.rs | 1 + tfhe/src/shortint/server_key/add.rs | 36 +- tfhe/src/shortint/server_key/bitwise_op.rs | 96 +- tfhe/src/shortint/server_key/comp_op.rs | 120 +-- tfhe/src/shortint/server_key/div_mod.rs | 24 +- tfhe/src/shortint/server_key/mod.rs | 8 +- tfhe/src/shortint/server_key/mul.rs | 89 +- tfhe/src/shortint/server_key/neg.rs | 36 +- tfhe/src/shortint/server_key/scalar_add.rs | 36 +- .../src/shortint/server_key/scalar_div_mod.rs | 8 +- tfhe/src/shortint/server_key/scalar_mul.rs | 40 +- tfhe/src/shortint/server_key/scalar_sub.rs | 36 +- tfhe/src/shortint/server_key/shift.rs | 44 +- .../server_key/tests/parameterized_test.rs | 68 +- ...ameterized_test_bivariate_pbs_compliant.rs | 38 +- tfhe/src/shortint/wopbs/mod.rs | 4 +- tfhe/src/shortint/wopbs/test.rs | 17 +- 131 files changed, 2857 insertions(+), 1567 deletions(-) create mode 100644 tfhe/src/shortint/parameters/v0_10/classic/gaussian/mod.rs create mode 100644 tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs create mode 100644 tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/mod.rs create mode 100644 tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs diff --git a/apps/trivium/benches/kreyvium_shortint.rs b/apps/trivium/benches/kreyvium_shortint.rs index fda65671b6..4ede073b6b 100644 --- a/apps/trivium/benches/kreyvium_shortint.rs +++ b/apps/trivium/benches/kreyvium_shortint.rs @@ -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)), diff --git a/apps/trivium/benches/trivium_shortint.rs b/apps/trivium/benches/trivium_shortint.rs index 933431aea6..b49da8462e 100644 --- a/apps/trivium/benches/trivium_shortint.rs +++ b/apps/trivium/benches/trivium_shortint.rs @@ -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)), diff --git a/apps/trivium/src/kreyvium/test.rs b/apps/trivium/src/kreyvium/test.rs index 64ba6e6dfb..24b2e1bee0 100644 --- a/apps/trivium/src/kreyvium/test.rs +++ b/apps/trivium/src/kreyvium/test.rs @@ -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)), diff --git a/apps/trivium/src/trivium/test.rs b/apps/trivium/src/trivium/test.rs index a505df4239..0d755571fc 100644 --- a/apps/trivium/src/trivium/test.rs +++ b/apps/trivium/src/trivium/test.rs @@ -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)), diff --git a/backends/tfhe-cuda-backend/cuda/tests_and_benchmarks/tests/test_classical_pbs.cpp b/backends/tfhe-cuda-backend/cuda/tests_and_benchmarks/tests/test_classical_pbs.cpp index 5a5223d4fe..e272d2f13c 100644 --- a/backends/tfhe-cuda-backend/cuda/tests_and_benchmarks/tests/test_classical_pbs.cpp +++ b/backends/tfhe-cuda-backend/cuda/tests_and_benchmarks/tests/test_classical_pbs.cpp @@ -237,7 +237,7 @@ ::testing::internal::ParamGenerator (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, diff --git a/tfhe/benches/core_crypto/ks_bench.rs b/tfhe/benches/core_crypto/ks_bench.rs index e874da9275..8b21e700a9 100644 --- a/tfhe/benches/core_crypto/ks_bench.rs +++ b/tfhe/benches/core_crypto/ks_bench.rs @@ -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"))] diff --git a/tfhe/benches/core_crypto/pbs_bench.rs b/tfhe/benches/core_crypto/pbs_bench.rs index badf7abe31..a3fa0bc554 100644 --- a/tfhe/benches/core_crypto/pbs_bench.rs +++ b/tfhe/benches/core_crypto/pbs_bench.rs @@ -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)> { diff --git a/tfhe/benches/shortint/bench.rs b/tfhe/benches/shortint/bench.rs index 544b479b05..a61586bbfd 100644 --- a/tfhe/benches/shortint/bench.rs +++ b/tfhe/benches/shortint/bench.rs @@ -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] = [ diff --git a/tfhe/benches/shortint/casting.rs b/tfhe/benches/shortint/casting.rs index 5ae0d1c189..5dc56d5722 100644 --- a/tfhe/benches/shortint/casting.rs +++ b/tfhe/benches/shortint/casting.rs @@ -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"; diff --git a/tfhe/docs/fundamentals/serialization.md b/tfhe/docs/fundamentals/serialization.md index 2d70db33de..795fe9cf34 100644 --- a/tfhe/docs/fundamentals/serialization.md +++ b/tfhe/docs/fundamentals/serialization.md @@ -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(); diff --git a/tfhe/examples/utilities/generates_test_keys.rs b/tfhe/examples/utilities/generates_test_keys.rs index 2c4e9d1e81..9bc1639529 100644 --- a/tfhe/examples/utilities/generates_test_keys.rs +++ b/tfhe/examples/utilities/generates_test_keys.rs @@ -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, ), ]; diff --git a/tfhe/examples/utilities/shortint_key_sizes.rs b/tfhe/examples/utilities/shortint_key_sizes.rs index 5ea02c201b..9cf228e57c 100644 --- a/tfhe/examples/utilities/shortint_key_sizes.rs +++ b/tfhe/examples/utilities/shortint_key_sizes.rs @@ -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 = 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(), diff --git a/tfhe/examples/utilities/wasm_benchmarks_parser.rs b/tfhe/examples/utilities/wasm_benchmarks_parser.rs index 10256f4fb6..b8facda274 100644 --- a/tfhe/examples/utilities/wasm_benchmarks_parser.rs +++ b/tfhe/examples/utilities/wasm_benchmarks_parser.rs @@ -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 diff --git a/tfhe/src/c_api/shortint/parameters.rs b/tfhe/src/c_api/shortint/parameters.rs index 09252bdb41..7be86247aa 100644 --- a/tfhe/src/c_api/shortint/parameters.rs +++ b/tfhe/src/c_api/shortint/parameters.rs @@ -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, diff --git a/tfhe/src/high_level_api/integers/signed/tests.rs b/tfhe/src/high_level_api/integers/signed/tests.rs index 1509c5813c..32af8a2a0c 100644 --- a/tfhe/src/high_level_api/integers/signed/tests.rs +++ b/tfhe/src/high_level_api/integers/signed/tests.rs @@ -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); diff --git a/tfhe/src/high_level_api/integers/unsigned/tests/cpu.rs b/tfhe/src/high_level_api/integers/unsigned/tests/cpu.rs index 0408c167c7..c662f80b10 100644 --- a/tfhe/src/high_level_api/integers/unsigned/tests/cpu.rs +++ b/tfhe/src/high_level_api/integers/unsigned/tests/cpu.rs @@ -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(); diff --git a/tfhe/src/high_level_api/tests/tags_on_entities.rs b/tfhe/src/high_level_api/tests/tags_on_entities.rs index dee88cd3dc..62dfa384c1 100644 --- a/tfhe/src/high_level_api/tests/tags_on_entities.rs +++ b/tfhe/src/high_level_api/tests/tags_on_entities.rs @@ -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, )), ) diff --git a/tfhe/src/integer/ciphertext/base.rs b/tfhe/src/integer/ciphertext/base.rs index 318fc8e96a..ab00ed6edc 100644 --- a/tfhe/src/integer/ciphertext/base.rs +++ b/tfhe/src/integer/ciphertext/base.rs @@ -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; diff --git a/tfhe/src/integer/ciphertext/boolean_value.rs b/tfhe/src/integer/ciphertext/boolean_value.rs index b915e2c63b..e045866c6b 100644 --- a/tfhe/src/integer/ciphertext/boolean_value.rs +++ b/tfhe/src/integer/ciphertext/boolean_value.rs @@ -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; diff --git a/tfhe/src/integer/ciphertext/compressed_modulus_switched_ciphertext.rs b/tfhe/src/integer/ciphertext/compressed_modulus_switched_ciphertext.rs index ca791ac3c6..2e3bcf5e5a 100644 --- a/tfhe/src/integer/ciphertext/compressed_modulus_switched_ciphertext.rs +++ b/tfhe/src/integer/ciphertext/compressed_modulus_switched_ciphertext.rs @@ -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::(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(), size); +/// let (cks, sks) = gen_keys_radix::( +/// 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::(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(), size); +/// let (cks, sks) = gen_keys_radix::( +/// V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64.into(), +/// size, +/// ); /// /// let clear = -3i8; /// diff --git a/tfhe/src/integer/client_key/crt.rs b/tfhe/src/integer/client_key/crt.rs index ab41f7907e..ba9cf46db2 100644 --- a/tfhe/src/integer/client_key/crt.rs +++ b/tfhe/src/integer/client_key/crt.rs @@ -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; /// diff --git a/tfhe/src/integer/client_key/mod.rs b/tfhe/src/integer/client_key/mod.rs index 855a3df342..79aa436e94 100644 --- a/tfhe/src/integer/client_key/mod.rs +++ b/tfhe/src/integer/client_key/mod.rs @@ -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

(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 = 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 = vec![2, 3, 5]; diff --git a/tfhe/src/integer/client_key/radix.rs b/tfhe/src/integer/client_key/radix.rs index 9d2646ce4d..ac577733e5 100644 --- a/tfhe/src/integer/client_key/radix.rs +++ b/tfhe/src/integer/client_key/radix.rs @@ -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; /// diff --git a/tfhe/src/integer/gpu/ciphertext/boolean_value.rs b/tfhe/src/integer/gpu/ciphertext/boolean_value.rs index 214a8aa26d..390a8add2e 100644 --- a/tfhe/src/integer/gpu/ciphertext/boolean_value.rs +++ b/tfhe/src/integer/gpu/ciphertext/boolean_value.rs @@ -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, /// ); diff --git a/tfhe/src/integer/gpu/server_key/radix/mod.rs b/tfhe/src/integer/gpu/server_key/radix/mod.rs index 508d0e5aa7..a1eebbbae1 100644 --- a/tfhe/src/integer/gpu/server_key/radix/mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/mod.rs @@ -965,7 +965,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: @@ -1005,11 +1005,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); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/mod.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/mod.rs index d2ed604fbb..608a2fea01 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/mod.rs @@ -42,7 +42,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, diff --git a/tfhe/src/integer/key_switching_key/test.rs b/tfhe/src/integer/key_switching_key/test.rs index 5f1e6cd372..819d1d1d96 100644 --- a/tfhe/src/integer/key_switching_key/test.rs +++ b/tfhe/src/integer/key_switching_key/test.rs @@ -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, ); diff --git a/tfhe/src/integer/mod.rs b/tfhe/src/integer/mod.rs index 29bf4a3ed2..9fcd4cd57c 100755 --- a/tfhe/src/integer/mod.rs +++ b/tfhe/src/integer/mod.rs @@ -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

(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

(parameters_set: P, basis: Vec) -> (CrtClientKey, ServerKey) where diff --git a/tfhe/src/integer/oprf.rs b/tfhe/src/integer/oprf.rs index 1c92229c3b..a24a8b8533 100644 --- a/tfhe/src/integer/oprf.rs +++ b/tfhe/src/integer/oprf.rs @@ -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) diff --git a/tfhe/src/integer/public_key/standard.rs b/tfhe/src/integer/public_key/standard.rs index d943134f3a..de67271c6b 100644 --- a/tfhe/src/integer/public_key/standard.rs +++ b/tfhe/src/integer/public_key/standard.rs @@ -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) { diff --git a/tfhe/src/integer/public_key/tests.rs b/tfhe/src/integer/public_key/tests.rs index 77a3da2287..23382e67a3 100644 --- a/tfhe/src/integer/public_key/tests.rs +++ b/tfhe/src/integer/public_key/tests.rs @@ -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 */ diff --git a/tfhe/src/integer/server_key/crt/add_crt.rs b/tfhe/src/integer/server_key/crt/add_crt.rs index c31ffbfd3c..9858aa6d80 100644 --- a/tfhe/src/integer/server_key/crt/add_crt.rs +++ b/tfhe/src/integer/server_key/crt/add_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt/mod.rs b/tfhe/src/integer/server_key/crt/mod.rs index 3258e4a745..3a30cac558 100644 --- a/tfhe/src/integer/server_key/crt/mod.rs +++ b/tfhe/src/integer/server_key/crt/mod.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/crt/mul_crt.rs b/tfhe/src/integer/server_key/crt/mul_crt.rs index 1baac9a7d2..3e11bd2066 100644 --- a/tfhe/src/integer/server_key/crt/mul_crt.rs +++ b/tfhe/src/integer/server_key/crt/mul_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt/neg_crt.rs b/tfhe/src/integer/server_key/crt/neg_crt.rs index 190e0169de..12d6872d45 100644 --- a/tfhe/src/integer/server_key/crt/neg_crt.rs +++ b/tfhe/src/integer/server_key/crt/neg_crt.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/crt/scalar_add_crt.rs b/tfhe/src/integer/server_key/crt/scalar_add_crt.rs index fc4c34234a..7dd1afd208 100644 --- a/tfhe/src/integer/server_key/crt/scalar_add_crt.rs +++ b/tfhe/src/integer/server_key/crt/scalar_add_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt/scalar_mul_crt.rs b/tfhe/src/integer/server_key/crt/scalar_mul_crt.rs index aa6e947d17..53eb590cb5 100644 --- a/tfhe/src/integer/server_key/crt/scalar_mul_crt.rs +++ b/tfhe/src/integer/server_key/crt/scalar_mul_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt/scalar_sub_crt.rs b/tfhe/src/integer/server_key/crt/scalar_sub_crt.rs index c35c220fe8..04d45e469f 100644 --- a/tfhe/src/integer/server_key/crt/scalar_sub_crt.rs +++ b/tfhe/src/integer/server_key/crt/scalar_sub_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt/sub_crt.rs b/tfhe/src/integer/server_key/crt/sub_crt.rs index 38656bc102..33e0f7b95d 100644 --- a/tfhe/src/integer/server_key/crt/sub_crt.rs +++ b/tfhe/src/integer/server_key/crt/sub_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt/tests.rs b/tfhe/src/integer/server_key/crt/tests.rs index e700acad08..1d1ab82b19 100644 --- a/tfhe/src/integer/server_key/crt/tests.rs +++ b/tfhe/src/integer/server_key/crt/tests.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/add_crt.rs b/tfhe/src/integer/server_key/crt_parallel/add_crt.rs index 5602b257b9..b6b1536d17 100644 --- a/tfhe/src/integer/server_key/crt_parallel/add_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/add_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/mod.rs b/tfhe/src/integer/server_key/crt_parallel/mod.rs index cc078c18ad..f3c00116f0 100644 --- a/tfhe/src/integer/server_key/crt_parallel/mod.rs +++ b/tfhe/src/integer/server_key/crt_parallel/mod.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/crt_parallel/mul_crt.rs b/tfhe/src/integer/server_key/crt_parallel/mul_crt.rs index 903efea0a4..2c3f1f7fdc 100644 --- a/tfhe/src/integer/server_key/crt_parallel/mul_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/mul_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/neg_crt.rs b/tfhe/src/integer/server_key/crt_parallel/neg_crt.rs index da812198cd..e80e367d46 100644 --- a/tfhe/src/integer/server_key/crt_parallel/neg_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/neg_crt.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/crt_parallel/scalar_add_crt.rs b/tfhe/src/integer/server_key/crt_parallel/scalar_add_crt.rs index f1e9c2c8d0..53e0b37355 100644 --- a/tfhe/src/integer/server_key/crt_parallel/scalar_add_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/scalar_add_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/scalar_mul_crt.rs b/tfhe/src/integer/server_key/crt_parallel/scalar_mul_crt.rs index e606abac6c..8cef398adc 100644 --- a/tfhe/src/integer/server_key/crt_parallel/scalar_mul_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/scalar_mul_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/scalar_sub_crt.rs b/tfhe/src/integer/server_key/crt_parallel/scalar_sub_crt.rs index a642eaac52..09cd5bafa7 100644 --- a/tfhe/src/integer/server_key/crt_parallel/scalar_sub_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/scalar_sub_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/sub_crt.rs b/tfhe/src/integer/server_key/crt_parallel/sub_crt.rs index a46c6b0b4e..7468376ec9 100644 --- a/tfhe/src/integer/server_key/crt_parallel/sub_crt.rs +++ b/tfhe/src/integer/server_key/crt_parallel/sub_crt.rs @@ -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; diff --git a/tfhe/src/integer/server_key/crt_parallel/tests.rs b/tfhe/src/integer/server_key/crt_parallel/tests.rs index a688b782f0..ba0208f85b 100644 --- a/tfhe/src/integer/server_key/crt_parallel/tests.rs +++ b/tfhe/src/integer/server_key/crt_parallel/tests.rs @@ -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; diff --git a/tfhe/src/integer/server_key/mod.rs b/tfhe/src/integer/server_key/mod.rs index 31e6380205..d554d85cd6 100644 --- a/tfhe/src/integer/server_key/mod.rs +++ b/tfhe/src/integer/server_key/mod.rs @@ -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); diff --git a/tfhe/src/integer/server_key/radix/add.rs b/tfhe/src/integer/server_key/radix/add.rs index a76f9b20c0..0a36a793a2 100644 --- a/tfhe/src/integer/server_key/radix/add.rs +++ b/tfhe/src/integer/server_key/radix/add.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/bitwise_op.rs b/tfhe/src/integer/server_key/radix/bitwise_op.rs index 1dd8174a88..5b0a624a7c 100644 --- a/tfhe/src/integer/server_key/radix/bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix/bitwise_op.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix/comparison.rs b/tfhe/src/integer/server_key/radix/comparison.rs index 523cf60111..c4f6e770e2 100644 --- a/tfhe/src/integer/server_key/radix/comparison.rs +++ b/tfhe/src/integer/server_key/radix/comparison.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/mod.rs b/tfhe/src/integer/server_key/radix/mod.rs index bc2f3dc652..4ad4bcf36b 100644 --- a/tfhe/src/integer/server_key/radix/mod.rs +++ b/tfhe/src/integer/server_key/radix/mod.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix/mul.rs b/tfhe/src/integer/server_key/radix/mul.rs index f19437e0ce..03fa09605f 100644 --- a/tfhe/src/integer/server_key/radix/mul.rs +++ b/tfhe/src/integer/server_key/radix/mul.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/neg.rs b/tfhe/src/integer/server_key/radix/neg.rs index 0b01da4c56..e262cc2cd8 100644 --- a/tfhe/src/integer/server_key/radix/neg.rs +++ b/tfhe/src/integer/server_key/radix/neg.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix/scalar_add.rs b/tfhe/src/integer/server_key/radix/scalar_add.rs index c470660038..e17f69b001 100644 --- a/tfhe/src/integer/server_key/radix/scalar_add.rs +++ b/tfhe/src/integer/server_key/radix/scalar_add.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/scalar_mul.rs b/tfhe/src/integer/server_key/radix/scalar_mul.rs index e8321aac66..d96ff544b1 100644 --- a/tfhe/src/integer/server_key/radix/scalar_mul.rs +++ b/tfhe/src/integer/server_key/radix/scalar_mul.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/scalar_sub.rs b/tfhe/src/integer/server_key/radix/scalar_sub.rs index ddc47ed8fc..53b0f633dd 100644 --- a/tfhe/src/integer/server_key/radix/scalar_sub.rs +++ b/tfhe/src/integer/server_key/radix/scalar_sub.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/shift.rs b/tfhe/src/integer/server_key/radix/shift.rs index 308621066f..e77b2a1337 100644 --- a/tfhe/src/integer/server_key/radix/shift.rs +++ b/tfhe/src/integer/server_key/radix/shift.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/slice.rs b/tfhe/src/integer/server_key/radix/slice.rs index 00b43e09bd..c04846754c 100644 --- a/tfhe/src/integer/server_key/radix/slice.rs +++ b/tfhe/src/integer/server_key/radix/slice.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/sub.rs b/tfhe/src/integer/server_key/radix/sub.rs index 78c3c4ab10..563c7ef018 100644 --- a/tfhe/src/integer/server_key/radix/sub.rs +++ b/tfhe/src/integer/server_key/radix/sub.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix/tests.rs b/tfhe/src/integer/server_key/radix/tests.rs index 26e15e16bc..ede74cb3ba 100644 --- a/tfhe/src/integer/server_key/radix/tests.rs +++ b/tfhe/src/integer/server_key/radix/tests.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/add.rs b/tfhe/src/integer/server_key/radix_parallel/add.rs index 9f838633bc..d9d9b68630 100644 --- a/tfhe/src/integer/server_key/radix_parallel/add.rs +++ b/tfhe/src/integer/server_key/radix_parallel/add.rs @@ -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 diff --git a/tfhe/src/integer/server_key/radix_parallel/bitwise_op.rs b/tfhe/src/integer/server_key/radix_parallel/bitwise_op.rs index bd221a56c0..721d1bb3b5 100644 --- a/tfhe/src/integer/server_key/radix_parallel/bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix_parallel/bitwise_op.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix_parallel/cmux.rs b/tfhe/src/integer/server_key/radix_parallel/cmux.rs index 5c4264eb83..6d97190f83 100644 --- a/tfhe/src/integer/server_key/radix_parallel/cmux.rs +++ b/tfhe/src/integer/server_key/radix_parallel/cmux.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/mod.rs b/tfhe/src/integer/server_key/radix_parallel/mod.rs index aff7c3d27c..99181e8899 100644 --- a/tfhe/src/integer/server_key/radix_parallel/mod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/mod.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix_parallel/mul.rs b/tfhe/src/integer/server_key/radix_parallel/mul.rs index 1d5ebf84e3..72a934e1f8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/mul.rs +++ b/tfhe/src/integer/server_key/radix_parallel/mul.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/neg.rs b/tfhe/src/integer/server_key/radix_parallel/neg.rs index bd5b296514..4ba323a5a8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/neg.rs +++ b/tfhe/src/integer/server_key/radix_parallel/neg.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix_parallel/reverse_bits.rs b/tfhe/src/integer/server_key/radix_parallel/reverse_bits.rs index 2c1bbb1c3a..c8a7b45219 100644 --- a/tfhe/src/integer/server_key/radix_parallel/reverse_bits.rs +++ b/tfhe/src/integer/server_key/radix_parallel/reverse_bits.rs @@ -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; /// diff --git a/tfhe/src/integer/server_key/radix_parallel/rotate.rs b/tfhe/src/integer/server_key/radix_parallel/rotate.rs index 21ae5769eb..dc68a2698a 100644 --- a/tfhe/src/integer/server_key/radix_parallel/rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/rotate.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_add.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_add.rs index d72d034aa0..59a58bccb3 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_add.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_add.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_bitwise_op.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_bitwise_op.rs index fa7ca27c18..82cc7fa055 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_bitwise_op.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_comparison.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_comparison.rs index b558a15f1f..f6eb10e94d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_comparison.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_comparison.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_mul.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_mul.rs index 52390775f9..b323f9f00e 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_mul.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_mul.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_rotate.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_rotate.rs index 3da899d5f9..c75c50f06d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_rotate.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_shift.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_shift.rs index 19244b393f..f93af2375e 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_shift.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/scalar_sub.rs b/tfhe/src/integer/server_key/radix_parallel/scalar_sub.rs index 9ca8759859..871f74c482 100644 --- a/tfhe/src/integer/server_key/radix_parallel/scalar_sub.rs +++ b/tfhe/src/integer/server_key/radix_parallel/scalar_sub.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/shift.rs b/tfhe/src/integer/server_key/radix_parallel/shift.rs index b731ee89ab..deab40126d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/shift.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/slice.rs b/tfhe/src/integer/server_key/radix_parallel/slice.rs index d0e99d3141..a9b8630f2c 100644 --- a/tfhe/src/integer/server_key/radix_parallel/slice.rs +++ b/tfhe/src/integer/server_key/radix_parallel/slice.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/sub.rs b/tfhe/src/integer/server_key/radix_parallel/sub.rs index 8cfb6eca33..dd367042f5 100644 --- a/tfhe/src/integer/server_key/radix_parallel/sub.rs +++ b/tfhe/src/integer/server_key/radix_parallel/sub.rs @@ -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; diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_add.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_add.rs index ddc7fa12f5..232f9ab0dc 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_add.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_add.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_cmux.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_cmux.rs index afc677d0a8..9c81cf8c2b 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_cmux.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_cmux.rs @@ -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

(param: P) diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_comparison.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_comparison.rs index 111cbc95fb..d5880d3089 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_comparison.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_comparison.rs @@ -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!([] { - 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!([] { - 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!([] { - 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); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_div_rem.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_div_rem.rs index 938c6cbf19..bca1d04b06 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_div_rem.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_div_rem.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_ilog2.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_ilog2.rs index 0cdd7af600..1b71e22066 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_ilog2.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_ilog2.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_mul.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_mul.rs index 2910ccc3cb..0252102a0c 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_mul.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_mul.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_comparison.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_comparison.rs index 3727b9adcf..02604e7f22 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_comparison.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_comparison.rs @@ -267,13 +267,13 @@ macro_rules! define_signed_scalar_comparison_test_functions { create_parameterized_test!([] { - 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!([] { - 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!([] { - 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, }); } diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_sub.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_sub.rs index 3fd712ee7f..9c279dd487 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_sub.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_sub.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/mod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/mod.rs index 562ee309ed..08660a977a 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/mod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/mod.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs index 4558ef94f0..cd98362d1d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_add.rs @@ -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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_comparison.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_comparison.rs index 692e9aaa3e..1a95985621 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_comparison.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_comparison.rs @@ -322,21 +322,21 @@ macro_rules! define_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!([] { - 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 }); @@ -351,14 +351,14 @@ macro_rules! define_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!([] { - 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, @@ -366,14 +366,14 @@ macro_rules! define_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!([] { - 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, @@ -381,7 +381,7 @@ macro_rules! define_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 }); @@ -663,28 +663,28 @@ mod no_coverage { create_parameterized_test!(integer_unchecked_min_parallelized_u256); create_parameterized_test!(integer_unchecked_max_parallelized_u256); create_parameterized_test!(integer_smart_min_parallelized_u256 { - 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, // No test for 3_3, see define_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); create_parameterized_test!(integer_smart_max_parallelized_u256 { - 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, // No test for 3_3, see define_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); create_parameterized_test!(integer_min_parallelized_u256 { - 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, // No test for 3_3, see define_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); create_parameterized_test!(integer_max_parallelized_u256 { - 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, // No test for 3_3, see define_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); define_comparison_test_functions!(eq, U256); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_div_mod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_div_mod.rs index 35f3810a92..60e78b8569 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_div_mod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_div_mod.rs @@ -21,8 +21,8 @@ create_parameterized_test!( // Due to the use of comparison, // 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, @@ -40,8 +40,8 @@ create_parameterized_test!( // Due to the use of comparison, // 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, @@ -59,8 +59,8 @@ create_parameterized_test!( // Due to the use of comparison, // 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, @@ -78,8 +78,8 @@ create_parameterized_test!( // Due to the use of comparison, // 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, @@ -97,8 +97,8 @@ create_parameterized_test!( // Due to the use of comparison, // 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, @@ -116,8 +116,8 @@ create_parameterized_test!( // Due to the use of comparison, // 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, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_ilog2.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_ilog2.rs index e5ec417295..b2e9845f25 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_ilog2.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_ilog2.rs @@ -20,8 +20,8 @@ create_parameterized_test!(integer_default_ilog2); create_parameterized_test!(integer_default_checked_ilog2 { // This uses comparisons, so require more than 1 bit 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_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_comparison.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_comparison.rs index a02b8ff516..e608a697e7 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_comparison.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_comparison.rs @@ -245,13 +245,13 @@ macro_rules! define_scalar_comparison_test_functions { create_parameterized_test!([] { - 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 }); @@ -259,14 +259,14 @@ macro_rules! define_scalar_comparison_test_functions { create_parameterized_test!([] { - 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 smart 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, #[cfg(tarpaulin)] COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS }); @@ -274,14 +274,14 @@ macro_rules! define_scalar_comparison_test_functions { create_parameterized_test!([] { - 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, #[cfg(tarpaulin)] COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS }); @@ -713,41 +713,41 @@ mod no_coverage { } create_parameterized_test!(integer_unchecked_scalar_min_parallelized_u256 { - 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_unchecked_scalar_max_parallelized_u256 { - 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_smart_scalar_min_parallelized_u256 { - 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, // No test for 3_3, see define_scalar_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); create_parameterized_test!(integer_smart_scalar_max_parallelized_u256 { - 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, // No test for 3_3, see define_scalar_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); create_parameterized_test!(integer_scalar_min_parallelized_u256 { - 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, // No test for 3_3, see define_scalar_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); create_parameterized_test!(integer_scalar_max_parallelized_u256 { - 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, // No test for 3_3, see define_scalar_comparison_test_functions macro - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 }); define_scalar_comparison_test_functions!(eq, U256); @@ -758,10 +758,10 @@ mod no_coverage { define_scalar_comparison_test_functions!(ge, U256); create_parameterized_test!(integer_unchecked_scalar_comparisons_edge { - 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_is_scalar_out_of_bounds { @@ -769,14 +769,14 @@ mod no_coverage { // 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 }); create_parameterized_test!(integer_comparisons_for_empty_blocks { - 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, }); } diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_mul.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_mul.rs index 63efdd0ac0..d440389206 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_mul.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_mul.rs @@ -15,7 +15,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, } } diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sub.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sub.rs index d61306a745..75bc5e6423 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sub.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sub.rs @@ -30,8 +30,8 @@ create_parameterized_test!(integer_advanced_sub_assign_with_borrow_at_least_4_bi }, 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, diff --git a/tfhe/src/integer/tests.rs b/tfhe/src/integer/tests.rs index e11e7a6330..a2f784df6b 100644 --- a/tfhe/src/integer/tests.rs +++ b/tfhe/src/integer/tests.rs @@ -23,10 +23,10 @@ macro_rules! 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, - 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_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_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_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, @@ -65,10 +65,10 @@ macro_rules! create_parameterized_test_classical_params { COVERAGE_PARAM_MESSAGE_2_CARRY_2_KS_PBS }, no_coverage => { - 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_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64 } }); }; diff --git a/tfhe/src/integer/wopbs/mod.rs b/tfhe/src/integer/wopbs/mod.rs index b701d05c64..77c36f91c9 100644 --- a/tfhe/src/integer/wopbs/mod.rs +++ b/tfhe/src/integer/wopbs/mod.rs @@ -219,10 +219,10 @@ mod experimental { /// use tfhe::integer::gen_keys_radix; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS; - /// 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; /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, 1); + /// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, 1); /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS); /// ``` pub fn new_wopbs_key>( @@ -271,11 +271,11 @@ mod experimental { /// use tfhe::integer::gen_keys_radix; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS; - /// 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 nb_block = 3; /// //Generate the client key and the server key: - /// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); + /// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// let mut moduli = 1_u64; /// for _ in 0..nb_block { @@ -479,11 +479,11 @@ mod experimental { /// use tfhe::integer::gen_keys_radix; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS; - /// 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 nb_block = 3; /// //Generate the client key and the server key: - /// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); + /// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); /// /// // Generate wopbs_v0 key /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -519,11 +519,11 @@ mod experimental { /// use tfhe::integer::gen_keys_radix; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS; - /// 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 nb_block = 3; /// //Generate the client key and the server key: - /// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); + /// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); /// /// //Generate wopbs_v0 key /// /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -591,11 +591,11 @@ mod experimental { /// use tfhe::integer::gen_keys_radix; /// use tfhe::integer::wopbs::WopbsKey; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS; - /// 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 nb_block = 3; /// //Generate the client key and the server key: - /// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); + /// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); /// //Generate wopbs_v0 key /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// let mut moduli = 1_u64; @@ -718,13 +718,13 @@ mod experimental { /// use tfhe::integer::gen_keys_crt; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS; - /// 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 = vec![5, 7]; /// let msg_space: u64 = basis.iter().copied().product(); /// /// //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 wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS); /// /// let clear = 42 % msg_space; @@ -785,11 +785,11 @@ mod experimental { /// use tfhe::integer::gen_keys_radix; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS; - /// 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 nb_block = 3; /// //Generate the client key and the server key: - /// let (cks, sks) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); + /// let (cks, sks) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, nb_block); /// /// //Generate wopbs_v0 key /// /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -883,12 +883,12 @@ mod experimental { /// use tfhe::integer::gen_keys_crt; /// use tfhe::integer::wopbs::*; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS; - /// 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 = vec![5, 7]; /// let msg_space: u64 = basis.iter().copied().product(); /// //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 wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS); /// /// let clear1 = 42 % msg_space; // Encrypt the integers diff --git a/tfhe/src/integer/wopbs/test.rs b/tfhe/src/integer/wopbs/test.rs index 1df0b0ffea..4c6d175064 100644 --- a/tfhe/src/integer/wopbs/test.rs +++ b/tfhe/src/integer/wopbs/test.rs @@ -38,11 +38,11 @@ macro_rules! create_parameterized_test{ ( ($name:ident)=> { create_parameterized_test!($name { - (PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS), + (V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS), #[cfg(not(tarpaulin))] - (PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS), + (V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS), #[cfg(not(tarpaulin))] - (PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_4_CARRY_4_KS_PBS) + (V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_4_CARRY_4_KS_PBS) }); }; } @@ -268,7 +268,7 @@ pub fn test_wopbs_non_reg_trivial_0() { use crate::integer::{gen_keys_radix, RadixCiphertext, RadixClientKey, ServerKey}; fn generate_keys() -> (RadixClientKey, ServerKey, WopbsKey) { - let (ck, sk) = gen_keys_radix(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 16); + let (ck, sk) = gen_keys_radix(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, 16); let wopbs_key = WopbsKey::new_wopbs_key(&ck, &sk, &LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS); (ck, sk, wopbs_key) diff --git a/tfhe/src/js_on_wasm_api/shortint.rs b/tfhe/src/js_on_wasm_api/shortint.rs index 9deab18afb..3436c6d6f7 100644 --- a/tfhe/src/js_on_wasm_api/shortint.rs +++ b/tfhe/src/js_on_wasm_api/shortint.rs @@ -307,47 +307,47 @@ macro_rules! expose_predefined_parameters { } expose_predefined_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_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64, V0_11_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64, diff --git a/tfhe/src/safe_serialization.rs b/tfhe/src/safe_serialization.rs index 0fe1ca9a07..e29ce2f696 100644 --- a/tfhe/src/safe_serialization.rs +++ b/tfhe/src/safe_serialization.rs @@ -496,7 +496,8 @@ pub fn safe_deserialize_conformant< mod test_shortint { use crate::safe_serialization::{DeserializationConfig, SerializationConfig}; use crate::shortint::parameters::{ - 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_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, }; use crate::shortint::{gen_keys, Ciphertext}; @@ -520,7 +521,7 @@ mod test_shortint { assert!(DeserializationConfig::new(1 << 20) .deserialize_from::( buffer.as_slice(), - &PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.to_shortint_conformance_param() + &V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.to_shortint_conformance_param() ) .is_err()); @@ -555,7 +556,7 @@ mod test_shortint { assert!(DeserializationConfig::new(1 << 20,) .deserialize_from::( buffer.as_slice(), - &PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.to_shortint_conformance_param() + &V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64.to_shortint_conformance_param() ) .is_err()); @@ -634,7 +635,8 @@ mod test_integer { use crate::prelude::*; use crate::safe_serialization::{DeserializationConfig, SerializationConfig}; use crate::shortint::parameters::{ - 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_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, }; use crate::{ set_server_key, CompactCiphertextList, CompactCiphertextListConformanceParams, @@ -673,7 +675,7 @@ mod test_integer { for param_set in [ CompactCiphertextListConformanceParams { - shortint_params: PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64 + shortint_params: V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64 .to_shortint_conformance_param(), num_elements_constraint: ListSizeConstraint::exact_size(3), }, @@ -756,7 +758,7 @@ mod test_integer { for param_set in [ CompactCiphertextListConformanceParams { - shortint_params: PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64 + shortint_params: V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64 .to_shortint_conformance_param(), num_elements_constraint: ListSizeConstraint::exact_size(3), }, diff --git a/tfhe/src/shortint/client_key/mod.rs b/tfhe/src/shortint/client_key/mod.rs index b6efb2cbfa..26d9aca041 100644 --- a/tfhe/src/shortint/client_key/mod.rs +++ b/tfhe/src/shortint/client_key/mod.rs @@ -466,7 +466,7 @@ impl ClientKey { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// use tfhe::shortint::ClientKey; /// @@ -482,7 +482,7 @@ impl ClientKey { /// let dec = cks.decrypt_message_and_carry(&ct); /// assert_eq!(msg, dec); /// - /// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encryption of one message: /// let ct = cks.encrypt(msg); @@ -512,7 +512,7 @@ impl ClientKey { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// use tfhe::shortint::ClientKey; /// @@ -528,7 +528,7 @@ impl ClientKey { /// let dec = cks.decrypt(&ct); /// assert_eq!(msg, dec); /// - /// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encryption of one message: /// let ct = cks.encrypt(msg); @@ -609,12 +609,13 @@ impl ClientKey { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64, /// }; /// use tfhe::shortint::ClientKey; /// /// // Generate the client key - /// let cks = ClientKey::new(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// /// let msg = 3; /// @@ -625,7 +626,7 @@ impl ClientKey { /// let dec = cks.decrypt_message_and_carry_without_padding(&ct); /// assert_eq!(msg, dec); /// - /// let cks = ClientKey::new(PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64); + /// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64); /// /// // Encryption of one message: /// let ct = cks.encrypt_without_padding(msg); @@ -657,7 +658,7 @@ impl ClientKey { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// use tfhe::shortint::ClientKey; /// @@ -674,7 +675,7 @@ impl ClientKey { /// let dec = cks.decrypt_without_padding(&ct); /// assert_eq!(msg % modulus, dec); /// - /// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encryption of one message: /// let ct = cks.encrypt_without_padding(msg); @@ -760,7 +761,7 @@ impl ClientKey { /// ```rust /// use tfhe::shortint::parameters::{ /// MessageModulus, PARAM_MESSAGE_2_CARRY_2_KS_PBS, - /// PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// use tfhe::shortint::ClientKey; /// @@ -778,7 +779,7 @@ impl ClientKey { /// assert_eq!(msg, dec % modulus.0); /// /// // Generate the client key - /// let cks = ClientKey::new(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let cks = ClientKey::new(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encryption of one message: /// let ct = cks.encrypt_native_crt(msg, modulus); diff --git a/tfhe/src/shortint/key_switching_key/mod.rs b/tfhe/src/shortint/key_switching_key/mod.rs index 77ee072dda..4aa6082587 100644 --- a/tfhe/src/shortint/key_switching_key/mod.rs +++ b/tfhe/src/shortint/key_switching_key/mod.rs @@ -176,14 +176,15 @@ impl KeySwitchingKey { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS, + /// 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::*; /// use tfhe::shortint::{gen_keys, KeySwitchingKey}; /// /// // Generate the client keys and server keys: - /// let (ck1, sk1) = gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); - /// let (ck2, sk2) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); + /// let (ck1, sk1) = gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (ck2, sk2) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64); /// /// // Generate the server key: /// let ksk = KeySwitchingKey::new( @@ -322,14 +323,15 @@ impl KeySwitchingKey { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS, + /// 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::*; /// use tfhe::shortint::{gen_keys, KeySwitchingKey}; /// /// // Generate the client keys and server keys: - /// let (ck1, sk1) = gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); - /// let (ck2, sk2) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); + /// let (ck1, sk1) = gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (ck2, sk2) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64); /// /// // Generate the server key: /// let ksk = KeySwitchingKey::new( @@ -462,14 +464,15 @@ impl<'keys> KeySwitchingKeyView<'keys> { /// /// ```rust /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS, + /// 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::*; /// use tfhe::shortint::{gen_keys, KeySwitchingKey}; /// /// // Generate the client keys and server keys: - /// let (ck1, sk1) = gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); - /// let (ck2, sk2) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); + /// let (ck1, sk1) = gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (ck2, sk2) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64); /// /// // Generate the server key: /// let ksk = KeySwitchingKey::new( diff --git a/tfhe/src/shortint/key_switching_key/test.rs b/tfhe/src/shortint/key_switching_key/test.rs index ccb99480e2..239930d4ea 100644 --- a/tfhe/src/shortint/key_switching_key/test.rs +++ b/tfhe/src/shortint/key_switching_key/test.rs @@ -1,15 +1,16 @@ use crate::shortint::keycache::{KEY_CACHE, KEY_CACHE_KSK}; use crate::shortint::parameters::{ - ShortintKeySwitchingParameters, 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, + ShortintKeySwitchingParameters, 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, }; use crate::shortint::prelude::*; #[test] fn gen_multi_keys_test_fresh_ci_run_filter() { let keys = KEY_CACHE_KSK.get_from_param(( - 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, )); let ck1 = keys.client_key_1(); @@ -57,7 +58,7 @@ fn gen_multi_keys_test_fresh_ci_run_filter() { #[test] fn gen_multi_keys_test_fresh_2_ci_run_filter() { - let keys2 = KEY_CACHE.get_from_param(PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64); + let keys2 = KEY_CACHE.get_from_param(V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64); let (ck2, sk2) = (keys2.client_key(), keys2.server_key()); let ksk_params = ShortintKeySwitchingParameters::new( @@ -67,8 +68,8 @@ fn gen_multi_keys_test_fresh_2_ci_run_filter() { ); let keys = KEY_CACHE_KSK.get_from_param(( - 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, ksk_params, )); let ck1 = keys.client_key_1(); @@ -116,8 +117,8 @@ fn gen_multi_keys_test_fresh_2_ci_run_filter() { #[test] fn gen_multi_keys_test_add_with_overflow_ci_run_filter() { let keys = KEY_CACHE_KSK.get_from_param(( - 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, )); let (ck1, sk1) = (keys.client_key_1(), keys.server_key_1()); @@ -141,7 +142,7 @@ fn gen_multi_keys_test_add_with_overflow_ci_run_filter() { #[test] fn gen_multi_keys_test_no_shift_ci_run_filter() { - let keys2 = KEY_CACHE.get_from_param(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + let keys2 = KEY_CACHE.get_from_param(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); let ck2 = keys2.client_key(); let ksk_params = ShortintKeySwitchingParameters::new( @@ -151,8 +152,8 @@ fn gen_multi_keys_test_no_shift_ci_run_filter() { ); let keys = KEY_CACHE_KSK.get_from_param(( - PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, ksk_params, )); let ksk = keys.key_switching_key(); @@ -162,7 +163,7 @@ fn gen_multi_keys_test_no_shift_ci_run_filter() { #[test] fn gen_multi_keys_test_truncate_ci_run_filter() { - let keys2 = KEY_CACHE.get_from_param(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + let keys2 = KEY_CACHE.get_from_param(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); let (ck2, sk2) = (keys2.client_key(), keys2.server_key()); let ksk_params = ShortintKeySwitchingParameters::new( @@ -172,8 +173,8 @@ fn gen_multi_keys_test_truncate_ci_run_filter() { ); let keys = KEY_CACHE_KSK.get_from_param(( - PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, ksk_params, )); let (ck1, sk1) = (keys.client_key_1(), keys.server_key_1()); diff --git a/tfhe/src/shortint/keycache.rs b/tfhe/src/shortint/keycache.rs index f88633dd01..75728b34b7 100644 --- a/tfhe/src/shortint/keycache.rs +++ b/tfhe/src/shortint/keycache.rs @@ -17,47 +17,47 @@ use crate::shortint::{ClientKey, KeySwitchingKey, ServerKey}; use serde::{Deserialize, Serialize}; named_params_impl!( ShortintParameterSet => - PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64, - 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_1_CARRY_7_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_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_0_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_2_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_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_7_CARRY_0_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_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_1_CARRY_7_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_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_0_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_2_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_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_7_CARRY_0_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 - 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, // MultiBit Group 2 PARAM_MULTI_BIT_GROUP_2_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64, PARAM_MULTI_BIT_GROUP_2_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, diff --git a/tfhe/src/shortint/parameters/classic/gaussian/mod.rs b/tfhe/src/shortint/parameters/classic/gaussian/mod.rs index 8d0069a81f..f4ecacbf41 100644 --- a/tfhe/src/shortint/parameters/classic/gaussian/mod.rs +++ b/tfhe/src/shortint/parameters/classic/gaussian/mod.rs @@ -4,44 +4,44 @@ use crate::shortint::ClassicPBSParameters; pub mod p_fail_2_minus_64; pub const ALL_PARAMETER_VEC_GAUSSIAN: [ClassicPBSParameters; 40] = [ - PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64, - 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_1_CARRY_7_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_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_0_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_2_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_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64, - 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_0_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_1_CARRY_7_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_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_0_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_2_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_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_7_CARRY_0_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, + 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, ]; diff --git a/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs b/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs index 90cc6ee0b6..9af60fde8b 100644 --- a/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs +++ b/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs @@ -2,7 +2,7 @@ use crate::core_crypto::prelude::*; use crate::shortint::ciphertext::MaxNoiseLevel; use crate::shortint::parameters::{CarryModulus, ClassicPBSParameters, MessageModulus}; // p-fail = 2^-64.612, algorithmic cost ~ 39, 2-norm = 1 -pub const PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(720), glwe_dimension: GlweDimension(6), @@ -25,7 +25,7 @@ pub const PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.01, algorithmic cost ~ 60, 2-norm = 3 -pub const PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(781), glwe_dimension: GlweDimension(4), @@ -48,7 +48,7 @@ pub const PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.415, algorithmic cost ~ 76, 2-norm = 7 -pub const PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(858), glwe_dimension: GlweDimension(2), @@ -71,7 +71,7 @@ pub const PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.088, algorithmic cost ~ 109, 2-norm = 15 -pub const PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(859), glwe_dimension: GlweDimension(1), @@ -94,7 +94,7 @@ pub const PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.069, algorithmic cost ~ 362, 2-norm = 31 -pub const PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(902), glwe_dimension: GlweDimension(1), @@ -117,7 +117,7 @@ pub const PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.068, algorithmic cost ~ 836, 2-norm = 63 -pub const PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(981), glwe_dimension: GlweDimension(1), @@ -140,7 +140,7 @@ pub const PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.054, algorithmic cost ~ 2522, 2-norm = 127 -pub const PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1054), glwe_dimension: GlweDimension(1), @@ -163,7 +163,7 @@ pub const PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.02, algorithmic cost ~ 8616, 2-norm = 255 -pub const PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1114), glwe_dimension: GlweDimension(1), @@ -186,7 +186,7 @@ pub const PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.023, algorithmic cost ~ 45, 2-norm = 1 -pub const PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(775), glwe_dimension: GlweDimension(3), @@ -209,7 +209,7 @@ pub const PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.176, algorithmic cost ~ 76, 2-norm = 2 -pub const PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(857), glwe_dimension: GlweDimension(2), @@ -232,7 +232,7 @@ pub const PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.074, algorithmic cost ~ 106, 2-norm = 5 -pub const PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(834), glwe_dimension: GlweDimension(1), @@ -255,7 +255,7 @@ pub const PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.084, algorithmic cost ~ 362, 2-norm = 10 -pub const PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(902), glwe_dimension: GlweDimension(1), @@ -278,7 +278,7 @@ pub const PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.078, algorithmic cost ~ 833, 2-norm = 21 -pub const PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(977), glwe_dimension: GlweDimension(1), @@ -300,8 +300,8 @@ pub const PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; -// p-fail = 2^-64.058, algorithmic cost ~ 2517, 2-norm = 42 -pub const PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +// p-fail = 2^-64.151, algorithmic cost ~ 2517, 2-norm = 42 +pub const V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1052), glwe_dimension: GlweDimension(1), @@ -312,19 +312,19 @@ pub const PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( 2.168404344971009e-19, )), - pbs_base_log: DecompositionBaseLog(12), + pbs_base_log: DecompositionBaseLog(11), pbs_level: DecompositionLevelCount(3), ks_base_log: DecompositionBaseLog(3), ks_level: DecompositionLevelCount(7), message_modulus: MessageModulus(4), carry_modulus: CarryModulus(32), max_noise_level: MaxNoiseLevel::new(42), - log2_p_fail: -64.058, + log2_p_fail: -64.151, ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.001, algorithmic cost ~ 7229, 2-norm = 85 -pub const PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1114), glwe_dimension: GlweDimension(1), @@ -347,7 +347,7 @@ pub const PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.193, algorithmic cost ~ 76, 2-norm = 1 -pub const PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(857), glwe_dimension: GlweDimension(2), @@ -370,7 +370,7 @@ pub const PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.346, algorithmic cost ~ 106, 2-norm = 2 -pub const PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(833), glwe_dimension: GlweDimension(1), @@ -393,7 +393,7 @@ pub const PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.064, algorithmic cost ~ 260, 2-norm = 4 -pub const PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(935), glwe_dimension: GlweDimension(1), @@ -415,8 +415,8 @@ pub const PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; -// p-fail = 2^-64.122, algorithmic cost ~ 833, 2-norm = 9 -pub const PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +// p-fail = 2^-64.166, algorithmic cost ~ 833, 2-norm = 9 +pub const V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(977), glwe_dimension: GlweDimension(1), @@ -427,19 +427,19 @@ pub const PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( 2.168404344971009e-19, )), - pbs_base_log: DecompositionBaseLog(16), + pbs_base_log: DecompositionBaseLog(15), pbs_level: DecompositionLevelCount(2), ks_base_log: DecompositionBaseLog(3), ks_level: DecompositionLevelCount(6), message_modulus: MessageModulus(8), carry_modulus: CarryModulus(8), max_noise_level: MaxNoiseLevel::new(9), - log2_p_fail: -64.122, + log2_p_fail: -64.166, ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.037, algorithmic cost ~ 1947, 2-norm = 18 -pub const PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1061), glwe_dimension: GlweDimension(1), @@ -462,7 +462,7 @@ pub const PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.0, algorithmic cost ~ 6009, 2-norm = 36 -pub const PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1118), glwe_dimension: GlweDimension(1), @@ -485,7 +485,7 @@ pub const PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.454, algorithmic cost ~ 106, 2-norm = 1 -pub const PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(833), glwe_dimension: GlweDimension(1), @@ -507,8 +507,8 @@ pub const PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; -// p-fail = 2^-64.071, algorithmic cost ~ 250, 2-norm = 2 -pub const PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +// p-fail = 2^-64.077, algorithmic cost ~ 250, 2-norm = 2 +pub const V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(954), glwe_dimension: GlweDimension(1), @@ -519,19 +519,19 @@ pub const PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( 2.168404344971009e-19, )), - pbs_base_log: DecompositionBaseLog(23), + pbs_base_log: DecompositionBaseLog(22), pbs_level: DecompositionLevelCount(1), ks_base_log: DecompositionBaseLog(4), ks_level: DecompositionLevelCount(4), message_modulus: MessageModulus(16), carry_modulus: CarryModulus(2), max_noise_level: MaxNoiseLevel::new(2), - log2_p_fail: -64.071, + log2_p_fail: -64.077, ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.182, algorithmic cost ~ 833, 2-norm = 4 -pub const PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(977), glwe_dimension: GlweDimension(1), @@ -554,7 +554,7 @@ pub const PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.099, algorithmic cost ~ 1933, 2-norm = 8 -pub const PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1053), glwe_dimension: GlweDimension(1), @@ -577,7 +577,7 @@ pub const PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.033, algorithmic cost ~ 5904, 2-norm = 17 -pub const PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1112), glwe_dimension: GlweDimension(1), @@ -600,7 +600,7 @@ pub const PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.068, algorithmic cost ~ 248, 2-norm = 1 -pub const PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(946), glwe_dimension: GlweDimension(1), @@ -623,7 +623,7 @@ pub const PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.185, algorithmic cost ~ 833, 2-norm = 2 -pub const PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(977), glwe_dimension: GlweDimension(1), @@ -646,7 +646,7 @@ pub const PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.137, algorithmic cost ~ 1931, 2-norm = 4 -pub const PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1052), glwe_dimension: GlweDimension(1), @@ -669,7 +669,7 @@ pub const PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.004, algorithmic cost ~ 5888, 2-norm = 8 -pub const PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1109), glwe_dimension: GlweDimension(1), @@ -692,7 +692,7 @@ pub const PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.034, algorithmic cost ~ 609, 2-norm = 1 -pub const PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1005), glwe_dimension: GlweDimension(1), @@ -715,7 +715,7 @@ pub const PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.031, algorithmic cost ~ 1929, 2-norm = 2 -pub const PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1051), glwe_dimension: GlweDimension(1), @@ -738,7 +738,7 @@ pub const PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.007, algorithmic cost ~ 5390, 2-norm = 4 -pub const PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1111), glwe_dimension: GlweDimension(1), @@ -760,8 +760,8 @@ pub const PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; -// p-fail = 2^-64.032, algorithmic cost ~ 1929, 2-norm = 1 -pub const PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +// p-fail = 2^-64.042, algorithmic cost ~ 1929, 2-norm = 1 +pub const V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1051), glwe_dimension: GlweDimension(1), @@ -772,19 +772,19 @@ pub const PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( 2.168404344971009e-19, )), - pbs_base_log: DecompositionBaseLog(16), + pbs_base_log: DecompositionBaseLog(15), pbs_level: DecompositionLevelCount(2), ks_base_log: DecompositionBaseLog(3), ks_level: DecompositionLevelCount(7), message_modulus: MessageModulus(128), carry_modulus: CarryModulus(1), max_noise_level: MaxNoiseLevel::new(1), - log2_p_fail: -64.032, + log2_p_fail: -64.042, ciphertext_modulus: CiphertextModulus::new_native(), encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.017, algorithmic cost ~ 4609, 2-norm = 2 -pub const PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1116), glwe_dimension: GlweDimension(1), @@ -807,7 +807,7 @@ pub const PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; // p-fail = 2^-64.011, algorithmic cost ~ 4584, 2-norm = 1 -pub const PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1110), glwe_dimension: GlweDimension(1), @@ -830,40 +830,40 @@ pub const PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Big, }; pub const WITH_CARRY_PARAMETERS_VEC: [ClassicPBSParameters; 36] = [ - PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64, - 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_1_CARRY_7_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_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_0_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_2_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_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_7_CARRY_0_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_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_1_CARRY_7_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_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_0_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_2_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_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_7_CARRY_0_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, ]; diff --git a/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs b/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs index 3d28d74191..e120a6af69 100644 --- a/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs +++ b/tfhe/src/shortint/parameters/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs @@ -2,7 +2,7 @@ use crate::core_crypto::prelude::*; use crate::shortint::ciphertext::MaxNoiseLevel; use crate::shortint::parameters::{CarryModulus, ClassicPBSParameters, MessageModulus}; // p-fail = 2^-64.05, algorithmic cost ~ 67, 2-norm = 3 -pub const PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(884), glwe_dimension: GlweDimension(4), @@ -25,7 +25,7 @@ pub const PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Small, }; // p-fail = 2^-64.107, algorithmic cost ~ 124, 2-norm = 5 -pub const PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(944), glwe_dimension: GlweDimension(1), @@ -48,7 +48,7 @@ pub const PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Small, }; // p-fail = 2^-64.007, algorithmic cost ~ 1066, 2-norm = 9 -pub const PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1121), glwe_dimension: GlweDimension(1), @@ -71,7 +71,7 @@ pub const PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Small, }; // p-fail = 2^-64.507, algorithmic cost ~ 13479, 2-norm = 17 -pub const PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = +pub const V0_11_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = ClassicPBSParameters { lwe_dimension: LweDimension(1254), glwe_dimension: GlweDimension(1), @@ -94,8 +94,8 @@ pub const PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = encryption_key_choice: EncryptionKeyChoice::Small, }; pub const WITH_CARRY_PARAMETERS_VEC_PBS_KS: [ClassicPBSParameters; 4] = [ - 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, ]; diff --git a/tfhe/src/shortint/parameters/mod.rs b/tfhe/src/shortint/parameters/mod.rs index 8525eec94e..c86063551b 100644 --- a/tfhe/src/shortint/parameters/mod.rs +++ b/tfhe/src/shortint/parameters/mod.rs @@ -671,56 +671,56 @@ pub const ALL_PARAMETER_VEC: [ClassicPBSParameters; 29] = WITH_CARRY_PARAMETERS_ /// Vector containing all parameter sets where the carry space is strictly greater than one pub const WITH_CARRY_PARAMETERS_VEC: [ClassicPBSParameters; 29] = [ - 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_1_CARRY_7_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_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_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_1_CARRY_7_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, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, - PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_2_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_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_2_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_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_1_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, ]; /// Vector containing all parameter sets where the carry space is strictly greater than one pub const BIVARIATE_PBS_COMPLIANT_PARAMETER_SET_VEC: [ClassicPBSParameters; 17] = [ - 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_1_CARRY_7_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_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_1_CARRY_7_KS_PBS_GAUSSIAN_2M64, + V0_11_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_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_4_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, ]; /// Nomenclature: PARAM_MESSAGE_X_CARRY_Y: the message (respectively carry) modulus is @@ -734,12 +734,12 @@ pub const BIVARIATE_PBS_COMPLIANT_PARAMETER_SET_VEC: [ClassicPBSParameters; 17] /// /// ```rust /// use tfhe::shortint::parameters::{ -/// get_parameters_from_message_and_carry, PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64, +/// get_parameters_from_message_and_carry, V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64, /// }; /// let message_space = 7; /// let carry_space = 2; /// let param = get_parameters_from_message_and_carry(message_space, carry_space); -/// assert_eq!(param, PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64); +/// assert_eq!(param, V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// ``` pub fn get_parameters_from_message_and_carry( msg_space: usize, diff --git a/tfhe/src/shortint/parameters/v0_10/classic/gaussian/mod.rs b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/mod.rs new file mode 100644 index 0000000000..55c2d9ab42 --- /dev/null +++ b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/mod.rs @@ -0,0 +1 @@ +pub mod p_fail_2_minus_64; diff --git a/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs new file mode 100644 index 0000000000..dda276e7ba --- /dev/null +++ b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/ks_pbs.rs @@ -0,0 +1,869 @@ +use crate::core_crypto::prelude::*; +use crate::shortint::ciphertext::MaxNoiseLevel; +use crate::shortint::parameters::{CarryModulus, ClassicPBSParameters, MessageModulus}; +// p-fail = 2^-64.612, algorithmic cost ~ 39, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(720), + glwe_dimension: GlweDimension(6), + polynomial_size: PolynomialSize(256), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.540544392252957e-05, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 1.9524392655548086e-11, + )), + pbs_base_log: DecompositionBaseLog(17), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(4), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.612, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.01, algorithmic cost ~ 60, 2-norm = 3 +pub const V0_10_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(781), + glwe_dimension: GlweDimension(4), + polynomial_size: PolynomialSize(512), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 8.868480365938865e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(4), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(3), + log2_p_fail: -64.01, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.415, algorithmic cost ~ 76, 2-norm = 7 +pub const V0_10_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(858), + glwe_dimension: GlweDimension(2), + polynomial_size: PolynomialSize(1024), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.348996819227123e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(5), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(7), + log2_p_fail: -64.415, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.088, algorithmic cost ~ 109, 2-norm = 15 +pub const V0_10_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(859), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(2048), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.3088161607134664e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(5), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(8), + max_noise_level: MaxNoiseLevel::new(15), + log2_p_fail: -64.088, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.069, algorithmic cost ~ 362, 2-norm = 31 +pub const V0_10_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(902), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(4096), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 1.0994794733558207e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(16), + max_noise_level: MaxNoiseLevel::new(31), + log2_p_fail: -64.069, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.068, algorithmic cost ~ 836, 2-norm = 63 +pub const V0_10_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(981), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.8134175707144757e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(32), + max_noise_level: MaxNoiseLevel::new(63), + log2_p_fail: -64.068, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.054, algorithmic cost ~ 2522, 2-norm = 127 +pub const V0_10_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1054), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 7.984352743330102e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(11), + pbs_level: DecompositionLevelCount(3), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(64), + max_noise_level: MaxNoiseLevel::new(127), + log2_p_fail: -64.054, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.02, algorithmic cost ~ 8616, 2-norm = 255 +pub const V0_10_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1114), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.8356668849263424e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(7), + pbs_level: DecompositionLevelCount(5), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(12), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(128), + max_noise_level: MaxNoiseLevel::new(255), + log2_p_fail: -64.02, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.023, algorithmic cost ~ 45, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(775), + glwe_dimension: GlweDimension(3), + polynomial_size: PolynomialSize(512), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 9.83575402535913e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 1.9524392655548086e-11, + )), + pbs_base_log: DecompositionBaseLog(17), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(4), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.023, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.176, algorithmic cost ~ 76, 2-norm = 2 +pub const V0_10_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(857), + glwe_dimension: GlweDimension(2), + polynomial_size: PolynomialSize(1024), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.389876747499049e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(5), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(2), + log2_p_fail: -64.176, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.074, algorithmic cost ~ 106, 2-norm = 5 +pub const V0_10_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(834), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(2048), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.5539902359442825e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(5), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(5), + log2_p_fail: -64.074, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.084, algorithmic cost ~ 362, 2-norm = 10 +pub const V0_10_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(902), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(4096), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 1.0994794733558207e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(8), + max_noise_level: MaxNoiseLevel::new(10), + log2_p_fail: -64.084, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.078, algorithmic cost ~ 833, 2-norm = 21 +pub const V0_10_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(977), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.0144389706858286e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(16), + max_noise_level: MaxNoiseLevel::new(21), + log2_p_fail: -64.078, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.058, algorithmic cost ~ 2517, 2-norm = 42 +pub const V0_10_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1052), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 8.264676629436917e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(12), + pbs_level: DecompositionLevelCount(3), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(32), + max_noise_level: MaxNoiseLevel::new(42), + log2_p_fail: -64.058, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.001, algorithmic cost ~ 7229, 2-norm = 85 +pub const V0_10_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1114), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.8356668849263424e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(9), + pbs_level: DecompositionLevelCount(4), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(11), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(64), + max_noise_level: MaxNoiseLevel::new(85), + log2_p_fail: -64.001, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.193, algorithmic cost ~ 76, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(857), + glwe_dimension: GlweDimension(2), + polynomial_size: PolynomialSize(1024), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.389876747499049e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(5), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.193, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.346, algorithmic cost ~ 106, 2-norm = 2 +pub const V0_10_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(833), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(2048), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.6158408373309336e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(5), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(2), + log2_p_fail: -64.346, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.064, algorithmic cost ~ 260, 2-norm = 4 +pub const V0_10_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(935), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(4096), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 6.221794297398788e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(22), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(4), + log2_p_fail: -64.064, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.122, algorithmic cost ~ 833, 2-norm = 9 +pub const V0_10_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(977), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.0144389706858286e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(16), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(8), + max_noise_level: MaxNoiseLevel::new(9), + log2_p_fail: -64.122, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.037, algorithmic cost ~ 1947, 2-norm = 18 +pub const V0_10_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1061), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 7.07600596055958e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(16), + max_noise_level: MaxNoiseLevel::new(18), + log2_p_fail: -64.037, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.0, algorithmic cost ~ 6009, 2-norm = 36 +pub const V0_10_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1118), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.6465671112690942e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(11), + pbs_level: DecompositionLevelCount(3), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(12), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(32), + max_noise_level: MaxNoiseLevel::new(36), + log2_p_fail: -64.0, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.454, algorithmic cost ~ 106, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(833), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(2048), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.6158408373309336e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(5), + message_modulus: MessageModulus(16), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.454, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.071, algorithmic cost ~ 250, 2-norm = 2 +pub const V0_10_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(954), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(4096), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 4.482777900525027e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(4), + ks_level: DecompositionLevelCount(4), + message_modulus: MessageModulus(16), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(2), + log2_p_fail: -64.071, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.182, algorithmic cost ~ 833, 2-norm = 4 +pub const V0_10_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(977), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.0144389706858286e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(16), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(4), + log2_p_fail: -64.182, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.099, algorithmic cost ~ 1933, 2-norm = 8 +pub const V0_10_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1053), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 8.123305578333294e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(16), + carry_modulus: CarryModulus(8), + max_noise_level: MaxNoiseLevel::new(8), + log2_p_fail: -64.099, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.033, algorithmic cost ~ 5904, 2-norm = 17 +pub const V0_10_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1112), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.935224755982453e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(11), + pbs_level: DecompositionLevelCount(3), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(11), + message_modulus: MessageModulus(16), + carry_modulus: CarryModulus(16), + max_noise_level: MaxNoiseLevel::new(17), + log2_p_fail: -64.033, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.068, algorithmic cost ~ 248, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(946), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(4096), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 5.146261171730886e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(22), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(4), + ks_level: DecompositionLevelCount(4), + message_modulus: MessageModulus(32), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.068, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.185, algorithmic cost ~ 833, 2-norm = 2 +pub const V0_10_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(977), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.0144389706858286e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(32), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(2), + log2_p_fail: -64.185, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.137, algorithmic cost ~ 1931, 2-norm = 4 +pub const V0_10_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1052), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 8.264676629436917e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(32), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(4), + log2_p_fail: -64.137, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.004, algorithmic cost ~ 5888, 2-norm = 8 +pub const V0_10_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1109), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.0911536076507566e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(11), + pbs_level: DecompositionLevelCount(3), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(11), + message_modulus: MessageModulus(32), + carry_modulus: CarryModulus(8), + max_noise_level: MaxNoiseLevel::new(8), + log2_p_fail: -64.004, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.034, algorithmic cost ~ 609, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1005), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 1.859518030726978e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(22), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(64), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.034, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.031, algorithmic cost ~ 1929, 2-norm = 2 +pub const V0_10_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1051), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 8.40850798120231e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(64), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(2), + log2_p_fail: -64.031, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.007, algorithmic cost ~ 5390, 2-norm = 4 +pub const V0_10_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1111), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.986306893048107e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(1), + ks_level: DecompositionLevelCount(22), + message_modulus: MessageModulus(64), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(4), + log2_p_fail: -64.007, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.032, algorithmic cost ~ 1929, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1051), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(16384), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 8.40850798120231e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(16), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(7), + message_modulus: MessageModulus(128), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.032, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.017, algorithmic cost ~ 4609, 2-norm = 2 +pub const V0_10_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1116), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.7394858488703536e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(11), + message_modulus: MessageModulus(128), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(2), + log2_p_fail: -64.017, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +// p-fail = 2^-64.011, algorithmic cost ~ 4584, 2-norm = 1 +pub const V0_10_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1110), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(32768), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 3.038278019865525e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(11), + message_modulus: MessageModulus(256), + carry_modulus: CarryModulus(1), + max_noise_level: MaxNoiseLevel::new(1), + log2_p_fail: -64.011, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Big, + }; +pub const WITH_CARRY_PARAMETERS_VEC: [ClassicPBSParameters; 36] = [ + V0_10_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64, +]; diff --git a/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/mod.rs b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/mod.rs new file mode 100644 index 0000000000..4e3b5c5315 --- /dev/null +++ b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/mod.rs @@ -0,0 +1,2 @@ +pub mod ks_pbs; +pub mod pbs_ks; diff --git a/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs new file mode 100644 index 0000000000..1353bf6b93 --- /dev/null +++ b/tfhe/src/shortint/parameters/v0_10/classic/gaussian/p_fail_2_minus_64/pbs_ks.rs @@ -0,0 +1,101 @@ +use crate::core_crypto::prelude::*; +use crate::shortint::ciphertext::MaxNoiseLevel; +use crate::shortint::parameters::{CarryModulus, ClassicPBSParameters, MessageModulus}; +// p-fail = 2^-64.05, algorithmic cost ~ 67, 2-norm = 3 +pub const V0_10_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(884), + glwe_dimension: GlweDimension(4), + polynomial_size: PolynomialSize(512), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 1.4999005934396873e-06, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(5), + ks_level: DecompositionLevelCount(3), + message_modulus: MessageModulus(2), + carry_modulus: CarryModulus(2), + max_noise_level: MaxNoiseLevel::new(3), + log2_p_fail: -64.05, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Small, + }; +// p-fail = 2^-64.107, algorithmic cost ~ 124, 2-norm = 5 +pub const V0_10_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(944), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(2048), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 5.326942058078918e-07, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.845267479601915e-15, + )), + pbs_base_log: DecompositionBaseLog(23), + pbs_level: DecompositionLevelCount(1), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(6), + message_modulus: MessageModulus(4), + carry_modulus: CarryModulus(4), + max_noise_level: MaxNoiseLevel::new(5), + log2_p_fail: -64.107, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Small, + }; +// p-fail = 2^-64.007, algorithmic cost ~ 1066, 2-norm = 9 +pub const V0_10_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1121), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(8192), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.5130647937194597e-08, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(15), + pbs_level: DecompositionLevelCount(2), + ks_base_log: DecompositionBaseLog(2), + ks_level: DecompositionLevelCount(12), + message_modulus: MessageModulus(8), + carry_modulus: CarryModulus(8), + max_noise_level: MaxNoiseLevel::new(9), + log2_p_fail: -64.007, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Small, + }; +// p-fail = 2^-64.507, algorithmic cost ~ 13479, 2-norm = 17 +pub const V0_10_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64: ClassicPBSParameters = + ClassicPBSParameters { + lwe_dimension: LweDimension(1254), + glwe_dimension: GlweDimension(1), + polynomial_size: PolynomialSize(65536), + lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.532938831904281e-09, + )), + glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev( + 2.168404344971009e-19, + )), + pbs_base_log: DecompositionBaseLog(11), + pbs_level: DecompositionLevelCount(3), + ks_base_log: DecompositionBaseLog(3), + ks_level: DecompositionLevelCount(8), + message_modulus: MessageModulus(16), + carry_modulus: CarryModulus(16), + max_noise_level: MaxNoiseLevel::new(17), + log2_p_fail: -64.507, + ciphertext_modulus: CiphertextModulus::new_native(), + encryption_key_choice: EncryptionKeyChoice::Small, + }; +pub const WITH_CARRY_PARAMETERS_VEC_PBS_KS: [ClassicPBSParameters; 4] = [ + V0_10_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64, + V0_10_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64, +]; diff --git a/tfhe/src/shortint/parameters/v0_10/classic/mod.rs b/tfhe/src/shortint/parameters/v0_10/classic/mod.rs index 13f21c27b9..bab9016ea5 100644 --- a/tfhe/src/shortint/parameters/v0_10/classic/mod.rs +++ b/tfhe/src/shortint/parameters/v0_10/classic/mod.rs @@ -1 +1,2 @@ pub mod compact_pk; +pub mod gaussian; diff --git a/tfhe/src/shortint/server_key/add.rs b/tfhe/src/shortint/server_key/add.rs index 5b8524e76b..36c2882ee9 100644 --- a/tfhe/src/shortint/server_key/add.rs +++ b/tfhe/src/shortint/server_key/add.rs @@ -20,7 +20,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -39,7 +39,7 @@ impl ServerKey { /// let two = cks.decrypt(&ct_res); /// assert_eq!(msg + msg, two); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -75,7 +75,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -98,7 +98,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!((msg2 + msg1) % modulus, two); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.unchecked_encrypt(msg1); @@ -144,7 +144,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -162,7 +162,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(msg1 + msg2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Same thing using the small key for encryption /// let msg1 = 1; @@ -195,7 +195,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -213,7 +213,7 @@ impl ServerKey { /// let two = cks.decrypt(&ct_left); /// assert_eq!(msg + msg, two); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct_left = cks.encrypt(msg); /// let ct_right = cks.encrypt(msg); @@ -239,7 +239,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -255,7 +255,7 @@ impl ServerKey { /// sks.is_add_possible(ct_left.noise_degree(), ct_right.noise_degree()) /// .unwrap(); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg); @@ -287,7 +287,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -305,7 +305,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, msg + msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -337,7 +337,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -355,7 +355,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_left); /// assert_eq!(clear_res, msg + msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_left = cks.encrypt(msg); @@ -386,7 +386,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -405,7 +405,7 @@ impl ServerKey { /// let two = cks.decrypt(&ct_res); /// assert_eq!(msg + msg, two); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -451,7 +451,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -474,7 +474,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!((msg2 + msg1) % modulus, two); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.unchecked_encrypt(msg1); diff --git a/tfhe/src/shortint/server_key/bitwise_op.rs b/tfhe/src/shortint/server_key/bitwise_op.rs index b361785e78..07aaa8b7c6 100644 --- a/tfhe/src/shortint/server_key/bitwise_op.rs +++ b/tfhe/src/shortint/server_key/bitwise_op.rs @@ -19,7 +19,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -38,7 +38,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(msg, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -74,7 +74,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -97,7 +97,7 @@ impl ServerKey { /// /// assert_eq!((msg2 & msg1) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct1 = cks.unchecked_encrypt(msg1); /// let ct2 = cks.encrypt(msg2); @@ -136,7 +136,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -152,7 +152,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_1 & clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let ct_1 = cks.encrypt(clear_1); /// let ct_2 = cks.encrypt(clear_2); @@ -177,7 +177,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -193,7 +193,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_left); /// assert_eq!(clear_1 & clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct_left = cks.encrypt(clear_1); /// let ct_right = cks.encrypt(clear_2); @@ -219,7 +219,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -237,7 +237,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -273,7 +273,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -291,7 +291,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_left); /// assert_eq!(clear_res, msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_left = cks.encrypt(msg); @@ -326,7 +326,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -345,7 +345,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(msg, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -374,7 +374,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -397,7 +397,7 @@ impl ServerKey { /// /// assert_eq!((msg2 & msg1) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct1 = cks.unchecked_encrypt(msg1); /// let mut ct2 = cks.encrypt(msg2); @@ -429,7 +429,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -448,7 +448,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -484,7 +484,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -507,7 +507,7 @@ impl ServerKey { /// /// assert_eq!((msg2 ^ msg1) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct1 = cks.unchecked_encrypt(msg1); /// let ct2 = cks.encrypt(msg2); @@ -546,7 +546,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -563,7 +563,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_1 ^ clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(clear_1); @@ -589,7 +589,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -606,7 +606,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_left); /// assert_eq!(clear_1 ^ clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_left = cks.encrypt(clear_1); @@ -633,7 +633,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -651,7 +651,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, 0); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -686,7 +686,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -704,7 +704,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_left); /// assert_eq!(clear_res, 0); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_left = cks.encrypt(msg); @@ -739,7 +739,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -758,7 +758,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -787,7 +787,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -810,7 +810,7 @@ impl ServerKey { /// /// assert_eq!((msg2 ^ msg1) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct1 = cks.unchecked_encrypt(msg1); /// let mut ct2 = cks.encrypt(msg2); @@ -842,7 +842,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -861,7 +861,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(msg, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -897,7 +897,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -920,7 +920,7 @@ impl ServerKey { /// /// assert_eq!((msg2 | msg1) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let mut ct1 = cks.unchecked_encrypt(msg1); /// let ct2 = cks.encrypt(msg2); @@ -959,7 +959,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -977,7 +977,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_left | clear_right, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(clear_left); @@ -1003,7 +1003,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -1021,7 +1021,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_left); /// assert_eq!(clear_left | clear_right, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_left = cks.encrypt(clear_left); @@ -1048,7 +1048,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1066,7 +1066,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -1102,7 +1102,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1120,7 +1120,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_left); /// assert_eq!(clear_res, msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_left = cks.encrypt(msg); @@ -1155,7 +1155,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1174,7 +1174,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(msg, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -1203,7 +1203,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1226,7 +1226,7 @@ impl ServerKey { /// /// assert_eq!((msg2 | msg1) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.unchecked_encrypt(msg1); diff --git a/tfhe/src/shortint/server_key/comp_op.rs b/tfhe/src/shortint/server_key/comp_op.rs index 7af12dfc9e..0218b2856e 100644 --- a/tfhe/src/shortint/server_key/comp_op.rs +++ b/tfhe/src/shortint/server_key/comp_op.rs @@ -24,7 +24,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -43,7 +43,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -84,7 +84,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -102,7 +102,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!((msg_1 > msg_2) as u64, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(msg_1); @@ -136,7 +136,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -153,7 +153,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&res); /// assert_eq!((msg_1 > msg_2) as u64, clear_res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg_1); @@ -186,7 +186,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -205,7 +205,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -237,7 +237,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -256,7 +256,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -297,7 +297,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -315,7 +315,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!((msg_1 >= msg_2) as u64, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(msg_1); @@ -352,7 +352,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -371,7 +371,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -401,7 +401,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -418,7 +418,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&res); /// assert_eq!((msg_1 >= msg_2) as u64, clear_res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg_1); @@ -457,7 +457,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -476,7 +476,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -517,7 +517,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -536,7 +536,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!((msg_1 < msg_2) as u64, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(msg_1); @@ -571,7 +571,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -588,7 +588,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&res); /// assert_eq!((msg_1 < msg_2) as u64, clear_res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg_1); @@ -621,7 +621,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -640,7 +640,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -672,7 +672,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -691,7 +691,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -732,7 +732,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -750,7 +750,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!((msg_1 <= msg_2) as u64, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(msg_1); @@ -788,7 +788,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -805,7 +805,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&res); /// assert_eq!((msg_1 <= msg_2) as u64, clear_res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg_1); @@ -838,7 +838,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -857,7 +857,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -893,7 +893,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -912,7 +912,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -953,7 +953,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -971,7 +971,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, 1); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(msg_1); @@ -1005,7 +1005,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1022,7 +1022,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&res); /// assert_eq!((msg_1 == msg_2) as u64, clear_res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg_1); @@ -1055,7 +1055,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1074,7 +1074,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -1106,7 +1106,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1125,7 +1125,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct1 = cks.encrypt(msg); @@ -1166,7 +1166,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1184,7 +1184,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, 1); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_left = cks.encrypt(msg_1); @@ -1218,7 +1218,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1235,7 +1235,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&res); /// assert_eq!((msg_1 != msg_2) as u64, clear_res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.encrypt(msg_1); @@ -1268,7 +1268,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1287,7 +1287,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(0, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct1 = cks.encrypt(msg); @@ -1315,7 +1315,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1332,7 +1332,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, (msg_1 == scalar as u64) as u64); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt our message /// let mut ct_left = cks.encrypt(msg_1); @@ -1370,7 +1370,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1387,7 +1387,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, (msg_1 != scalar as u64) as u64); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt our message /// let mut ct_left = cks.encrypt(msg_1); @@ -1426,7 +1426,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1443,7 +1443,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, (msg_1 >= scalar as u64) as u64); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt our message /// let mut ct_left = cks.encrypt(msg_1); @@ -1485,7 +1485,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1502,7 +1502,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, (msg_1 <= scalar as u64) as u64); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt our message /// let mut ct_left = cks.encrypt(msg_1); @@ -1539,7 +1539,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1556,7 +1556,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, (msg_1 > scalar as u64) as u64); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt our message /// let mut ct_left = cks.encrypt(msg_1); @@ -1592,7 +1592,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); @@ -1609,7 +1609,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(res, (msg_1 < scalar as u64) as u64); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt our message /// let mut ct_left = cks.encrypt(msg_1); diff --git a/tfhe/src/shortint/server_key/div_mod.rs b/tfhe/src/shortint/server_key/div_mod.rs index 86dbc86f65..13a8f780c5 100644 --- a/tfhe/src/shortint/server_key/div_mod.rs +++ b/tfhe/src/shortint/server_key/div_mod.rs @@ -23,7 +23,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -43,7 +43,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_1 / clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_1 = cks.encrypt(clear_1); @@ -84,7 +84,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -104,7 +104,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_1); /// assert_eq!(clear_1 / clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_1 = cks.encrypt(clear_1); @@ -148,7 +148,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -168,7 +168,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_1 / clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_1 = cks.encrypt(clear_1); @@ -201,7 +201,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -221,7 +221,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_1); /// assert_eq!(clear_1 / clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_1 = cks.encrypt(clear_1); @@ -255,7 +255,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -275,7 +275,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_1 / clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_1 = cks.encrypt(clear_1); @@ -309,7 +309,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -329,7 +329,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_1); /// assert_eq!(clear_1 / clear_2, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_1 = cks.encrypt(clear_1); diff --git a/tfhe/src/shortint/server_key/mod.rs b/tfhe/src/shortint/server_key/mod.rs index 49963536da..0fc59daeb2 100644 --- a/tfhe/src/shortint/server_key/mod.rs +++ b/tfhe/src/shortint/server_key/mod.rs @@ -690,7 +690,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// { @@ -719,7 +719,7 @@ impl ServerKey { /// } /// { /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let msg = 3; /// @@ -858,7 +858,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// { @@ -887,7 +887,7 @@ impl ServerKey { /// } /// { /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let msg = 3; /// diff --git a/tfhe/src/shortint/server_key/mul.rs b/tfhe/src/shortint/server_key/mul.rs index 580b31dc6c..606d6ebacd 100644 --- a/tfhe/src/shortint/server_key/mul.rs +++ b/tfhe/src/shortint/server_key/mul.rs @@ -17,7 +17,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -44,7 +44,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!((clear_1 * clear_2) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_1 = cks.encrypt(clear_1); @@ -82,7 +82,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -103,7 +103,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!((clear_1 * clear_2) % modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_1 = cks.encrypt(clear_1); @@ -143,7 +143,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -171,7 +171,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!((clear_1 * clear_2) / modulus, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_1 = cks.encrypt(clear_1); @@ -256,7 +256,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -272,7 +272,7 @@ impl ServerKey { /// sks.is_mul_possible(ct_1.noise_degree(), ct_2.noise_degree()) /// .unwrap(); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_1 = cks.encrypt(msg); @@ -303,7 +303,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -320,7 +320,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res % modulus, 2); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_1 = cks.encrypt(2); @@ -357,7 +357,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -374,7 +374,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res % modulus, 2); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.encrypt(2); @@ -410,7 +410,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -440,7 +440,7 @@ impl ServerKey { /// (msg_1 * msg_2) / cks.parameters.message_modulus().0 /// ); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_1 = cks.encrypt(msg_1); @@ -487,7 +487,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -507,7 +507,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!((clear_2 * clear_1), res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let ct_1 = cks.encrypt(clear_1); @@ -543,10 +543,10 @@ impl ServerKey { /// ///```rust /// use tfhe::shortint::gen_keys; - /// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64; + /// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64; /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// /// let msg = 2; /// @@ -607,7 +607,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -627,7 +627,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res % modulus, (msg_1 * msg_2) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_1 = cks.encrypt(msg_1); @@ -669,7 +669,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -701,7 +701,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, (msg1 * msg2) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.unchecked_encrypt(msg1); @@ -750,7 +750,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -782,7 +782,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, (msg1 * msg2) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_left = cks.unchecked_encrypt(msg1); @@ -831,11 +831,12 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// /// let msg1 = 5; /// let msg2 = 3; @@ -852,7 +853,7 @@ impl ServerKey { /// assert_eq!(res % modulus, (msg1 * msg2) % modulus); /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.unchecked_encrypt(msg1); @@ -908,11 +909,12 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// /// let msg1 = 5; /// let msg2 = 3; @@ -929,7 +931,7 @@ impl ServerKey { /// assert_eq!(res % modulus, (msg1 * msg2) % modulus); /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.unchecked_encrypt(msg1); @@ -966,7 +968,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -986,7 +988,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, ((msg1 * msg2) / modulus) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.unchecked_encrypt(msg1); @@ -1034,7 +1036,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1054,7 +1056,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, ((msg1 * msg2) / modulus) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let ct_1 = cks.unchecked_encrypt(msg1); @@ -1085,11 +1087,12 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64, + /// V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// /// let msg1 = 5; /// let msg2 = 3; @@ -1106,7 +1109,7 @@ impl ServerKey { /// assert_eq!(res % modulus, (msg1 * msg2) % modulus); /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.unchecked_encrypt(msg1); @@ -1155,7 +1158,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1175,7 +1178,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, ((msg1 * msg2) / modulus) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.unchecked_encrypt(msg1); @@ -1206,7 +1209,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1238,7 +1241,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, (msg1 * msg2) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_left = cks.unchecked_encrypt(msg1); @@ -1298,7 +1301,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -1318,7 +1321,7 @@ impl ServerKey { /// let modulus = sks.message_modulus.0; /// assert_eq!(res, ((msg1 * msg2) / modulus) % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages: /// let mut ct_1 = cks.unchecked_encrypt(msg1); diff --git a/tfhe/src/shortint/server_key/neg.rs b/tfhe/src/shortint/server_key/neg.rs index 9e6017445e..c2e0977fe2 100644 --- a/tfhe/src/shortint/server_key/neg.rs +++ b/tfhe/src/shortint/server_key/neg.rs @@ -24,7 +24,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -43,7 +43,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res, modulus - msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -80,7 +80,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -99,7 +99,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res, modulus - msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -132,7 +132,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -151,7 +151,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(modulus - msg, three); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -185,7 +185,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -203,7 +203,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(modulus - msg, cks.decrypt(&ct)); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -251,7 +251,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -265,7 +265,7 @@ impl ServerKey { /// // Check if we can perform a negation /// sks.is_neg_possible(ct.noise_degree()).unwrap(); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -292,7 +292,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -310,7 +310,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res, modulus - msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -341,7 +341,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -359,7 +359,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res, modulus - msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -387,7 +387,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -406,7 +406,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res, modulus - msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -439,7 +439,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -458,7 +458,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(clear_res, modulus - msg); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); diff --git a/tfhe/src/shortint/server_key/scalar_add.rs b/tfhe/src/shortint/server_key/scalar_add.rs index 2ffc569325..88b0bb3625 100644 --- a/tfhe/src/shortint/server_key/scalar_add.rs +++ b/tfhe/src/shortint/server_key/scalar_add.rs @@ -23,7 +23,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -46,7 +46,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!((msg + scalar as u64) % modulus, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -85,7 +85,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -107,7 +107,7 @@ impl ServerKey { /// clear /// ); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -139,7 +139,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -154,7 +154,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct_res); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(1); @@ -182,7 +182,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -197,7 +197,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(1); @@ -224,7 +224,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -236,7 +236,7 @@ impl ServerKey { /// // Verification if the scalar addition can be computed: /// sks.is_scalar_add_possible(ct.noise_degree(), 3).unwrap(); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(2); @@ -264,7 +264,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -279,7 +279,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, 3); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(1); @@ -312,7 +312,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -327,7 +327,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct); /// assert_eq!(clear_res, 3); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(1); @@ -360,7 +360,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -383,7 +383,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(2, clear % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -419,7 +419,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -438,7 +438,7 @@ impl ServerKey { /// let clear = cks.decrypt_message_and_carry(&ct); /// assert_eq!(6, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); diff --git a/tfhe/src/shortint/server_key/scalar_div_mod.rs b/tfhe/src/shortint/server_key/scalar_div_mod.rs index fc84d9f9b4..3f52438b86 100644 --- a/tfhe/src/shortint/server_key/scalar_div_mod.rs +++ b/tfhe/src/shortint/server_key/scalar_div_mod.rs @@ -48,7 +48,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key @@ -67,7 +67,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_res); /// assert_eq!(clear_1 / (clear_2 as u64), res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt one message /// let ct_1 = cks.encrypt(clear_1); @@ -140,7 +140,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -158,7 +158,7 @@ impl ServerKey { /// let dec = cks.decrypt(&ct_res); /// assert_eq!(1, dec); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// let ct = cks.encrypt(msg); /// diff --git a/tfhe/src/shortint/server_key/scalar_mul.rs b/tfhe/src/shortint/server_key/scalar_mul.rs index e3d47a8d82..45cb4576d9 100644 --- a/tfhe/src/shortint/server_key/scalar_mul.rs +++ b/tfhe/src/shortint/server_key/scalar_mul.rs @@ -21,7 +21,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -41,7 +41,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(msg * scalar as u64 % modulus, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -75,7 +75,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -97,7 +97,7 @@ impl ServerKey { /// clear /// ); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -130,7 +130,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -145,7 +145,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct_res); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(1); @@ -176,7 +176,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -191,7 +191,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(1); @@ -216,7 +216,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -235,7 +235,7 @@ impl ServerKey { /// let res = cks.decrypt(&ct_1); /// assert_eq!(clear_2 * clear_1, res); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt two messages /// let mut ct_1 = cks.encrypt(clear_1); @@ -267,7 +267,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -279,7 +279,7 @@ impl ServerKey { /// // Verification if the scalar multiplication can be computed: /// sks.is_scalar_mul_possible(ct.noise_degree(), 3).unwrap(); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(2); @@ -315,7 +315,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -330,7 +330,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, 3); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(1); @@ -364,7 +364,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -379,7 +379,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct); /// assert_eq!(clear_res, 3); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(1); @@ -410,7 +410,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -433,7 +433,7 @@ impl ServerKey { /// let modulus = cks.parameters.message_modulus().0; /// assert_eq!(3, clear % modulus); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -467,7 +467,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -486,7 +486,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); diff --git a/tfhe/src/shortint/server_key/scalar_sub.rs b/tfhe/src/shortint/server_key/scalar_sub.rs index 0dde5b1bce..3bab91aaf8 100644 --- a/tfhe/src/shortint/server_key/scalar_sub.rs +++ b/tfhe/src/shortint/server_key/scalar_sub.rs @@ -23,7 +23,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -46,7 +46,7 @@ impl ServerKey { /// /// assert_eq!(msg - scalar as u64, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -85,7 +85,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -104,7 +104,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct); /// assert_eq!(msg - scalar as u64, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -133,7 +133,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -149,7 +149,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct_res); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(5); @@ -178,7 +178,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -193,7 +193,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct); /// assert_eq!(3, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(5); @@ -255,7 +255,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -267,7 +267,7 @@ impl ServerKey { /// // Verification if the scalar subtraction can be computed: /// sks.is_scalar_sub_possible(ct.noise_degree(), 3).unwrap(); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(5); @@ -293,7 +293,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -308,7 +308,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct_res); /// assert_eq!(clear_res, 3); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(5); @@ -338,7 +338,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -353,7 +353,7 @@ impl ServerKey { /// let clear_res = cks.decrypt(&ct); /// assert_eq!(clear_res, 3); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(5); @@ -383,7 +383,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -406,7 +406,7 @@ impl ServerKey { /// /// assert_eq!(msg - scalar as u64, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -438,7 +438,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -457,7 +457,7 @@ impl ServerKey { /// let clear = cks.decrypt(&ct); /// assert_eq!(msg - scalar as u64, clear); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); diff --git a/tfhe/src/shortint/server_key/shift.rs b/tfhe/src/shortint/server_key/shift.rs index f6efa409f5..f8b10cc5f3 100644 --- a/tfhe/src/shortint/server_key/shift.rs +++ b/tfhe/src/shortint/server_key/shift.rs @@ -22,7 +22,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -49,7 +49,7 @@ impl ServerKey { /// let dec = cks.decrypt(&ct_res); /// assert_eq!(msg >> shift, dec); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -92,7 +92,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// @@ -117,7 +117,7 @@ impl ServerKey { /// let dec = cks.decrypt(&ct); /// assert_eq!(msg >> shift, dec); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -150,7 +150,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -177,7 +177,7 @@ impl ServerKey { /// let dec = cks.decrypt(&ct_res); /// assert_eq!(msg >> shift, dec); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -211,7 +211,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// @@ -236,7 +236,7 @@ impl ServerKey { /// let dec = cks.decrypt(&ct); /// assert_eq!(msg >> shift, dec); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -281,7 +281,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// @@ -307,7 +307,7 @@ impl ServerKey { /// /// assert_eq!((msg << shift) % modulus, msg_only); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -352,7 +352,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// @@ -378,7 +378,7 @@ impl ServerKey { /// /// assert_eq!((msg << shift) % modulus, msg_only); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -413,7 +413,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -444,7 +444,7 @@ impl ServerKey { /// assert_eq!(msg << shift, msg_and_carry); /// assert_eq!((msg << shift) % modulus, msg_only); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct = cks.encrypt(msg); @@ -481,7 +481,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// @@ -510,7 +510,7 @@ impl ServerKey { /// assert_eq!(msg << shift, msg_and_carry); /// assert_eq!((msg << shift) % modulus, msg_only); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); @@ -547,7 +547,7 @@ impl ServerKey { ///```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -564,7 +564,7 @@ impl ServerKey { /// /// assert!(res.is_err()); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct1 = cks.encrypt(msg); @@ -600,7 +600,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// /// // Generate the client key and the server key: @@ -636,7 +636,7 @@ impl ServerKey { /// assert_eq!(msg << shift, msg_and_carry); /// assert_eq!((msg << shift) % modulus, msg_only); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let ct1 = cks.encrypt(msg); @@ -696,7 +696,7 @@ impl ServerKey { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::{ - /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, + /// PARAM_MESSAGE_2_CARRY_2_KS_PBS, V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64, /// }; /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_KS_PBS); /// @@ -724,7 +724,7 @@ impl ServerKey { /// assert_eq!(msg << shift, msg_and_carry); /// assert_eq!((msg << shift) % modulus, msg_only); /// - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64); /// /// // Encrypt a message /// let mut ct = cks.encrypt(msg); diff --git a/tfhe/src/shortint/server_key/tests/parameterized_test.rs b/tfhe/src/shortint/server_key/tests/parameterized_test.rs index 094f97f146..46feed0972 100644 --- a/tfhe/src/shortint/server_key/tests/parameterized_test.rs +++ b/tfhe/src/shortint/server_key/tests/parameterized_test.rs @@ -20,34 +20,34 @@ macro_rules! create_parameterized_test{ ($name:ident)=> { create_parameterized_test!($name { - 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_1_CARRY_7_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_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_4_CARRY_2_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_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_7_CARRY_1_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_1_CARRY_7_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_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_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_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_4_CARRY_2_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_1_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_6_CARRY_1_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, 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, @@ -74,9 +74,9 @@ macro_rules! create_parameterized_test{ ($name:ident)=> { create_parameterized_test!($name { - PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64 + V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64 }); }; } @@ -143,19 +143,19 @@ create_parameterized_test!( #[cfg(not(tarpaulin))] #[test] fn test_shortint_compressed_public_key_smart_add_param_message_1_carry_1_ks_pbs() { - shortint_compressed_public_key_smart_add(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + shortint_compressed_public_key_smart_add(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); } #[cfg(not(tarpaulin))] #[test] fn test_shortint_public_key_smart_add_param_message_1_carry_1_ks_pbs() { - shortint_public_key_smart_add(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + shortint_public_key_smart_add(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); } #[cfg(not(tarpaulin))] #[test] fn test_shortint_public_key_smart_add_param_message_2_carry_2_ks_pbs() { - shortint_public_key_smart_add(PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64); + shortint_public_key_smart_add(V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64); } fn shortint_encrypt_decrypt

(param: P) diff --git a/tfhe/src/shortint/server_key/tests/parameterized_test_bivariate_pbs_compliant.rs b/tfhe/src/shortint/server_key/tests/parameterized_test_bivariate_pbs_compliant.rs index 8cb9b26f2a..b82050d00e 100644 --- a/tfhe/src/shortint/server_key/tests/parameterized_test_bivariate_pbs_compliant.rs +++ b/tfhe/src/shortint/server_key/tests/parameterized_test_bivariate_pbs_compliant.rs @@ -41,22 +41,22 @@ macro_rules! create_parameterized_test_bivariate_pbs_compliant{ ($name:ident)=> { create_parameterized_test!($name { - 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_1_CARRY_7_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64, - PARAM_MESSAGE_3_CARRY_5_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_1_CARRY_7_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_2_CARRY_4_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_3_CARRY_4_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, 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, @@ -83,7 +83,7 @@ macro_rules! create_parameterized_test_bivariate_pbs_compliant{ ($name:ident)=> { create_parameterized_test!($name { - PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, + V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, PARAM_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64 }); @@ -96,13 +96,13 @@ macro_rules! create_parameterized_test_bivariate_pbs_compliant{ #[cfg(not(tarpaulin))] #[test] fn test_shortint_compressed_public_key_smart_add_param_message_1_carry_1_ks_pbs() { - shortint_compressed_public_key_smart_add(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + shortint_compressed_public_key_smart_add(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); } #[cfg(not(tarpaulin))] #[test] fn test_shortint_public_key_smart_add_param_message_1_carry_1_ks_pbs() { - shortint_public_key_smart_add(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + shortint_public_key_smart_add(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); } #[cfg(not(tarpaulin))] diff --git a/tfhe/src/shortint/wopbs/mod.rs b/tfhe/src/shortint/wopbs/mod.rs index c218738078..7bcc55ee5f 100644 --- a/tfhe/src/shortint/wopbs/mod.rs +++ b/tfhe/src/shortint/wopbs/mod.rs @@ -257,11 +257,11 @@ mod experimental { /// ```rust /// use tfhe::shortint::gen_keys; /// use tfhe::shortint::parameters::parameters_wopbs_message_carry::WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS; - /// 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::wopbs::*; /// /// // Generate the client key and the server key: - /// let (cks, sks) = gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); + /// let (cks, sks) = gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); /// let wopbs_key = WopbsKey::new_wopbs_key(&cks, &sks, &WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS); /// ``` pub fn new_wopbs_key( diff --git a/tfhe/src/shortint/wopbs/test.rs b/tfhe/src/shortint/wopbs/test.rs index 023f0b9be0..3468f4fc57 100644 --- a/tfhe/src/shortint/wopbs/test.rs +++ b/tfhe/src/shortint/wopbs/test.rs @@ -1,9 +1,10 @@ use crate::shortint::keycache::KEY_CACHE_WOPBS; use crate::shortint::parameters::parameters_wopbs::*; use crate::shortint::parameters::{ - MessageModulus, 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, + MessageModulus, 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 crate::shortint::wopbs::WopbsKey; use crate::shortint::{gen_keys, ClassicPBSParameters}; @@ -26,10 +27,10 @@ macro_rules! create_parameterized_test{ ($name:ident)=> { create_parameterized_test!($name { - (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, LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS), - (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, LEGACY_WOPBS_PARAM_MESSAGE_4_CARRY_4_KS_PBS) + (V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS), + (V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS), + (V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_3_CARRY_3_KS_PBS), + (V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_4_CARRY_4_KS_PBS) }); }; } @@ -73,7 +74,7 @@ macro_rules! create_parameterized_test{ ($name:ident)=> { create_parameterized_test!($name { - (PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS) + (V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64, LEGACY_WOPBS_PARAM_MESSAGE_2_CARRY_2_KS_PBS) }); }; }