diff --git a/tests/backward_compatibility/high_level_api.rs b/tests/backward_compatibility/high_level_api.rs index 45c0d79ba..c8db3f49f 100644 --- a/tests/backward_compatibility/high_level_api.rs +++ b/tests/backward_compatibility/high_level_api.rs @@ -2,7 +2,7 @@ use super::shortint::load_params; use crate::{load_and_unversionize, TestedModule}; use std::path::Path; use tfhe::prelude::{CiphertextList, FheDecrypt, FheEncrypt}; -use tfhe::shortint::PBSParameters; +use tfhe::shortint::{AtomicPatternParameters, PBSParameters}; #[cfg(feature = "zk-pok")] use tfhe::zk::CompactPkeCrs; use tfhe::{ @@ -25,10 +25,10 @@ use tfhe_backward_compat_data::{ }; use tfhe_versionable::Unversionize; -fn load_hl_params(test_params: &TestParameterSet) -> PBSParameters { +fn load_hl_params(test_params: &TestParameterSet) -> AtomicPatternParameters { let pbs_params = load_params(test_params); - PBSParameters::PBS(pbs_params) + PBSParameters::PBS(pbs_params).into() } /// Test HL ciphertext: loads the ciphertext and compare the decrypted value to the one in the diff --git a/tfhe/benches/utilities.rs b/tfhe/benches/utilities.rs index c89d8a682..881a5ef3d 100644 --- a/tfhe/benches/utilities.rs +++ b/tfhe/benches/utilities.rs @@ -40,6 +40,7 @@ pub mod shortint_utils { use super::*; use itertools::iproduct; use std::vec::IntoIter; + use tfhe::shortint::atomic_pattern::AtomicPatternParameters; use tfhe::shortint::parameters::compact_public_key_only::CompactPublicKeyEncryptionParameters; #[cfg(not(feature = "gpu"))] use tfhe::shortint::parameters::current_params::V1_1_PARAM_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128; @@ -58,8 +59,10 @@ pub mod shortint_utils { /// of parameters and a num_block to achieve a certain bit_size ciphertext /// in radix decomposition pub struct ParamsAndNumBlocksIter { - params_and_bit_sizes: - itertools::Product, IntoIter>, + params_and_bit_sizes: itertools::Product< + IntoIter, + IntoIter, + >, } impl Default for ParamsAndNumBlocksIter { @@ -92,7 +95,11 @@ pub mod shortint_utils { } impl Iterator for ParamsAndNumBlocksIter { - type Item = (tfhe::shortint::PBSParameters, usize, usize); + type Item = ( + tfhe::shortint::atomic_pattern::AtomicPatternParameters, + usize, + usize, + ); fn next(&mut self) -> Option { let (param, bit_size) = self.params_and_bit_sizes.next()?; @@ -105,6 +112,12 @@ pub mod shortint_utils { impl From for CryptoParametersRecord { fn from(params: PBSParameters) -> Self { + AtomicPatternParameters::from(params).into() + } + } + + impl From for CryptoParametersRecord { + fn from(params: AtomicPatternParameters) -> Self { CryptoParametersRecord { lwe_dimension: Some(params.lwe_dimension()), glwe_dimension: Some(params.glwe_dimension()), diff --git a/tfhe/src/core_crypto/gpu/entities/lwe_bootstrap_key.rs b/tfhe/src/core_crypto/gpu/entities/lwe_bootstrap_key.rs index 48bcef76e..ad03a06d9 100644 --- a/tfhe/src/core_crypto/gpu/entities/lwe_bootstrap_key.rs +++ b/tfhe/src/core_crypto/gpu/entities/lwe_bootstrap_key.rs @@ -65,7 +65,7 @@ pub struct CudaLweBootstrapKey { impl CudaLweBootstrapKey { pub fn from_lwe_bootstrap_key( bsk: &LweBootstrapKey, - ms_noise_reduction_key: Option<&ModulusSwitchNoiseReductionKey>, + ms_noise_reduction_key: Option<&ModulusSwitchNoiseReductionKey>, streams: &CudaStreams, ) -> Self where diff --git a/tfhe/src/high_level_api/integers/unsigned/tests/gpu.rs b/tfhe/src/high_level_api/integers/unsigned/tests/gpu.rs index 9335d52ba..0fc510370 100644 --- a/tfhe/src/high_level_api/integers/unsigned/tests/gpu.rs +++ b/tfhe/src/high_level_api/integers/unsigned/tests/gpu.rs @@ -1,7 +1,8 @@ use crate::high_level_api::traits::AddAssignSizeOnGpu; use crate::prelude::{check_valid_cuda_malloc, FheTryEncrypt}; -use crate::shortint::atomic_pattern::AtomicPatternParameters; -use crate::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS; +use crate::shortint::parameters::{ + TestParameters, PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS, +}; use crate::shortint::ClassicPBSParameters; use crate::{set_server_key, ClientKey, ConfigBuilder, FheUint32, GpuIndex}; use rand::Rng; @@ -10,7 +11,7 @@ use rand::Rng; /// /// Crates a client key, with the given parameters or default params in None were given /// and sets the gpu server key for the current thread -pub(crate) fn setup_gpu(params: Option>) -> ClientKey { +pub(crate) fn setup_gpu(params: Option>) -> ClientKey { let config = params .map_or_else(ConfigBuilder::default, |p| { ConfigBuilder::with_custom_parameters(p.into()) diff --git a/tfhe/src/high_level_api/keys/client.rs b/tfhe/src/high_level_api/keys/client.rs index cf35225e4..0d0f8dd13 100644 --- a/tfhe/src/high_level_api/keys/client.rs +++ b/tfhe/src/high_level_api/keys/client.rs @@ -71,7 +71,7 @@ impl ClientKey { } } - pub fn computation_parameters(&self) -> crate::shortint::PBSParameters { + pub fn computation_parameters(&self) -> crate::shortint::AtomicPatternParameters { self.key.block_parameters() } diff --git a/tfhe/src/high_level_api/keys/inner.rs b/tfhe/src/high_level_api/keys/inner.rs index b9dde9cbf..cd968baab 100644 --- a/tfhe/src/high_level_api/keys/inner.rs +++ b/tfhe/src/high_level_api/keys/inner.rs @@ -197,7 +197,7 @@ impl IntegerClientKey { } } - pub(crate) fn block_parameters(&self) -> crate::shortint::parameters::PBSParameters { + pub(crate) fn block_parameters(&self) -> crate::shortint::parameters::AtomicPatternParameters { self.key.parameters() } } diff --git a/tfhe/src/high_level_api/tests/mod.rs b/tfhe/src/high_level_api/tests/mod.rs index c87dec2fe..1f7194a00 100644 --- a/tfhe/src/high_level_api/tests/mod.rs +++ b/tfhe/src/high_level_api/tests/mod.rs @@ -8,14 +8,14 @@ use crate::high_level_api::{ generate_keys, ClientKey, ConfigBuilder, FheBool, FheUint256, FheUint8, PublicKey, ServerKey, }; use crate::integer::U256; -use crate::shortint::atomic_pattern::AtomicPatternParameters; +use crate::shortint::parameters::TestParameters; use crate::shortint::ClassicPBSParameters; use crate::{ set_server_key, CompactPublicKey, CompressedPublicKey, CompressedServerKey, FheUint32, Tag, }; use std::fmt::Debug; -pub(crate) fn setup_cpu(params: Option>) -> ClientKey { +pub(crate) fn setup_cpu(params: Option>) -> ClientKey { let config = params .map_or_else(ConfigBuilder::default, |p| { ConfigBuilder::with_custom_parameters(p.into()) diff --git a/tfhe/src/integer/client_key/crt.rs b/tfhe/src/integer/client_key/crt.rs index 76bb5ff3e..3979e49ec 100644 --- a/tfhe/src/integer/client_key/crt.rs +++ b/tfhe/src/integer/client_key/crt.rs @@ -76,7 +76,7 @@ impl CrtClientKey { } /// Returns the parameters used by the client key. - pub fn parameters(&self) -> crate::shortint::PBSParameters { + pub fn parameters(&self) -> crate::shortint::AtomicPatternParameters { self.key.parameters() } diff --git a/tfhe/src/integer/client_key/mod.rs b/tfhe/src/integer/client_key/mod.rs index 520047089..58a97a395 100644 --- a/tfhe/src/integer/client_key/mod.rs +++ b/tfhe/src/integer/client_key/mod.rs @@ -142,8 +142,8 @@ impl ClientKey { Self { key } } - pub fn parameters(&self) -> crate::shortint::PBSParameters { - self.key.parameters.pbs_parameters().unwrap() + pub fn parameters(&self) -> crate::shortint::AtomicPatternParameters { + self.key.parameters.ap_parameters().unwrap() } #[cfg(test)] diff --git a/tfhe/src/integer/client_key/radix.rs b/tfhe/src/integer/client_key/radix.rs index 226e0d7bd..0fb449913 100644 --- a/tfhe/src/integer/client_key/radix.rs +++ b/tfhe/src/integer/client_key/radix.rs @@ -11,7 +11,9 @@ use crate::integer::compression_keys::{ CompressedCompressionKey, CompressedDecompressionKey, CompressionPrivateKeys, }; use crate::integer::BooleanBlock; -use crate::shortint::{Ciphertext as ShortintCiphertext, PBSParameters as ShortintParameters}; +use crate::shortint::{ + AtomicPatternParameters as ShortintParameters, Ciphertext as ShortintCiphertext, +}; use serde::{Deserialize, Serialize}; use tfhe_versionable::Versionize; diff --git a/tfhe/src/integer/gpu/server_key/mod.rs b/tfhe/src/integer/gpu/server_key/mod.rs index a1bf9aa43..0936cecc6 100644 --- a/tfhe/src/integer/gpu/server_key/mod.rs +++ b/tfhe/src/integer/gpu/server_key/mod.rs @@ -13,7 +13,9 @@ use crate::integer::ClientKey; use crate::shortint::ciphertext::{MaxDegree, MaxNoiseLevel}; use crate::shortint::engine::ShortintEngine; use crate::shortint::server_key::ModulusSwitchNoiseReductionKey; -use crate::shortint::{CarryModulus, CiphertextModulus, MessageModulus, PBSOrder}; +use crate::shortint::{ + AtomicPatternParameters, CarryModulus, CiphertextModulus, MessageModulus, PBSOrder, +}; mod radix; pub enum CudaBootstrappingKey { @@ -83,7 +85,10 @@ impl CudaServerKey { let mut engine = ShortintEngine::new(); // Generate a regular keyset and convert to the GPU - let pbs_params_base = &cks.parameters(); + let AtomicPatternParameters::Standard(pbs_params_base) = &cks.parameters() else { + panic!("Only the standard atomic pattern is supported on GPU") + }; + let d_bootstrapping_key = match pbs_params_base { crate::shortint::PBSParameters::PBS(pbs_params) => { let h_bootstrap_key: LweBootstrapKeyOwned = diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_erc20.rs b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_erc20.rs index c7692d23c..d6e236487 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_erc20.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_erc20.rs @@ -18,7 +18,7 @@ create_gpu_parameterized_test!(no_cmux_erc20 { fn safe_erc20

(param: P) where - P: Into, + P: Into, { let overflowing_add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_add); @@ -37,7 +37,7 @@ where fn whitepaper_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge); let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add); @@ -54,7 +54,7 @@ where fn no_cmux_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge); let mul_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::mul); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_random_op_sequence.rs b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_random_op_sequence.rs index a12869023..bebcf5b4b 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_random_op_sequence.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_random_op_sequence.rs @@ -14,7 +14,7 @@ create_gpu_parameterized_test!(random_op_sequence { }); fn random_op_sequence

(param: P) where - P: Into + Clone, + P: Into + Clone, { // Binary Ops Executors let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_erc20.rs b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_erc20.rs index d1c9678aa..9bc1e6311 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_erc20.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_erc20.rs @@ -15,7 +15,7 @@ create_gpu_parameterized_test!(signed_no_cmux_erc20 { fn signed_whitepaper_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge); let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add); @@ -32,7 +32,7 @@ where fn signed_no_cmux_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge); let mul_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::mul); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_random_op_sequence.rs b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_random_op_sequence.rs index 3b737a2a3..e66ae67ec 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_random_op_sequence.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_long_run/test_signed_random_op_sequence.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(signed_random_op_sequence { }); fn signed_random_op_sequence

(param: P) where - P: Into + Clone, + P: Into + Clone, { // Binary Ops Executors let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_abs.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_abs.rs index c23a41289..e0a114ffc 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_abs.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_abs.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_signed_abs); fn integer_signed_unchecked_abs

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_abs); signed_unchecked_absolute_value_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_signed_abs

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::abs); signed_default_absolute_value_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_add.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_add.rs index 93ef7674b..d752fd134 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_add.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_add.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_add); fn integer_unchecked_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_add); signed_unchecked_add_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::add); signed_default_add_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_signed_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_signed_overflowing_add); signed_unchecked_overflowing_add_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_signed_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_add); signed_unchecked_overflowing_add_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_bitwise_op.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_bitwise_op.rs index 096d344a0..7ef226bcb 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_bitwise_op.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_bitwise_op.rs @@ -20,7 +20,7 @@ create_gpu_parameterized_test!(integer_signed_default_bitxor); fn integer_signed_unchecked_bitand

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitand); signed_unchecked_bitand_test(param, executor); @@ -28,7 +28,7 @@ where fn integer_signed_unchecked_bitor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitor); signed_unchecked_bitor_test(param, executor); @@ -36,7 +36,7 @@ where fn integer_signed_unchecked_bitxor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitxor); signed_unchecked_bitxor_test(param, executor); @@ -44,7 +44,7 @@ where fn integer_signed_default_bitnot

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitnot); signed_default_bitnot_test(param, executor); @@ -52,7 +52,7 @@ where fn integer_signed_default_bitand

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitand); signed_default_bitand_test(param, executor); @@ -60,7 +60,7 @@ where fn integer_signed_default_bitor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitor); signed_default_bitor_test(param, executor); @@ -68,7 +68,7 @@ where fn integer_signed_default_bitxor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitxor); signed_default_bitxor_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_cmux.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_cmux.rs index 2a70b1a8c..0a3cc89bf 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_cmux.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_cmux.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_if_then_else); fn integer_unchecked_if_then_else

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_if_then_else); signed_unchecked_if_then_else_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_if_then_else

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::if_then_else); signed_default_if_then_else_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_comparison.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_comparison.rs index 90dd482c2..b9c60e47b 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_comparison.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_comparison.rs @@ -20,7 +20,7 @@ use crate::shortint::parameters::*; macro_rules! define_gpu_signed_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[]); test_signed_unchecked_function( @@ -31,7 +31,7 @@ macro_rules! define_gpu_signed_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[<$comparison_name>]); test_signed_default_function( @@ -60,7 +60,7 @@ macro_rules! define_gpu_signed_comparison_test_functions { fn integer_signed_unchecked_min_128_bits

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_min); test_signed_unchecked_minmax(params, 2, executor, std::cmp::min::) @@ -68,7 +68,7 @@ where fn integer_signed_unchecked_max_128_bits

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_max); test_signed_unchecked_minmax(params, 2, executor, std::cmp::max::) @@ -76,7 +76,7 @@ where fn integer_signed_min_128_bits

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::min); test_signed_default_minmax(params, 2, executor, std::cmp::min::); @@ -84,7 +84,7 @@ where fn integer_signed_max_128_bits

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::max); test_signed_default_minmax(params, 2, executor, std::cmp::max::); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_div_mod.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_div_mod.rs index 2fb051756..6074d1c60 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_div_mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_div_mod.rs @@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_signed_unchecked_div_rem); fn integer_signed_unchecked_div_rem

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::div_rem); signed_unchecked_div_rem_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_ilog2.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_ilog2.rs index 3ae69b3f0..93f39f828 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_ilog2.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_ilog2.rs @@ -18,7 +18,7 @@ create_gpu_parameterized_test!(integer_signed_default_checked_ilog2); fn integer_signed_default_trailing_zeros

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_zeros); default_trailing_zeros_test(param, executor); @@ -26,7 +26,7 @@ where fn integer_signed_default_trailing_ones

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_ones); default_trailing_ones_test(param, executor); @@ -34,7 +34,7 @@ where fn integer_signed_default_leading_zeros

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_zeros); default_leading_zeros_test(param, executor); @@ -42,7 +42,7 @@ where fn integer_signed_default_leading_ones

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_ones); default_leading_ones_test(param, executor); @@ -50,7 +50,7 @@ where fn integer_signed_default_ilog2

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::ilog2); default_ilog2_test(param, executor); @@ -58,7 +58,7 @@ where fn integer_signed_default_checked_ilog2

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::checked_ilog2); default_checked_ilog2_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_mul.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_mul.rs index b3534ea14..d8bba5cca 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_mul.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_mul.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_mul); fn integer_unchecked_mul

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_mul); signed_unchecked_mul_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_mul

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::mul); signed_default_mul_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_neg.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_neg.rs index 5cbf5f104..0b7ebc463 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_neg.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_neg.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_neg); fn integer_unchecked_neg

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_neg); signed_unchecked_neg_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_neg

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::neg); signed_default_neg_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_rotate.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_rotate.rs index 3fb3c25b4..7c28ae7bd 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_rotate.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_rotate.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_rotate_right); fn integer_unchecked_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_rotate_right); signed_unchecked_rotate_right_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_right); signed_default_rotate_right_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_rotate_left); signed_unchecked_rotate_left_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_left); signed_default_rotate_left_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_add.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_add.rs index c76cd093b..9bfb321a6 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_add.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_add.rs @@ -15,7 +15,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_scalar_add); fn integer_signed_unchecked_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_add); signed_unchecked_scalar_add_test(param, executor); @@ -23,7 +23,7 @@ where fn integer_signed_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_add); signed_default_scalar_add_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_signed_overflowing_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_scalar_add); signed_default_overflowing_scalar_add_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_bitwise_op.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_bitwise_op.rs index 57d2d0ed4..8e2514cc5 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_bitwise_op.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_bitwise_op.rs @@ -15,7 +15,7 @@ create_gpu_parameterized_test!(integer_signed_default_scalar_bitxor); fn integer_signed_default_scalar_bitand

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitand); signed_default_scalar_bitand_test(param, executor); @@ -23,7 +23,7 @@ where fn integer_signed_default_scalar_bitor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitor); signed_default_scalar_bitor_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_signed_default_scalar_bitxor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitxor); signed_default_scalar_bitxor_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_comparison.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_comparison.rs index 2ef6aca1e..04f358a37 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_comparison.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_comparison.rs @@ -20,7 +20,7 @@ use crate::shortint::parameters::*; macro_rules! define_gpu_signed_scalar_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[]); test_signed_unchecked_scalar_function( @@ -31,7 +31,7 @@ macro_rules! define_gpu_signed_scalar_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 10; let executor = GpuFunctionExecutor::new(&CudaServerKey::[]); test_signed_default_scalar_function( @@ -58,7 +58,7 @@ macro_rules! define_gpu_signed_scalar_comparison_test_functions { fn integer_signed_unchecked_scalar_min_i128

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_min); test_signed_unchecked_scalar_minmax(params, 2, executor, std::cmp::min::); @@ -66,7 +66,7 @@ where fn integer_signed_unchecked_scalar_max_i128

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_max); test_signed_unchecked_scalar_minmax(params, 2, executor, std::cmp::max::); @@ -74,7 +74,7 @@ where fn integer_signed_scalar_min_i128

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_min); test_signed_default_scalar_minmax(params, 2, executor, std::cmp::min::); @@ -82,7 +82,7 @@ where fn integer_signed_scalar_max_i128

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_max); test_signed_default_scalar_minmax(params, 2, executor, std::cmp::max::); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_div_mod.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_div_mod.rs index 175a7fe0a..b7ef0bd1c 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_div_mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_div_mod.rs @@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_signed_unchecked_scalar_div_rem); fn integer_signed_unchecked_scalar_div_rem

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_scalar_div_rem); signed_unchecked_scalar_div_rem_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_mul.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_mul.rs index 18e491ff4..ef502eefd 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_mul.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_mul.rs @@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_signed_unchecked_scalar_mul); fn integer_signed_unchecked_scalar_mul

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_mul); signed_unchecked_scalar_mul_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_rotate.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_rotate.rs index ab4889a9a..e2e0f0190 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_rotate.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_rotate.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_scalar_rotate_right); fn integer_signed_unchecked_scalar_rotate_left

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_rotate_left); signed_unchecked_scalar_rotate_left_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_signed_scalar_rotate_left

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_rotate_left); signed_default_scalar_rotate_left_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_signed_unchecked_scalar_rotate_right

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_rotate_right); signed_unchecked_scalar_rotate_right_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_signed_scalar_rotate_right

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_rotate_right); signed_default_scalar_rotate_right_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_shift.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_shift.rs index e18cada3c..355f835f7 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_shift.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_shift.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_scalar_right_shift); fn integer_signed_unchecked_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_left_shift); signed_unchecked_scalar_left_shift_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_signed_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_left_shift); signed_default_scalar_left_shift_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_signed_unchecked_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_right_shift); signed_unchecked_scalar_right_shift_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_signed_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_right_shift); signed_default_scalar_right_shift_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_sub.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_sub.rs index ebdf3e501..add6ad1f3 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_sub.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_scalar_sub.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_scalar_sub); fn integer_signed_unchecked_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_sub); signed_unchecked_scalar_sub_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_signed_overflowing_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_scalar_sub); signed_default_overflowing_scalar_sub_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_shift.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_shift.rs index 9c7b2fc24..5c3fe63c6 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_shift.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_shift.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_right_shift); fn integer_signed_unchecked_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_right_shift); signed_unchecked_right_shift_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_signed_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::right_shift); signed_default_right_shift_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_signed_unchecked_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_left_shift); signed_unchecked_left_shift_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_signed_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::left_shift); signed_default_left_shift_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_sub.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_sub.rs index cbeca45f3..4126eac9f 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_sub.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_sub.rs @@ -17,7 +17,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_sub); fn integer_unchecked_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_sub); signed_unchecked_sub_test(param, executor); @@ -25,7 +25,7 @@ where fn integer_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::sub); signed_default_sub_test(param, executor); @@ -33,7 +33,7 @@ where fn integer_unchecked_signed_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_signed_overflowing_sub); signed_unchecked_overflowing_sub_test(param, executor); @@ -41,7 +41,7 @@ where fn integer_signed_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_sub); signed_default_overflowing_sub_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_vector_comparisons.rs b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_vector_comparisons.rs index 129b33d8d..74e1f7a6a 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_vector_comparisons.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_signed/test_vector_comparisons.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_signed_default_all_eq_slices_test_case); fn integer_signed_unchecked_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_all_eq_slices); unchecked_all_eq_slices_test_case(param, executor); @@ -21,7 +21,7 @@ where fn integer_signed_default_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::all_eq_slices); default_all_eq_slices_test_case(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_add.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_add.rs index d8effdcd1..9096e7f2c 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_add.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_add.rs @@ -23,7 +23,7 @@ create_gpu_parameterized_test!(multi_device_integer_default_overflowing_add); fn integer_unchecked_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_add); unchecked_add_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_unchecked_add_assign

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_add_assign); unchecked_add_assign_test(param, executor); @@ -39,7 +39,7 @@ where fn integer_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::add); default_add_test(param, executor); @@ -47,7 +47,7 @@ where fn multi_device_integer_add

(param: P) where - P: Into, + P: Into, { let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add); let num_gpus = get_number_of_gpus(); @@ -58,7 +58,7 @@ where fn integer_sum_ciphertexts_vec

(param: P) where - P: Into, + P: Into, { // Without this the compiler seems lost, and outputs errors about // 'one type is more general than the other' probably because the @@ -75,7 +75,7 @@ where fn integer_default_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_add); default_overflowing_add_test(param, executor); @@ -83,7 +83,7 @@ where fn multi_device_integer_default_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_add); let num_gpus = get_number_of_gpus(); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_bitwise_op.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_bitwise_op.rs index e7fb8a0db..3638735c4 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_bitwise_op.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_bitwise_op.rs @@ -20,7 +20,7 @@ create_gpu_parameterized_test!(integer_bitxor); fn integer_unchecked_bitnot

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitnot); unchecked_bitnot_test(param, executor); @@ -28,7 +28,7 @@ where fn integer_unchecked_bitand

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitand); unchecked_bitand_test(param, executor); @@ -36,7 +36,7 @@ where fn integer_unchecked_bitor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitor); unchecked_bitor_test(param, executor); @@ -44,7 +44,7 @@ where fn integer_unchecked_bitxor

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitxor); unchecked_bitxor_test(param, executor); @@ -52,7 +52,7 @@ where fn integer_bitnot

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitnot); default_bitnot_test(param, executor); @@ -60,7 +60,7 @@ where fn integer_bitand

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitand); default_bitand_test(param, executor); @@ -68,7 +68,7 @@ where fn integer_bitor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitor); default_bitor_test(param, executor); @@ -76,7 +76,7 @@ where fn integer_bitxor

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::bitxor); default_bitxor_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_cmux.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_cmux.rs index 94928cc6a..324ed627c 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_cmux.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_cmux.rs @@ -13,14 +13,14 @@ create_gpu_parameterized_test!(multi_device_integer_if_then_else); fn integer_if_then_else

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::if_then_else); default_if_then_else_test(param, executor); } fn multi_device_integer_if_then_else

(param: P) where - P: Into, + P: Into, { let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::if_then_else); let num_gpus = get_number_of_gpus(); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_comparison.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_comparison.rs index 52cab3d78..f5335bb3f 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_comparison.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_comparison.rs @@ -21,7 +21,7 @@ use crate::shortint::parameters::*; macro_rules! define_gpu_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[]); test_unchecked_function( @@ -32,7 +32,7 @@ macro_rules! define_gpu_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[<$comparison_name>]); test_default_function( @@ -43,7 +43,7 @@ macro_rules! define_gpu_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::[<$comparison_name>]); let num_gpus = get_number_of_gpus(); @@ -78,7 +78,7 @@ macro_rules! define_gpu_comparison_test_functions { fn integer_unchecked_min_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_min); test_unchecked_minmax(params, 2, executor, std::cmp::min::); @@ -86,7 +86,7 @@ where fn integer_unchecked_max_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_max); test_unchecked_minmax(params, 2, executor, std::cmp::max::); @@ -94,7 +94,7 @@ where fn integer_min_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::min); test_default_minmax(params, 2, executor, std::cmp::min::); @@ -102,7 +102,7 @@ where fn integer_max_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::max); test_default_minmax(params, 2, executor, std::cmp::max::); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_div_mod.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_div_mod.rs index 1a3d884d4..91371466a 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_div_mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_div_mod.rs @@ -14,7 +14,7 @@ create_gpu_parameterized_test!(integer_rem); fn integer_div

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::div); default_div_test(param, executor); @@ -22,7 +22,7 @@ where fn integer_div_rem

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::div_rem); default_div_rem_test(param, executor); @@ -30,7 +30,7 @@ where fn integer_rem

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::rem); default_rem_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_ilog2.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_ilog2.rs index 66b59ad46..c7f443ff7 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_ilog2.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_ilog2.rs @@ -18,7 +18,7 @@ create_gpu_parameterized_test!(integer_default_checked_ilog2); fn integer_default_trailing_zeros

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_zeros); default_trailing_zeros_test(param, executor); @@ -26,7 +26,7 @@ where fn integer_default_trailing_ones

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_ones); default_trailing_ones_test(param, executor); @@ -34,7 +34,7 @@ where fn integer_default_leading_zeros

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_zeros); default_leading_zeros_test(param, executor); @@ -42,7 +42,7 @@ where fn integer_default_leading_ones

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_ones); default_leading_ones_test(param, executor); @@ -50,7 +50,7 @@ where fn integer_default_ilog2

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::ilog2); default_ilog2_test(param, executor); @@ -58,7 +58,7 @@ where fn integer_default_checked_ilog2

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::checked_ilog2); default_checked_ilog2_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_mul.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_mul.rs index 8440ffe60..4e93ff8c6 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_mul.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_mul.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_mul); fn integer_unchecked_mul

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_mul); unchecked_mul_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_mul

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::mul); default_mul_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_neg.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_neg.rs index c31f5c795..7cff963f1 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_neg.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_neg.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_neg); fn integer_unchecked_neg

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_neg); unchecked_neg_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_neg

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::neg); default_neg_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_rotate.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_rotate.rs index 4f8af9957..1d7166752 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_rotate.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_rotate.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_rotate_right); fn integer_unchecked_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_rotate_right); unchecked_rotate_right_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_right); default_rotate_right_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_rotate_left); unchecked_rotate_left_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_left); default_rotate_left_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_add.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_add.rs index db5d38ec5..7afa6e71a 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_add.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_add.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_scalar_add); create_gpu_parameterized_test!(integer_default_overflowing_scalar_add); fn integer_unchecked_scalar_add

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_add); unchecked_scalar_add_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_scalar_add

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_add); default_scalar_add_test(param, executor); @@ -29,7 +29,7 @@ where fn integer_default_overflowing_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_scalar_add); default_overflowing_scalar_add_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_bitwise_op.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_bitwise_op.rs index cbf69a045..5fa0bc356 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_bitwise_op.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_bitwise_op.rs @@ -14,7 +14,7 @@ create_gpu_parameterized_test!(integer_scalar_bitxor); fn integer_scalar_bitand

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitand); default_scalar_bitand_test(param, executor); @@ -22,7 +22,7 @@ where fn integer_scalar_bitor

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitor); default_scalar_bitor_test(param, executor); @@ -30,7 +30,7 @@ where fn integer_scalar_bitxor

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitxor); default_scalar_bitxor_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_comparison.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_comparison.rs index 87a7f5ed5..f00cf9fec 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_comparison.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_comparison.rs @@ -23,7 +23,7 @@ use rand::Rng; macro_rules! define_gpu_scalar_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[]); test_unchecked_scalar_function( @@ -34,7 +34,7 @@ macro_rules! define_gpu_scalar_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = GpuFunctionExecutor::new(&CudaServerKey::[]); test_default_scalar_function( @@ -61,7 +61,7 @@ macro_rules! define_gpu_scalar_comparison_test_functions { fn integer_unchecked_scalar_min_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_scalar_min); test_unchecked_scalar_minmax(params, 2, executor, std::cmp::min::); @@ -69,7 +69,7 @@ where fn integer_unchecked_scalar_max_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_scalar_max); test_unchecked_scalar_minmax(params, 2, executor, std::cmp::max::); @@ -77,7 +77,7 @@ where fn integer_scalar_min_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::scalar_min); test_default_scalar_minmax(params, 2, executor, std::cmp::min::); @@ -85,7 +85,7 @@ where fn integer_scalar_max_u256

(params: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(CudaServerKey::scalar_max); test_default_scalar_minmax(params, 2, executor, std::cmp::max::); @@ -96,7 +96,7 @@ where // compared to the ciphertext fn integer_unchecked_scalar_comparisons_edge

(param: P) where - P: Into, + P: Into, { let p = param.into(); let num_block = (128f64 / (p.message_modulus().0 as f64).log(2.0)).ceil() as usize; @@ -226,7 +226,7 @@ where fn integer_unchecked_scalar_comparisons_edge_one_block

(param: P) where - P: Into, + P: Into, { let p = param.into(); let num_block = 1; diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_div_mod.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_div_mod.rs index c6d19cba6..7235a7b14 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_div_mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_div_mod.rs @@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_scalar_div_rem); fn integer_scalar_div_rem

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_div_rem); default_scalar_div_rem_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_mul.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_mul.rs index 7c312ad08..72b6d2e9c 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_mul.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_mul.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_scalar_mul); fn integer_unchecked_scalar_mul

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_mul); unchecked_scalar_mul_corner_cases_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_scalar_mul

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_mul); default_scalar_mul_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_rotate.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_rotate.rs index 4ef869540..27ed85a90 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_rotate.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_rotate.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_scalar_rotate_right); fn integer_unchecked_scalar_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_rotate_right); unchecked_scalar_rotate_right_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_scalar_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_rotate_right); default_scalar_rotate_right_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_scalar_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_rotate_left); unchecked_scalar_rotate_left_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_scalar_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_rotate_left); default_scalar_rotate_left_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_shift.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_shift.rs index ef44a2cd0..359b6a26f 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_shift.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_shift.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_scalar_right_shift); fn integer_unchecked_scalar_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_right_shift); unchecked_scalar_right_shift_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_scalar_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_right_shift); default_scalar_right_shift_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_scalar_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_left_shift); unchecked_scalar_left_shift_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_scalar_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_left_shift); default_scalar_left_shift_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_sub.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_sub.rs index fa98f236a..21bc0bbbe 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_sub.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_scalar_sub.rs @@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_scalar_sub); fn integer_unchecked_scalar_sub

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_sub); unchecked_scalar_sub_test(param, executor); @@ -21,7 +21,7 @@ where fn integer_scalar_sub

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_sub); default_scalar_sub_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_shift.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_shift.rs index ab3f8650d..844cf0779 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_shift.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_shift.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_right_shift); fn integer_unchecked_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_right_shift); unchecked_right_shift_test(param, executor); @@ -24,7 +24,7 @@ where fn integer_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::right_shift); default_right_shift_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_left_shift); unchecked_left_shift_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = GpuFunctionExecutor::new(&CudaServerKey::left_shift); default_left_shift_test(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_sub.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_sub.rs index c7f6dc8fd..5a885bb9a 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_sub.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_sub.rs @@ -19,7 +19,7 @@ create_gpu_parameterized_test!(multi_device_integer_default_overflowing_sub); fn integer_unchecked_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_sub); unchecked_sub_test(param, executor); @@ -27,7 +27,7 @@ where fn integer_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::sub); default_sub_test(param, executor); @@ -35,7 +35,7 @@ where fn multi_device_integer_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::sub); let num_gpus = get_number_of_gpus(); @@ -46,7 +46,7 @@ where fn integer_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_sub); default_overflowing_sub_test(param, executor); @@ -54,7 +54,7 @@ where fn multi_device_integer_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_sub); let num_gpus = get_number_of_gpus(); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_comparisons.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_comparisons.rs index 1d6961f1f..fad89bb4c 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_comparisons.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_comparisons.rs @@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_unchecked_contains_slice_test_case); fn integer_unchecked_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_all_eq_slices); unchecked_all_eq_slices_test_case(param, executor); @@ -24,7 +24,7 @@ where fn integer_default_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::all_eq_slices); default_all_eq_slices_test_case(param, executor); @@ -32,7 +32,7 @@ where fn integer_unchecked_contains_slice_test_case

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_contains_sub_slice); unchecked_slice_contains_test_case(param, executor); diff --git a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_find.rs b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_find.rs index bc82394dd..6d5bdb05e 100644 --- a/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_find.rs +++ b/tfhe/src/integer/gpu/server_key/radix/tests_unsigned/test_vector_find.rs @@ -45,7 +45,7 @@ create_gpu_parameterized_test!(integer_default_first_index_of_clear); fn integer_unchecked_match_value

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_match_value); unchecked_match_value_test_case(param, executor); @@ -53,7 +53,7 @@ where fn integer_unchecked_match_value_or

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_match_value_or); unchecked_match_value_or_test_case(param, executor); @@ -61,7 +61,7 @@ where fn integer_unchecked_contains

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_contains); unchecked_contains_test_case(param, executor); @@ -69,7 +69,7 @@ where fn integer_unchecked_contains_clear

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_contains_clear); unchecked_contains_clear_test_case(param, executor); @@ -77,7 +77,7 @@ where fn integer_unchecked_is_in_clears

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_is_in_clears); unchecked_is_in_clears_test_case(param, executor); @@ -85,7 +85,7 @@ where fn integer_unchecked_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_index_in_clears); unchecked_index_in_clears_test_case(param, executor); @@ -93,14 +93,14 @@ where fn integer_unchecked_first_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_first_index_in_clears); unchecked_first_index_in_clears_test_case(param, executor); } fn integer_unchecked_index_of

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_index_of); unchecked_index_of_test_case(param, executor); @@ -108,7 +108,7 @@ where fn integer_unchecked_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_index_of_clear); unchecked_index_of_clear_test_case(param, executor); @@ -116,7 +116,7 @@ where fn integer_unchecked_first_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_first_index_of_clear); unchecked_first_index_of_clear_test_case(param, executor); @@ -124,7 +124,7 @@ where fn integer_unchecked_first_index_of

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_first_index_of); unchecked_first_index_of_test_case(param, executor); @@ -134,7 +134,7 @@ where fn integer_default_match_value

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::match_value); default_match_value_test_case(param, executor); @@ -142,7 +142,7 @@ where fn integer_default_match_value_or

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::match_value_or); default_match_value_or_test_case(param, executor); @@ -150,7 +150,7 @@ where fn integer_default_contains

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::contains); default_contains_test_case(param, executor); @@ -158,7 +158,7 @@ where fn integer_default_contains_clear

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::contains_clear); default_contains_clear_test_case(param, executor); @@ -166,7 +166,7 @@ where fn integer_default_is_in_clears

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::is_in_clears); default_is_in_clears_test_case(param, executor); @@ -174,7 +174,7 @@ where fn integer_default_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::index_in_clears); default_index_in_clears_test_case(param, executor); @@ -182,7 +182,7 @@ where fn integer_default_first_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::first_index_in_clears); default_first_index_in_clears_test_case(param, executor); @@ -190,7 +190,7 @@ where fn integer_default_index_of

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::index_of); default_index_of_test_case(param, executor); @@ -198,7 +198,7 @@ where fn integer_default_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::index_of_clear); default_index_of_clear_test_case(param, executor); @@ -206,7 +206,7 @@ where fn integer_default_first_index_of

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::first_index_of); default_first_index_of_test_case(param, executor); @@ -214,7 +214,7 @@ where fn integer_default_first_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = GpuFunctionExecutor::new(&CudaServerKey::first_index_of_clear); default_first_index_of_clear_test_case(param, executor); diff --git a/tfhe/src/integer/keycache.rs b/tfhe/src/integer/keycache.rs index 622d429cd..f29d7fdf6 100644 --- a/tfhe/src/integer/keycache.rs +++ b/tfhe/src/integer/keycache.rs @@ -1,9 +1,9 @@ #[cfg(feature = "experimental")] use crate::integer::wopbs::WopbsKey; use crate::integer::{ClientKey, IntegerKeyKind, ServerKey}; -use crate::shortint::PBSParameters; +use crate::shortint::atomic_pattern::AtomicPatternParameters; #[cfg(feature = "experimental")] -use crate::shortint::WopbsParameters; +use crate::shortint::{PBSParameters, WopbsParameters}; #[derive(Default)] pub struct IntegerKeyCache; @@ -11,7 +11,7 @@ pub struct IntegerKeyCache; impl IntegerKeyCache { pub fn get_from_params

(&self, params: P, key_kind: IntegerKeyKind) -> (ClientKey, ServerKey) where - P: Into, + P: Into, { let cache = &crate::shortint::keycache::KEY_CACHE; diff --git a/tfhe/src/integer/server_key/radix/bitwise_op.rs b/tfhe/src/integer/server_key/radix/bitwise_op.rs index 422efeb8b..e9ecd4acf 100644 --- a/tfhe/src/integer/server_key/radix/bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix/bitwise_op.rs @@ -762,7 +762,7 @@ mod tests { const INPUT_BOOLEANS: [(bool, bool); 4] = [(false, false), (false, true), (true, false), (true, true)]; - fn boolean_bitxor(params: impl Into) { + fn boolean_bitxor(params: impl Into) { let (cks, sks) = KEY_CACHE.get_from_params(params.into(), IntegerKeyKind::Radix); for (clear_0, clear_1) in INPUT_BOOLEANS { @@ -785,7 +785,7 @@ mod tests { } } - fn boolean_bitor(params: impl Into) { + fn boolean_bitor(params: impl Into) { let (cks, sks) = KEY_CACHE.get_from_params(params.into(), IntegerKeyKind::Radix); for (clear_0, clear_1) in INPUT_BOOLEANS { @@ -808,7 +808,7 @@ mod tests { } } - fn boolean_bitand(params: impl Into) { + fn boolean_bitand(params: impl Into) { let (cks, sks) = KEY_CACHE.get_from_params(params.into(), IntegerKeyKind::Radix); for (clear_0, clear_1) in INPUT_BOOLEANS { diff --git a/tfhe/src/integer/server_key/radix/tests.rs b/tfhe/src/integer/server_key/radix/tests.rs index 9b9d4ff27..700e874e6 100644 --- a/tfhe/src/integer/server_key/radix/tests.rs +++ b/tfhe/src/integer/server_key/radix/tests.rs @@ -358,7 +358,7 @@ fn integer_smart_add(param: ClassicPBSParameters) { fn integer_unchecked_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitand); unchecked_bitand_test(param, executor); @@ -366,7 +366,7 @@ where fn integer_unchecked_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitor); unchecked_bitor_test(param, executor); @@ -374,7 +374,7 @@ where fn integer_unchecked_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitxor); unchecked_bitxor_test(param, executor); @@ -382,7 +382,7 @@ where fn integer_smart_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitand); smart_bitand_test(param, executor); @@ -390,7 +390,7 @@ where fn integer_smart_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitor); smart_bitor_test(param, executor); @@ -398,7 +398,7 @@ where fn integer_smart_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitxor); smart_bitxor_test(param, executor); @@ -543,7 +543,7 @@ fn integer_smart_scalar_mul(param: ClassicPBSParameters) { fn integer_unchecked_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_left_shift); unchecked_scalar_left_shift_test(param, executor); @@ -551,7 +551,7 @@ where fn integer_unchecked_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_right_shift); unchecked_scalar_right_shift_test(param, executor); @@ -559,7 +559,7 @@ where fn integer_unchecked_neg

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_neg); unchecked_neg_test(param, executor); @@ -572,7 +572,7 @@ fn integer_smart_neg(param: ClassicPBSParameters) { fn integer_unchecked_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_sub); unchecked_sub_test(param, executor); @@ -585,7 +585,7 @@ fn integer_smart_sub(param: ClassicPBSParameters) { fn integer_unchecked_block_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_block_mul); unchecked_block_mul_test(param, executor); @@ -629,7 +629,7 @@ fn integer_smart_block_mul(param: ClassicPBSParameters) { fn integer_unchecked_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_mul); unchecked_mul_test(param, executor); @@ -637,7 +637,7 @@ where fn integer_smart_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_mul); smart_mul_test(param, executor); @@ -645,7 +645,7 @@ where fn integer_unchecked_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_add); unchecked_scalar_add_test(param, executor); @@ -653,7 +653,7 @@ where fn integer_smart_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_add); smart_scalar_add_test(param, executor); @@ -661,7 +661,7 @@ where fn integer_unchecked_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_sub); unchecked_scalar_sub_test(param, executor); @@ -669,7 +669,7 @@ where fn integer_smart_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_sub); smart_scalar_sub_test(param, executor); @@ -738,7 +738,7 @@ fn integer_smart_scalar_mul_decomposition_overflow() { fn integer_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_sub); default_overflowing_sub_test(param, executor); @@ -746,13 +746,13 @@ where fn integer_full_propagate

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::full_propagate); full_propagate_test(param, executor); } -fn integer_create_trivial_min_max(param: impl Into) { +fn integer_create_trivial_min_max(param: impl Into) { let (_, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); let num_bits_in_one_block = sks.message_modulus().0.ilog2(); @@ -809,7 +809,7 @@ fn integer_create_trivial_min_max(param: impl Into) { } } -fn integer_signed_decryption_correctly_sign_extend(param: impl Into) { +fn integer_signed_decryption_correctly_sign_extend(param: impl Into) { // Test that when decrypting a negative SignedRadixCiphertext of N bits to a // clear type of M bits where M > N, the sign extension is correctly done // 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 1fbea41b4..20f23fd89 100644 --- a/tfhe/src/integer/server_key/radix_parallel/reverse_bits.rs +++ b/tfhe/src/integer/server_key/radix_parallel/reverse_bits.rs @@ -76,7 +76,7 @@ mod tests { pub(crate) fn reverse_bits_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -116,7 +116,7 @@ mod tests { fn integer_reverse_bits

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::reverse_bits_parallelized); reverse_bits_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_cases_unsigned.rs b/tfhe/src/integer/server_key/radix_parallel/tests_cases_unsigned.rs index 2928f6c9f..9a06e1311 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_cases_unsigned.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_cases_unsigned.rs @@ -72,7 +72,7 @@ use crate::shortint::server_key::CiphertextNoiseDegree; pub(crate) fn unchecked_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -105,7 +105,7 @@ where pub(crate) fn unchecked_block_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a crate::shortint::Ciphertext, usize), RadixCiphertext, @@ -147,7 +147,7 @@ where pub(crate) fn unchecked_mul_corner_cases_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -191,7 +191,7 @@ where pub(crate) fn unchecked_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -227,7 +227,7 @@ where pub(crate) fn unchecked_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -262,7 +262,7 @@ where } pub(crate) fn unchecked_scalar_mul_corner_cases_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -317,7 +317,7 @@ where pub(crate) fn unchecked_scalar_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -385,7 +385,7 @@ where pub(crate) fn unchecked_scalar_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -460,7 +460,7 @@ where pub(crate) fn smart_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -505,7 +505,7 @@ where pub(crate) fn smart_block_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< ( &'a mut RadixCiphertext, @@ -560,7 +560,7 @@ where pub(crate) fn smart_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -608,7 +608,7 @@ where pub(crate) fn smart_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -657,7 +657,7 @@ where pub(crate) fn smart_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -710,7 +710,7 @@ where pub(crate) fn smart_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -751,7 +751,7 @@ where pub(crate) fn smart_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -793,7 +793,7 @@ where pub(crate) fn smart_scalar_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -824,7 +824,7 @@ where pub(crate) fn smart_scalar_mul_u128_fix_non_reg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, u64), RadixCiphertext>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -854,7 +854,7 @@ where pub(crate) fn default_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -921,7 +921,7 @@ where pub(crate) fn default_overflowing_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -1051,7 +1051,7 @@ where pub(crate) fn unchecked_bitnot_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -1083,7 +1083,7 @@ where pub(crate) fn unchecked_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -1127,7 +1127,7 @@ where pub(crate) fn unchecked_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -1170,7 +1170,7 @@ where pub(crate) fn unchecked_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -1213,7 +1213,7 @@ where pub(crate) fn default_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -1264,7 +1264,7 @@ where pub(crate) fn default_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -1315,7 +1315,7 @@ where pub(crate) fn default_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -1366,7 +1366,7 @@ where pub(crate) fn default_bitnot_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -1407,7 +1407,7 @@ where pub(crate) fn default_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -1464,7 +1464,7 @@ where pub(crate) fn default_overflowing_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1613,7 +1613,7 @@ where pub(crate) fn default_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -1664,7 +1664,7 @@ where pub(crate) fn default_overflowing_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1812,7 +1812,7 @@ where pub(crate) fn default_scalar_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -1848,7 +1848,7 @@ where pub(crate) fn default_default_block_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a crate::shortint::Ciphertext, usize), RadixCiphertext, @@ -1906,7 +1906,7 @@ where pub(crate) fn default_scalar_mul_u128_fix_non_reg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -1938,7 +1938,7 @@ where pub(crate) fn default_scalar_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -1992,7 +1992,7 @@ where pub(crate) fn default_scalar_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -2045,7 +2045,7 @@ where pub(crate) fn default_scalar_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -2098,7 +2098,7 @@ where pub(crate) fn default_scalar_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -2158,7 +2158,7 @@ where pub(crate) fn default_scalar_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -2222,7 +2222,7 @@ where pub(crate) fn full_propagate_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a mut RadixCiphertext, ()>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_erc20.rs b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_erc20.rs index 1b3e6e409..8e6913949 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_erc20.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_erc20.rs @@ -27,7 +27,7 @@ create_parameterized_test!(overflow_erc20 { fn safe_erc20

(param: P) where - P: Into, + P: Into, { let overflowing_add_executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_add_parallelized); @@ -46,7 +46,7 @@ where fn whitepaper_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = CpuFunctionExecutor::new(&ServerKey::ge_parallelized); let add_executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); @@ -63,7 +63,7 @@ where fn no_cmux_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = CpuFunctionExecutor::new(&ServerKey::ge_parallelized); let mul_executor = CpuFunctionExecutor::new(&ServerKey::mul_parallelized); @@ -74,7 +74,7 @@ where fn overflow_erc20

(param: P) where - P: Into, + P: Into, { let overflowing_sub_executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_sub_parallelized); @@ -99,7 +99,7 @@ pub(crate) fn safe_erc20_test( mut if_then_else_executor: T3, mut bitor_executor: T4, ) where - P: Into, + P: Into, T1: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -242,7 +242,7 @@ pub(crate) fn whitepaper_erc20_test( mut if_then_else_executor: T3, mut sub_executor: T4, ) where - P: Into, + P: Into, T1: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), BooleanBlock>, T2: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, T3: for<'a> FunctionExecutor< @@ -336,7 +336,7 @@ pub(crate) fn no_cmux_erc20_test( mut add_executor: T3, mut sub_executor: T4, ) where - P: Into, + P: Into, T1: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), BooleanBlock>, T2: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, T3: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, @@ -420,7 +420,7 @@ pub(crate) fn overflow_erc20_test( mut mul_executor: T4, mut add_executor: T5, ) where - P: Into, + P: Into, T1: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_random_op_sequence.rs b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_random_op_sequence.rs index d8e9c41c4..91e7604a8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_random_op_sequence.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_random_op_sequence.rs @@ -53,7 +53,7 @@ pub(crate) type Log2OpExecutor = Box FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>>; fn random_op_sequence

(param: P) where - P: Into + Clone, + P: Into + Clone, { // Binary Ops Executors let add_executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); @@ -464,7 +464,7 @@ pub(crate) fn random_op_sequence_test

( )], log2_ops: &mut [(Log2OpExecutor, impl Fn(u64) -> u64, String)], ) where - P: Into, + P: Into, { let param = param.into(); let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_erc20.rs b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_erc20.rs index 098fca0c1..a7e909e22 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_erc20.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_erc20.rs @@ -22,7 +22,7 @@ create_parameterized_test!(no_cmux_erc20 { fn whitepaper_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = CpuFunctionExecutor::new(&ServerKey::ge_parallelized); let add_executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); @@ -39,7 +39,7 @@ where fn no_cmux_erc20

(param: P) where - P: Into, + P: Into, { let ge_executor = CpuFunctionExecutor::new(&ServerKey::ge_parallelized); let mul_executor = CpuFunctionExecutor::new(&ServerKey::mul_parallelized); @@ -55,7 +55,7 @@ pub(crate) fn signed_whitepaper_erc20_test( mut if_then_else_executor: T3, mut sub_executor: T4, ) where - P: Into, + P: Into, T1: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), BooleanBlock, @@ -162,7 +162,7 @@ pub(crate) fn signed_no_cmux_erc20_test( mut add_executor: T3, mut sub_executor: T4, ) where - P: Into, + P: Into, T1: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), BooleanBlock, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_random_op_sequence.rs b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_random_op_sequence.rs index bbb93d628..706b76570 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_random_op_sequence.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_long_run/test_signed_random_op_sequence.rs @@ -82,7 +82,7 @@ pub(crate) type SignedLog2OpExecutor = Box FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>>; fn random_op_sequence

(param: P) where - P: Into + Clone, + P: Into + Clone, { // Binary Ops Executors let add_executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); @@ -548,7 +548,7 @@ pub(crate) fn signed_random_op_sequence_test

( String, )], ) where - P: Into, + P: Into, { let param = param.into(); let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/mod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/mod.rs index b1c438137..d6316de24 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/mod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/mod.rs @@ -46,7 +46,7 @@ use rand::Rng; create_parameterized_test!(integer_signed_encrypt_decrypt); create_parameterized_test!(integer_signed_encrypt_decrypt_128_bits); -fn integer_signed_encrypt_decrypt_128_bits(param: impl Into) { +fn integer_signed_encrypt_decrypt_128_bits(param: impl Into) { let param = param.into(); let nb_tests = nb_tests_for_params(param); let (cks, _) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -65,7 +65,7 @@ fn integer_signed_encrypt_decrypt_128_bits(param: impl Into) { } } -fn integer_signed_encrypt_decrypt(param: impl Into) { +fn integer_signed_encrypt_decrypt(param: impl Into) { let param = param.into(); let nb_tests = nb_tests_for_params(param); let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -104,7 +104,7 @@ fn integer_signed_encrypt_decrypt(param: impl Into) { //================================================================================ create_parameterized_test!(integer_signed_unchecked_scalar_div_rem_floor); -fn integer_signed_unchecked_scalar_div_rem_floor(param: impl Into) { +fn integer_signed_unchecked_scalar_div_rem_floor(param: impl Into) { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); let mut rng = rand::thread_rng(); @@ -213,7 +213,7 @@ fn integer_signed_unchecked_scalar_div_rem_floor(param: impl Into create_parameterized_test!(integer_signed_default_scalar_div_rem); -fn integer_signed_default_scalar_div_rem(param: impl Into) { +fn integer_signed_default_scalar_div_rem(param: impl Into) { let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); sks.set_deterministic_pbs_execution(true); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/modulus_switch_compression.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/modulus_switch_compression.rs index e2b8c3240..dc194abf3 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/modulus_switch_compression.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/modulus_switch_compression.rs @@ -12,7 +12,7 @@ create_parameterized_test!(modulus_switch_compression_signed); fn modulus_switch_compression_signed

(param: P) where - P: Into, + P: Into, { let size = 4; let (cks, sks) = gen_keys_radix(param, size); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_abs.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_abs.rs index 44b20cdb2..9dd10056a 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_abs.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_abs.rs @@ -21,7 +21,7 @@ create_parameterized_test!(integer_signed_smart_absolute_value); fn integer_signed_default_absolute_value

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::abs_parallelized); signed_default_absolute_value_test(param, executor); @@ -29,7 +29,7 @@ where fn integer_signed_unchecked_absolute_value

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_abs_parallelized); signed_unchecked_absolute_value_test(param, executor); @@ -37,7 +37,7 @@ where fn integer_signed_smart_absolute_value

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_abs_parallelized); signed_smart_absolute_value_test(param, executor); @@ -45,7 +45,7 @@ where pub(crate) fn signed_unchecked_absolute_value_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); @@ -96,7 +96,7 @@ where pub(crate) fn signed_smart_absolute_value_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a mut SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); @@ -137,7 +137,7 @@ where pub(crate) fn signed_default_absolute_value_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); 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 463bd6cd5..51a38bf4a 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 @@ -73,7 +73,7 @@ create_parameterized_test!( fn integer_signed_unchecked_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_add_parallelized); signed_unchecked_add_test(param, executor); @@ -81,7 +81,7 @@ where fn integer_signed_unchecked_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_signed_overflowing_add); signed_unchecked_overflowing_add_test(param, executor); @@ -89,7 +89,7 @@ where fn integer_signed_unchecked_overflowing_add_parallelized

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_signed_overflowing_add_parallelized); @@ -98,7 +98,7 @@ where fn integer_signed_default_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::signed_overflowing_add_parallelized); signed_default_overflowing_add_test(param, executor); @@ -106,7 +106,7 @@ where fn integer_extensive_trivial_signed_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::signed_overflowing_add_parallelized); extensive_trivial_signed_default_overflowing_add_test(param, executor); @@ -114,7 +114,7 @@ where fn integer_signed_default_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); signed_default_add_test(param, executor); @@ -122,7 +122,7 @@ where fn integer_extensive_trivial_signed_default_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); extensive_trivial_signed_default_add_test(param, executor); @@ -131,7 +131,7 @@ where fn integer_extensive_trivial_signed_advanced_overflowing_add_assign_with_carry_sequential

( param: P, ) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &SignedRadixCiphertext, rhs: &SignedRadixCiphertext| { let mut result = lhs.clone(); @@ -152,7 +152,7 @@ fn integer_extensive_trivial_signed_advanced_overflowing_add_assign_with_carry_s fn integer_extensive_trivial_signed_overflowing_advanced_add_assign_with_carry_at_least_4_bits

( param: P, ) where - P: Into, + P: Into, { // We explicitly call the 4 bit function to make sure it's being tested, // no matter the number of blocks / threads available @@ -174,7 +174,7 @@ fn integer_extensive_trivial_signed_overflowing_advanced_add_assign_with_carry_a fn integer_signed_smart_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_add_parallelized); signed_smart_add_test(param, executor); @@ -182,7 +182,7 @@ where pub(crate) fn signed_unchecked_overflowing_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, BooleanBlock), @@ -298,7 +298,7 @@ where pub(crate) fn signed_default_overflowing_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, BooleanBlock), @@ -436,7 +436,7 @@ where /// or extremely extremely fast in general, or if its plugged just as a one time thing. pub(crate) fn extensive_trivial_signed_default_overflowing_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, BooleanBlock), @@ -488,7 +488,7 @@ where pub(crate) fn signed_unchecked_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -538,7 +538,7 @@ where pub(crate) fn signed_default_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -600,7 +600,7 @@ where /// or extremely extremely fast in general, or if its plugged just as a one time thing. pub(crate) fn extensive_trivial_signed_default_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -645,7 +645,7 @@ where pub(crate) fn signed_smart_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut SignedRadixCiphertext, &'a mut SignedRadixCiphertext), SignedRadixCiphertext, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_bitwise_op.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_bitwise_op.rs index c36994e2f..f1fe49cdf 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_bitwise_op.rs @@ -26,7 +26,7 @@ create_parameterized_test!(integer_signed_default_bitxor); fn integer_signed_unchecked_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitand_parallelized); signed_unchecked_bitand_test(param, executor); @@ -34,7 +34,7 @@ where fn integer_signed_unchecked_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitor_parallelized); signed_unchecked_bitor_test(param, executor); @@ -42,7 +42,7 @@ where fn integer_signed_unchecked_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitxor_parallelized); signed_unchecked_bitxor_test(param, executor); @@ -50,7 +50,7 @@ where fn integer_signed_default_bitnot

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitnot); signed_default_bitnot_test(param, executor); @@ -58,7 +58,7 @@ where fn integer_signed_default_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitand_parallelized); signed_default_bitand_test(param, executor); @@ -66,7 +66,7 @@ where fn integer_signed_default_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitor_parallelized); signed_default_bitor_test(param, executor); @@ -74,14 +74,14 @@ where fn integer_signed_default_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitxor_parallelized); signed_default_bitxor_test(param, executor); } pub(crate) fn signed_unchecked_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -114,7 +114,7 @@ where pub(crate) fn signed_unchecked_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -147,7 +147,7 @@ where pub(crate) fn signed_unchecked_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -180,7 +180,7 @@ where pub(crate) fn signed_default_bitnot_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); @@ -213,7 +213,7 @@ where pub(crate) fn signed_default_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -270,7 +270,7 @@ where pub(crate) fn signed_default_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -327,7 +327,7 @@ where pub(crate) fn signed_default_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_block_shift.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_block_shift.rs index 2a5c6ba92..5fe64ced9 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_block_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_block_shift.rs @@ -24,7 +24,7 @@ create_parameterized_test!(integer_signed_block_shift_left); fn integer_signed_block_shift_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::block_shift_right); default_block_shift_right_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_signed_block_shift_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::block_shift_left); default_block_shift_left_test(param, executor); @@ -40,7 +40,7 @@ where pub(crate) fn default_block_shift_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -139,7 +139,7 @@ where pub(crate) fn default_block_shift_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, 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 28017c3b7..644d4282f 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 @@ -22,7 +22,7 @@ create_parameterized_test!(integer_signed_default_scalar_if_then_else); fn integer_signed_unchecked_if_then_else

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_if_then_else_parallelized); signed_unchecked_if_then_else_test(param, executor); @@ -30,7 +30,7 @@ where fn integer_signed_default_if_then_else

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, @@ -43,7 +43,7 @@ where fn integer_signed_default_scalar_if_then_else

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, cond: &BooleanBlock, lhs: i64, rhs: i64, n_blocks: usize| { sks.scalar_if_then_else_parallelized(cond, lhs, rhs, n_blocks) @@ -54,7 +54,7 @@ where pub(crate) fn signed_default_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< ( &'a BooleanBlock, @@ -170,7 +170,7 @@ where pub(crate) fn signed_default_scalar_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a BooleanBlock, i64, i64, usize), SignedRadixCiphertext>, { let param = param.into(); @@ -208,7 +208,7 @@ where pub(crate) fn signed_unchecked_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< ( &'a BooleanBlock, 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 d37b24310..cae2c8e20 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 @@ -26,7 +26,7 @@ pub(crate) fn test_signed_unchecked_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -105,7 +105,7 @@ pub(crate) fn test_signed_smart_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -195,7 +195,7 @@ pub(crate) fn test_signed_default_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -288,7 +288,7 @@ macro_rules! define_signed_comparison_test_functions { ::paste::paste!{ // Fist we "specialialize" the test_signed fns - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_unchecked_function( @@ -299,7 +299,7 @@ macro_rules! define_signed_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_unchecked_function( @@ -310,7 +310,7 @@ macro_rules! define_signed_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_smart_function( @@ -321,7 +321,7 @@ macro_rules! define_signed_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_smart_function( @@ -332,7 +332,7 @@ macro_rules! define_signed_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[<$comparison_name _parallelized>]); test_signed_default_function( @@ -435,7 +435,7 @@ pub(crate) fn test_signed_unchecked_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -514,7 +514,7 @@ pub(crate) fn test_signed_smart_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -604,7 +604,7 @@ pub(crate) fn test_signed_default_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -686,32 +686,32 @@ pub(crate) fn test_signed_default_minmax( mod no_coverage { use super::*; - fn integer_signed_unchecked_min_parallelized_128_bits(params: impl Into) { + fn integer_signed_unchecked_min_parallelized_128_bits(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_min_parallelized); test_signed_unchecked_minmax(params, 2, executor, std::cmp::min::) } - fn integer_signed_unchecked_max_parallelized_128_bits(params: impl Into) { + fn integer_signed_unchecked_max_parallelized_128_bits(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_max_parallelized); test_signed_unchecked_minmax(params, 2, executor, std::cmp::max::) } - fn integer_signed_smart_min_parallelized_128_bits(params: impl Into) { + fn integer_signed_smart_min_parallelized_128_bits(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::smart_min_parallelized); test_signed_smart_minmax(params, 2, executor, std::cmp::min::); } - fn integer_signed_smart_max_parallelized_128_bits(params: impl Into) { + fn integer_signed_smart_max_parallelized_128_bits(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::smart_max_parallelized); test_signed_smart_minmax(params, 2, executor, std::cmp::max::); } - fn integer_signed_min_parallelized_128_bits(params: impl Into) { + fn integer_signed_min_parallelized_128_bits(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::min_parallelized); test_signed_default_minmax(params, 2, executor, std::cmp::min::); } - fn integer_signed_max_parallelized_128_bits(params: impl Into) { + fn integer_signed_max_parallelized_128_bits(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::max_parallelized); test_signed_default_minmax(params, 2, executor, std::cmp::max::); } @@ -824,7 +824,7 @@ mod coverage { create_parameterized_test!(integer_extensive_trivial_signed_default_comparisons); -fn integer_extensive_trivial_signed_default_comparisons(params: impl Into) { +fn integer_extensive_trivial_signed_default_comparisons(params: impl Into) { let lt_executor = CpuFunctionExecutor::new(&ServerKey::lt_parallelized); let le_executor = CpuFunctionExecutor::new(&ServerKey::le_parallelized); let gt_executor = CpuFunctionExecutor::new(&ServerKey::gt_parallelized); @@ -856,7 +856,7 @@ pub(crate) fn extensive_trivial_signed_default_comparisons_test, + P: Into, E1: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), BooleanBlock, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_count_zeros_ones.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_count_zeros_ones.rs index d2a67acbd..cc54b8ac9 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_count_zeros_ones.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_count_zeros_ones.rs @@ -17,7 +17,7 @@ create_parameterized_test!(integer_signed_default_count_zeros_ones); fn integer_extensive_trivial_signed_default_count_zeros_ones

(param: P) where - P: Into, + P: Into, { let count_zeros_executor = CpuFunctionExecutor::new(&ServerKey::count_zeros_parallelized); let count_ones_executor = CpuFunctionExecutor::new(&ServerKey::count_ones_parallelized); @@ -30,7 +30,7 @@ where fn integer_signed_default_count_zeros_ones

(param: P) where - P: Into, + P: Into, { let count_zeros_executor = CpuFunctionExecutor::new(&ServerKey::count_zeros_parallelized); let count_ones_executor = CpuFunctionExecutor::new(&ServerKey::count_ones_parallelized); @@ -42,7 +42,7 @@ pub(crate) fn signed_default_count_zeros_ones_test( mut count_zeros_executor: E1, mut count_ones_executor: E2, ) where - P: Into, + P: Into, E1: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, E2: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { @@ -117,7 +117,7 @@ pub(crate) fn extensive_trivial_signed_default_count_zeros_ones_test( mut count_zeros_executor: E1, mut count_ones_executor: E2, ) where - P: Into, + P: Into, E1: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, E2: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { 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 2b0d82777..40c31e440 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 @@ -55,7 +55,7 @@ create_parameterized_test!( ); fn integer_signed_unchecked_div_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_div_rem_parallelized); signed_unchecked_div_rem_test(param, executor); @@ -63,7 +63,7 @@ where fn integer_signed_unchecked_div_rem_floor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_div_rem_floor_parallelized); signed_unchecked_div_rem_floor_test(param, executor); @@ -71,7 +71,7 @@ where pub(crate) fn signed_unchecked_div_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, SignedRadixCiphertext), @@ -139,7 +139,7 @@ where pub(crate) fn signed_unchecked_div_rem_floor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, SignedRadixCiphertext), 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 e7fc521ba..d6b337257 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 @@ -15,7 +15,7 @@ use crate::integer::{ use crate::shortint::parameters::coverage_parameters::*; use crate::shortint::parameters::test_params::*; use crate::shortint::parameters::*; -use crate::shortint::PBSParameters; + use rand::Rng; use std::sync::Arc; @@ -38,7 +38,7 @@ create_parameterized_test!(integer_signed_default_checked_ilog2 { fn integer_signed_default_trailing_zeros

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::trailing_zeros_parallelized); default_trailing_zeros_test(param, executor); @@ -46,7 +46,7 @@ where fn integer_signed_default_trailing_ones

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::trailing_ones_parallelized); default_trailing_ones_test(param, executor); @@ -54,7 +54,7 @@ where fn integer_signed_default_leading_zeros

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::leading_zeros_parallelized); default_leading_zeros_test(param, executor); @@ -62,7 +62,7 @@ where fn integer_signed_default_leading_ones

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::leading_ones_parallelized); default_leading_ones_test(param, executor); @@ -70,7 +70,7 @@ where fn integer_signed_default_ilog2

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::ilog2_parallelized); default_ilog2_test(param, executor); @@ -78,7 +78,7 @@ where fn integer_signed_default_checked_ilog2

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::checked_ilog2_parallelized); default_checked_ilog2_test(param, executor); @@ -90,7 +90,7 @@ pub(crate) fn signed_default_count_consecutive_bits_test( param: P, mut executor: T, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -207,7 +207,7 @@ pub(crate) fn signed_default_count_consecutive_bits_test( pub(crate) fn default_trailing_zeros_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { signed_default_count_consecutive_bits_test( @@ -220,7 +220,7 @@ where pub(crate) fn default_trailing_ones_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { signed_default_count_consecutive_bits_test(Direction::Trailing, BitValue::One, param, executor); @@ -228,7 +228,7 @@ where pub(crate) fn default_leading_zeros_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { signed_default_count_consecutive_bits_test(Direction::Leading, BitValue::Zero, param, executor); @@ -236,7 +236,7 @@ where pub(crate) fn default_leading_ones_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { signed_default_count_consecutive_bits_test(Direction::Leading, BitValue::One, param, executor); @@ -244,7 +244,7 @@ where pub(crate) fn default_ilog2_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -379,7 +379,7 @@ where pub(crate) fn default_checked_ilog2_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, (RadixCiphertext, BooleanBlock)>, { let param = param.into(); 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 36d86d3cb..8dd27a1b1 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 @@ -40,7 +40,7 @@ create_parameterized_test!( fn integer_signed_unchecked_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_mul_parallelized); signed_unchecked_mul_test(param, executor); @@ -48,13 +48,13 @@ where fn integer_signed_default_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::mul_parallelized); signed_default_mul_test(param, executor); } -fn integer_signed_default_overflowing_mul(param: impl Into) { +fn integer_signed_default_overflowing_mul(param: impl Into) { let param = param.into(); let nb_tests_smaller = nb_tests_smaller_for_params(param); let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -188,7 +188,7 @@ fn integer_signed_default_overflowing_mul(param: impl Into) { pub(crate) fn signed_unchecked_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -221,7 +221,7 @@ where pub(crate) fn signed_default_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_neg.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_neg.rs index 7beeb06a5..52f3c8ae5 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_neg.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_neg.rs @@ -21,7 +21,7 @@ create_parameterized_test!(integer_signed_default_neg); fn integer_signed_unchecked_neg

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_neg); signed_unchecked_neg_test(param, executor); @@ -29,7 +29,7 @@ where fn integer_signed_smart_neg

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_neg_parallelized); signed_smart_neg_test(param, executor); @@ -37,7 +37,7 @@ where fn integer_signed_default_neg

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::neg_parallelized); signed_default_neg_test(param, executor); @@ -45,7 +45,7 @@ where pub(crate) fn signed_unchecked_neg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); @@ -98,7 +98,7 @@ where pub(crate) fn signed_smart_neg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a mut SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); @@ -136,7 +136,7 @@ where pub(crate) fn signed_default_neg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_rotate.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_rotate.rs index e1cf5cfdc..f6095911f 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_rotate.rs @@ -28,7 +28,7 @@ create_parameterized_test!(integer_signed_rotate_left); pub(crate) fn signed_default_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -122,7 +122,7 @@ where pub(crate) fn signed_default_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -214,7 +214,7 @@ where pub(crate) fn signed_unchecked_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -273,7 +273,7 @@ where pub(crate) fn signed_unchecked_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -332,7 +332,7 @@ where fn integer_signed_unchecked_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_rotate_right_parallelized); signed_unchecked_rotate_right_test(param, executor); @@ -340,7 +340,7 @@ where fn integer_signed_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::rotate_right_parallelized); signed_default_rotate_right_test(param, executor); @@ -348,7 +348,7 @@ where fn integer_signed_unchecked_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_rotate_left_parallelized); signed_unchecked_rotate_left_test(param, executor); @@ -356,7 +356,7 @@ where fn integer_signed_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::rotate_left_parallelized); signed_default_rotate_left_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_add.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_add.rs index 317c90fe1..0c3de2d33 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_add.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_add.rs @@ -24,7 +24,7 @@ create_parameterized_test!(integer_signed_default_overflowing_scalar_add); fn integer_signed_unchecked_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_add); signed_unchecked_scalar_add_test(param, executor); @@ -32,7 +32,7 @@ where fn integer_signed_default_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_add_parallelized); signed_default_scalar_add_test(param, executor); @@ -40,14 +40,14 @@ where fn integer_signed_default_overflowing_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::signed_overflowing_scalar_add_parallelized); signed_default_overflowing_scalar_add_test(param, executor); } pub(crate) fn signed_unchecked_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -93,7 +93,7 @@ where pub(crate) fn signed_default_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -143,7 +143,7 @@ where pub(crate) fn signed_default_overflowing_scalar_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, i64), (SignedRadixCiphertext, BooleanBlock), diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_bitwise_op.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_bitwise_op.rs index 9549732a4..339a86bc8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_bitwise_op.rs @@ -21,7 +21,7 @@ create_parameterized_test!(integer_signed_default_scalar_bitxor); fn integer_signed_default_scalar_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitand_parallelized); signed_default_scalar_bitand_test(param, executor); @@ -29,7 +29,7 @@ where fn integer_signed_default_scalar_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitor_parallelized); signed_default_scalar_bitor_test(param, executor); @@ -37,14 +37,14 @@ where fn integer_signed_default_scalar_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitxor_parallelized); signed_default_scalar_bitxor_test(param, executor); } pub(crate) fn signed_default_scalar_bitand_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -89,7 +89,7 @@ where pub(crate) fn signed_default_scalar_bitor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -135,7 +135,7 @@ where pub(crate) fn signed_default_scalar_bitxor_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); 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 4ed53cce7..4974ace45 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 @@ -25,7 +25,7 @@ pub(crate) fn test_signed_unchecked_scalar_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto + From, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, Scalar), BooleanBlock>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -91,7 +91,7 @@ pub(crate) fn test_signed_smart_scalar_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -158,7 +158,7 @@ pub(crate) fn test_signed_default_scalar_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto @@ -231,7 +231,7 @@ pub(crate) fn test_signed_default_scalar_function( macro_rules! define_signed_scalar_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 2; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_unchecked_scalar_function( @@ -242,7 +242,7 @@ macro_rules! define_signed_scalar_comparison_test_functions { ) } - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 2; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_smart_scalar_function( @@ -253,7 +253,7 @@ macro_rules! define_signed_scalar_comparison_test_functions { ) } - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 2; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_signed_default_scalar_function( @@ -384,7 +384,7 @@ pub(crate) fn test_signed_unchecked_scalar_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, Scalar), SignedRadixCiphertext>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -450,7 +450,7 @@ pub(crate) fn test_signed_smart_scalar_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto + WrappingAdd, T: for<'a> FunctionExecutor<(&'a mut SignedRadixCiphertext, Scalar), SignedRadixCiphertext>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -513,7 +513,7 @@ pub(crate) fn test_signed_default_scalar_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto + WrappingAdd, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, Scalar), SignedRadixCiphertext>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -751,7 +751,7 @@ mod coverage { create_parameterized_test!(integer_extensive_trivial_signed_default_scalar_comparisons); -fn integer_extensive_trivial_signed_default_scalar_comparisons(params: impl Into) { +fn integer_extensive_trivial_signed_default_scalar_comparisons(params: impl Into) { let lt_executor = CpuFunctionExecutor::new(&ServerKey::scalar_lt_parallelized); let le_executor = CpuFunctionExecutor::new(&ServerKey::scalar_le_parallelized); let gt_executor = CpuFunctionExecutor::new(&ServerKey::scalar_gt_parallelized); @@ -783,7 +783,7 @@ pub(crate) fn extensive_trivial_signed_default_scalar_comparisons_test, + P: Into, E1: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i128), BooleanBlock>, E2: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i128), BooleanBlock>, E3: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i128), BooleanBlock>, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_div_mod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_div_mod.rs index cb2765f26..3c59c46fa 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_div_mod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_div_mod.rs @@ -20,7 +20,7 @@ create_parameterized_test!(integer_signed_unchecked_scalar_div_rem); fn integer_signed_unchecked_scalar_div_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_signed_scalar_div_rem_parallelized); @@ -29,7 +29,7 @@ where pub(crate) fn signed_unchecked_scalar_div_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, i64), (SignedRadixCiphertext, SignedRadixCiphertext), diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_dot_prod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_dot_prod.rs index 8488dddfd..e14ce1fd8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_dot_prod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_dot_prod.rs @@ -13,7 +13,6 @@ use crate::integer::{ use crate::shortint::parameters::coverage_parameters::*; use crate::shortint::parameters::test_params::*; use crate::shortint::parameters::*; -use crate::shortint::PBSParameters; use rand::{thread_rng, Rng}; use std::sync::Arc; @@ -21,18 +20,18 @@ create_parameterized_test!(signed_unchecked_boolean_scalar_dot_prod); create_parameterized_test!(signed_smart_boolean_scalar_dot_prod); create_parameterized_test!(signed_boolean_scalar_dot_prod); -fn signed_unchecked_boolean_scalar_dot_prod(params: impl Into) { +fn signed_unchecked_boolean_scalar_dot_prod(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_boolean_scalar_dot_prod_parallelized); signed_unchecked_boolean_scalar_dot_prod_test_case(params, executor); } -fn signed_smart_boolean_scalar_dot_prod(params: impl Into) { +fn signed_smart_boolean_scalar_dot_prod(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::smart_boolean_scalar_dot_prod_parallelized); signed_smart_boolean_scalar_dot_prod_test_case(params, executor); } -fn signed_boolean_scalar_dot_prod(params: impl Into) { +fn signed_boolean_scalar_dot_prod(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::boolean_scalar_dot_prod_parallelized); signed_default_boolean_scalar_dot_prod_test_case(params, executor); } @@ -49,7 +48,7 @@ pub(crate) fn signed_unchecked_boolean_scalar_dot_prod_test_case( params: P, mut dot_prod_executor: E, ) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [BooleanBlock], &'a [i64], u32), SignedRadixCiphertext>, { let params = params.into(); @@ -108,7 +107,7 @@ pub(crate) fn signed_smart_boolean_scalar_dot_prod_test_case( params: P, mut dot_prod_executor: E, ) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a mut [BooleanBlock], &'a [i64], u32), SignedRadixCiphertext>, { let params = params.into(); @@ -182,7 +181,7 @@ pub(crate) fn signed_default_boolean_scalar_dot_prod_test_case( params: P, mut dot_prod_executor: E, ) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [BooleanBlock], &'a [i64], u32), SignedRadixCiphertext>, { let params = params.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_mul.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_mul.rs index 16f6af2e2..f5dd4e4c2 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_mul.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_mul.rs @@ -17,7 +17,7 @@ create_parameterized_test!(integer_signed_unchecked_scalar_mul); fn integer_signed_unchecked_scalar_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_mul_parallelized); signed_unchecked_scalar_mul_test(param, executor); @@ -25,7 +25,7 @@ where pub(crate) fn signed_unchecked_scalar_mul_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_rotate.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_rotate.rs index 91f82d11a..bd0378456 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_rotate.rs @@ -23,7 +23,7 @@ create_parameterized_test!(integer_signed_default_scalar_rotate_right); fn integer_signed_unchecked_scalar_rotate_left

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_rotate_left_parallelized); signed_unchecked_scalar_rotate_left_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_signed_default_scalar_rotate_left

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_rotate_left_parallelized); signed_default_scalar_rotate_left_test(param, executor); @@ -39,7 +39,7 @@ where fn integer_signed_unchecked_scalar_rotate_right

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_rotate_right_parallelized); signed_unchecked_scalar_rotate_right_test(param, executor); @@ -47,7 +47,7 @@ where fn integer_signed_default_scalar_rotate_right

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_rotate_right_parallelized); signed_default_scalar_rotate_right_test(param, executor); @@ -55,7 +55,7 @@ where pub(crate) fn signed_unchecked_scalar_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -101,7 +101,7 @@ where pub(crate) fn signed_unchecked_scalar_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -147,7 +147,7 @@ where pub(crate) fn signed_default_scalar_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -214,7 +214,7 @@ where pub(crate) fn signed_default_scalar_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_shift.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_shift.rs index 0f31a3cf6..f02f3d28d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_shift.rs @@ -23,7 +23,7 @@ create_parameterized_test!(integer_signed_default_scalar_right_shift); fn integer_signed_unchecked_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_left_shift_parallelized); signed_unchecked_scalar_left_shift_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_signed_default_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_left_shift_parallelized); signed_default_scalar_left_shift_test(param, executor); @@ -39,7 +39,7 @@ where fn integer_signed_unchecked_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_right_shift_parallelized); signed_unchecked_scalar_right_shift_test(param, executor); @@ -47,14 +47,14 @@ where fn integer_signed_default_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_right_shift_parallelized); signed_default_scalar_right_shift_test(param, executor); } pub(crate) fn signed_unchecked_scalar_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -100,7 +100,7 @@ where pub(crate) fn signed_unchecked_scalar_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -146,7 +146,7 @@ where pub(crate) fn signed_default_scalar_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -213,7 +213,7 @@ where pub(crate) fn signed_default_scalar_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_sub.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_sub.rs index d9695f323..ad1f1d726 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_sub.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_scalar_sub.rs @@ -26,7 +26,7 @@ create_parameterized_test!(integer_signed_default_left_scalar_sub); fn integer_signed_unchecked_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_sub); signed_unchecked_scalar_sub_test(param, executor); @@ -34,7 +34,7 @@ where fn integer_signed_default_overflowing_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::signed_overflowing_scalar_sub_parallelized); signed_default_overflowing_scalar_sub_test(param, executor); @@ -42,7 +42,7 @@ where fn integer_signed_unchecked_left_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_left_scalar_sub); signed_unchecked_left_scalar_sub_test(param, executor); @@ -50,7 +50,7 @@ where fn integer_signed_smart_left_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_left_scalar_sub_parallelized); signed_smart_left_scalar_sub_test(param, executor); @@ -58,7 +58,7 @@ where fn integer_signed_default_left_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::left_scalar_sub_parallelized); signed_default_left_scalar_sub_test(param, executor); @@ -66,7 +66,7 @@ where pub(crate) fn signed_unchecked_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>, { let param = param.into(); @@ -112,7 +112,7 @@ where pub(crate) fn signed_default_overflowing_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, i64), (SignedRadixCiphertext, BooleanBlock), @@ -292,7 +292,7 @@ where pub(crate) fn signed_unchecked_left_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(i64, &'a SignedRadixCiphertext), SignedRadixCiphertext>, { let param = param.into(); @@ -342,7 +342,7 @@ where pub(crate) fn signed_smart_left_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(i64, &'a mut SignedRadixCiphertext), SignedRadixCiphertext>, { let param = param.into(); @@ -389,7 +389,7 @@ where pub(crate) fn signed_default_left_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(i64, &'a SignedRadixCiphertext), SignedRadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_shift.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_shift.rs index 6c20ed2e3..2bcbd690d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_shift.rs @@ -26,7 +26,7 @@ create_parameterized_test!(integer_signed_right_shift); pub(crate) fn signed_default_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -117,7 +117,7 @@ where pub(crate) fn signed_default_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -208,7 +208,7 @@ where pub(crate) fn signed_unchecked_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -270,7 +270,7 @@ where pub(crate) fn signed_unchecked_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a RadixCiphertext), SignedRadixCiphertext, @@ -331,7 +331,7 @@ where fn integer_signed_unchecked_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_right_shift_parallelized); signed_unchecked_right_shift_test(param, executor); @@ -339,7 +339,7 @@ where fn integer_signed_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::right_shift_parallelized); signed_default_right_shift_test(param, executor); @@ -347,7 +347,7 @@ where fn integer_signed_unchecked_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_left_shift_parallelized); signed_unchecked_left_shift_test(param, executor); @@ -355,7 +355,7 @@ where fn integer_signed_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::left_shift_parallelized); signed_default_left_shift_test(param, executor); 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 45825e291..1d141f244 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 @@ -46,7 +46,7 @@ create_parameterized_test!(integer_extensive_trivial_signed_default_overflowing_ fn integer_signed_unchecked_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_sub); signed_unchecked_sub_test(param, executor); @@ -54,7 +54,7 @@ where fn integer_signed_unchecked_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_signed_overflowing_sub); signed_unchecked_overflowing_sub_test(param, executor); @@ -62,7 +62,7 @@ where fn integer_signed_default_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::sub_parallelized); signed_default_sub_test(param, executor); @@ -70,7 +70,7 @@ where fn integer_extensive_trivial_signed_default_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::sub_parallelized); extensive_trivial_signed_default_sub_test(param, executor); @@ -78,7 +78,7 @@ where fn integer_extensive_trivial_signed_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::signed_overflowing_sub_parallelized); extensive_trivial_signed_default_overflowing_sub_test(param, executor); @@ -86,7 +86,7 @@ where fn integer_signed_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::signed_overflowing_sub_parallelized); signed_default_overflowing_sub_test(param, executor); @@ -94,7 +94,7 @@ where fn integer_signed_default_overflowing_sub_sequential

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &SignedRadixCiphertext, rhs: &SignedRadixCiphertext| { sks.signed_overflowing_sub_parallelized_with_choice( @@ -109,7 +109,7 @@ where fn integer_signed_default_overflowing_sub_parallel

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &SignedRadixCiphertext, rhs: &SignedRadixCiphertext| { sks.signed_overflowing_sub_parallelized_with_choice( @@ -124,7 +124,7 @@ where pub(crate) fn signed_default_overflowing_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, BooleanBlock), @@ -262,7 +262,7 @@ where pub(crate) fn signed_unchecked_overflowing_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, BooleanBlock), @@ -384,7 +384,7 @@ pub(crate) fn extensive_trivial_signed_default_overflowing_sub_test( param: P, mut overflowing_sub_executor: T, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), (SignedRadixCiphertext, BooleanBlock), @@ -436,7 +436,7 @@ pub(crate) fn extensive_trivial_signed_default_overflowing_sub_test( pub(crate) fn signed_unchecked_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -486,7 +486,7 @@ where pub(crate) fn signed_default_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, @@ -547,7 +547,7 @@ where /// or extremely extremely fast in general, or if its plugged just as a one time thing. pub(crate) fn extensive_trivial_signed_default_sub_test(param: P, mut sub_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a SignedRadixCiphertext, &'a SignedRadixCiphertext), SignedRadixCiphertext, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_vector_comparisons.rs b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_vector_comparisons.rs index 51f04bb4e..b1b96c26b 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_vector_comparisons.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_signed/test_vector_comparisons.rs @@ -18,7 +18,7 @@ create_parameterized_test!(integer_signed_default_all_eq_slices_test_case); fn integer_signed_unchecked_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_all_eq_slices_parallelized); unchecked_all_eq_slices_test_case(param, executor); @@ -26,7 +26,7 @@ where pub(crate) fn unchecked_all_eq_slices_test_case(params: P, mut executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor< (&'a [SignedRadixCiphertext], &'a [SignedRadixCiphertext]), BooleanBlock, @@ -50,7 +50,7 @@ where fn integer_signed_default_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::all_eq_slices_parallelized); default_all_eq_slices_test_case(param, executor); @@ -58,7 +58,7 @@ where pub(crate) fn default_all_eq_slices_test_case(params: P, mut executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor< (&'a [SignedRadixCiphertext], &'a [SignedRadixCiphertext]), BooleanBlock, 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 67a61a7e4..aa59c9c2c 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 @@ -53,7 +53,7 @@ pub(crate) const MAX_VEC_LEN: usize = 5; pub(crate) const MAX_NB_CTXT: usize = 8; -pub(crate) const fn nb_unchecked_tests_for_params(params: PBSParameters) -> usize { +pub(crate) const fn nb_unchecked_tests_for_params(params: AtomicPatternParameters) -> usize { nb_tests_for_params(params) } @@ -61,7 +61,7 @@ pub(crate) const fn nb_unchecked_tests_for_params(params: PBSParameters) -> usiz /// /// The bigger the number of bits bootstrapped by the input parameters, the smaller the /// number of iteration is -pub(crate) const fn nb_tests_for_params(params: PBSParameters) -> usize { +pub(crate) const fn nb_tests_for_params(params: AtomicPatternParameters) -> usize { let full_modulus = params.message_modulus().0 * params.carry_modulus().0; if cfg!(tarpaulin) { @@ -85,7 +85,7 @@ pub(crate) const fn nb_tests_for_params(params: PBSParameters) -> usize { /// Smaller number of loop iteration within randomized test, /// meant for test where the function tested is more expensive -pub(crate) const fn nb_tests_smaller_for_params(params: PBSParameters) -> usize { +pub(crate) const fn nb_tests_smaller_for_params(params: AtomicPatternParameters) -> usize { let full_modulus = params.message_modulus().0 * params.carry_modulus().0; if cfg!(tarpaulin) { @@ -656,7 +656,7 @@ fn test_non_regression_clone_from() { fn integer_trim_radix_msb_blocks_handles_dirty_inputs

(param: P) where - P: Into, + P: Into, { let param = param.into(); let (client_key, server_key) = crate::integer::gen_keys_radix(param, NB_CTXT); @@ -700,7 +700,7 @@ where fn integer_full_propagate

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::full_propagate_parallelized); full_propagate_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/modulus_switch_compression.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/modulus_switch_compression.rs index e2ec72e32..af2602fc1 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/modulus_switch_compression.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/modulus_switch_compression.rs @@ -12,7 +12,7 @@ create_parameterized_test!(modulus_switch_compression); fn modulus_switch_compression

(param: P) where - P: Into, + P: Into, { let size = 4; let (cks, sks) = gen_keys_radix(param, size); 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 9bbabab60..86f82a575 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 @@ -63,7 +63,7 @@ create_parameterized_test!( fn integer_unchecked_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_add_parallelized); unchecked_add_test(param, executor); @@ -71,7 +71,7 @@ where fn integer_unchecked_add_assign

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_add_assign_parallelized); unchecked_add_assign_test(param, executor); @@ -79,7 +79,7 @@ where fn integer_smart_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_add_parallelized); smart_add_test(param, executor); @@ -87,7 +87,7 @@ where fn integer_default_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); default_add_test(param, executor); @@ -95,7 +95,7 @@ where fn integer_extensive_trivial_default_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized); extensive_trivial_default_add_test(param, executor); @@ -103,7 +103,7 @@ where fn integer_advanced_overflowing_add_assign_with_carry_at_least_4_bits

(param: P) where - P: Into, + P: Into, { // We explicitly call the 4 bit function to make sure it's being tested, // no matter the number of blocks / threads available @@ -136,7 +136,7 @@ where fn integer_extensive_trivial_overflowing_advanced_add_assign_with_carry_at_least_4_bits

(param: P) where - P: Into, + P: Into, { // We explicitly call the 4 bit function to make sure it's being tested, // no matter the number of blocks / threads available @@ -169,7 +169,7 @@ where fn integer_advanced_add_assign_with_carry_sequential

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &RadixCiphertext, rhs: &RadixCiphertext| { let mut result = lhs.clone(); @@ -200,7 +200,7 @@ where fn integer_extensive_trivial_advanced_overflowing_add_assign_with_carry_sequential

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &RadixCiphertext, rhs: &RadixCiphertext| { let mut result = lhs.clone(); @@ -231,7 +231,7 @@ where fn integer_default_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_add_parallelized); default_overflowing_add_test(param, executor); @@ -239,7 +239,7 @@ where fn integer_extensive_trivial_default_overflowing_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_add_parallelized); extensive_trivial_default_overflowing_add_test(param, executor); @@ -275,7 +275,7 @@ impl ExpectedDegrees { pub(crate) fn unchecked_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -331,7 +331,7 @@ where pub(crate) fn unchecked_add_assign_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, &'a RadixCiphertext), ()>, { let param = param.into(); @@ -387,7 +387,7 @@ where pub(crate) fn smart_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -447,7 +447,7 @@ where pub(crate) fn default_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -509,7 +509,7 @@ where /// or extremely extremely fast in general, or if its plugged just as a one time thing. pub(crate) fn extensive_trivial_default_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -552,7 +552,7 @@ where pub(crate) fn default_overflowing_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -681,7 +681,7 @@ where /// or extremely extremely fast in general, or if its plugged just as a one time thing. pub(crate) fn extensive_trivial_default_overflowing_add_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_bitwise_op.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_bitwise_op.rs index 14482e958..fa42843f6 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_bitwise_op.rs @@ -25,7 +25,7 @@ create_parameterized_test!(integer_unchecked_bitxor); fn integer_smart_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitand_parallelized); smart_bitand_test(param, executor); @@ -33,7 +33,7 @@ where fn integer_smart_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitor_parallelized); smart_bitor_test(param, executor); @@ -41,7 +41,7 @@ where fn integer_smart_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitxor_parallelized); smart_bitxor_test(param, executor); @@ -49,7 +49,7 @@ where fn integer_default_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitand_parallelized); default_bitand_test(param, executor); @@ -57,7 +57,7 @@ where fn integer_default_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitor_parallelized); default_bitor_test(param, executor); @@ -65,7 +65,7 @@ where fn integer_default_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitxor_parallelized); default_bitxor_test(param, executor); @@ -73,7 +73,7 @@ where fn integer_default_bitnot

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitnot); default_bitnot_test(param, executor); @@ -81,7 +81,7 @@ where fn integer_unchecked_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitand_parallelized); unchecked_bitand_test(param, executor); @@ -89,7 +89,7 @@ where fn integer_unchecked_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitor_parallelized); unchecked_bitor_test(param, executor); @@ -97,7 +97,7 @@ where fn integer_unchecked_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitxor_parallelized); unchecked_bitxor_test(param, executor); @@ -105,7 +105,7 @@ where fn integer_unchecked_bitnot

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::bitnot); unchecked_bitnot_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_rotate.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_rotate.rs index 874ea8e10..fe5565de2 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_rotate.rs @@ -19,7 +19,7 @@ create_parameterized_test!(integer_block_rotate_left); fn integer_block_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::block_rotate_right); default_block_rotate_right_test(param, executor); @@ -27,7 +27,7 @@ where fn integer_block_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::block_rotate_left); default_block_rotate_left_test(param, executor); @@ -35,7 +35,7 @@ where pub(crate) fn default_block_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -131,7 +131,7 @@ where pub(crate) fn default_block_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_shift.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_shift.rs index d814d3299..0f1802cbd 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_block_shift.rs @@ -19,7 +19,7 @@ create_parameterized_test!(integer_block_shift_left); fn integer_block_shift_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::block_shift_right); default_block_shift_right_test(param, executor); @@ -27,7 +27,7 @@ where fn integer_block_shift_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::block_shift_left); default_block_shift_left_test(param, executor); @@ -35,7 +35,7 @@ where pub(crate) fn default_block_shift_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -123,7 +123,7 @@ where pub(crate) fn default_block_shift_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_cmux.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_cmux.rs index f8a8c9cb1..375dde9f9 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_cmux.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_cmux.rs @@ -20,7 +20,7 @@ create_parameterized_test!(integer_default_scalar_if_then_else); fn integer_unchecked_left_scalar_if_then_else

(param: P) where - P: Into, + P: Into, { fn func( sks: &ServerKey, @@ -36,7 +36,7 @@ where fn integer_smart_if_then_else

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_if_then_else_parallelized); smart_if_then_else_test(param, executor); @@ -44,7 +44,7 @@ where fn integer_default_if_then_else

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, cond: &BooleanBlock, lhs: &RadixCiphertext, rhs: &RadixCiphertext| { @@ -56,7 +56,7 @@ where fn integer_default_scalar_if_then_else

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, cond: &BooleanBlock, lhs: u64, rhs: u64, num_blocks: usize| { sks.scalar_if_then_else_parallelized(cond, lhs, rhs, num_blocks) @@ -67,7 +67,7 @@ where pub(crate) fn smart_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< ( &'a mut BooleanBlock, @@ -134,7 +134,7 @@ where pub(crate) fn default_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a BooleanBlock, &'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext, @@ -246,7 +246,7 @@ where pub(crate) fn default_scalar_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a BooleanBlock, u64, u64, usize), RadixCiphertext>, { let param = param.into(); @@ -289,7 +289,7 @@ where pub(crate) fn unchecked_left_scalar_if_then_else_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a BooleanBlock, u64, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); 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 a53232996..6da5159d5 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 @@ -25,7 +25,7 @@ pub(crate) fn test_unchecked_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -86,7 +86,7 @@ pub(crate) fn test_smart_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -173,7 +173,7 @@ pub(crate) fn test_default_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -262,7 +262,7 @@ pub(crate) fn test_default_function( macro_rules! define_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_unchecked_function( @@ -273,7 +273,7 @@ macro_rules! define_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_unchecked_function( @@ -284,7 +284,7 @@ macro_rules! define_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_smart_function( @@ -295,7 +295,7 @@ macro_rules! define_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_smart_function( @@ -306,7 +306,7 @@ macro_rules! define_comparison_test_functions { ) } - fn []

(param: P) where P: Into { + fn []

(param: P) where P: Into { let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[<$comparison_name _parallelized>]); test_default_function( @@ -405,7 +405,7 @@ pub(crate) fn test_unchecked_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -466,7 +466,7 @@ pub(crate) fn test_smart_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -556,7 +556,7 @@ pub(crate) fn test_default_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -636,32 +636,32 @@ pub(crate) fn test_default_minmax( mod no_coverage { use super::*; - fn integer_unchecked_min_parallelized_u256(params: impl Into) { + fn integer_unchecked_min_parallelized_u256(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_min_parallelized); test_unchecked_minmax(params, 2, executor, std::cmp::min::); } - fn integer_unchecked_max_parallelized_u256(params: impl Into) { + fn integer_unchecked_max_parallelized_u256(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_max_parallelized); test_unchecked_minmax(params, 2, executor, std::cmp::max::); } - fn integer_smart_min_parallelized_u256(params: impl Into) { + fn integer_smart_min_parallelized_u256(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::smart_min_parallelized); test_smart_minmax(params, 2, executor, std::cmp::min::); } - fn integer_smart_max_parallelized_u256(params: impl Into) { + fn integer_smart_max_parallelized_u256(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::smart_max_parallelized); test_smart_minmax(params, 2, executor, std::cmp::max::); } - fn integer_min_parallelized_u256(params: impl Into) { + fn integer_min_parallelized_u256(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::min_parallelized); test_default_minmax(params, 2, executor, std::cmp::min::); } - fn integer_max_parallelized_u256(params: impl Into) { + fn integer_max_parallelized_u256(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::max_parallelized); test_default_minmax(params, 2, executor, std::cmp::max::); } @@ -762,7 +762,7 @@ mod coverage { create_parameterized_test!(integer_extensive_trivial_default_comparisons); -fn integer_extensive_trivial_default_comparisons(params: impl Into) { +fn integer_extensive_trivial_default_comparisons(params: impl Into) { let lt_executor = CpuFunctionExecutor::new(&ServerKey::lt_parallelized); let le_executor = CpuFunctionExecutor::new(&ServerKey::le_parallelized); let gt_executor = CpuFunctionExecutor::new(&ServerKey::gt_parallelized); @@ -794,7 +794,7 @@ pub(crate) fn extensive_trivial_default_comparisons_test, + P: Into, E1: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), BooleanBlock>, E2: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), BooleanBlock>, E3: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), BooleanBlock>, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_count_zeros_ones.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_count_zeros_ones.rs index d76b8d893..35ce48354 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_count_zeros_ones.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_count_zeros_ones.rs @@ -15,7 +15,7 @@ create_parameterized_test!(integer_default_count_zeros_ones); fn integer_extensive_trivial_default_count_zeros_ones

(param: P) where - P: Into, + P: Into, { let count_zeros_executor = CpuFunctionExecutor::new(&ServerKey::count_zeros_parallelized); let count_ones_executor = CpuFunctionExecutor::new(&ServerKey::count_ones_parallelized); @@ -28,7 +28,7 @@ where fn integer_default_count_zeros_ones

(param: P) where - P: Into, + P: Into, { let count_zeros_executor = CpuFunctionExecutor::new(&ServerKey::count_zeros_parallelized); let count_ones_executor = CpuFunctionExecutor::new(&ServerKey::count_ones_parallelized); @@ -40,7 +40,7 @@ pub(crate) fn default_count_zeros_ones_test( mut count_zeros_executor: E1, mut count_ones_executor: E2, ) where - P: Into, + P: Into, E1: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, E2: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { @@ -99,7 +99,7 @@ pub(crate) fn extensive_trivial_default_count_zeros_ones_test( mut count_zeros_executor: E1, mut count_ones_executor: E2, ) where - P: Into, + P: Into, E1: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, E2: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { 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 ef6f69325..dc09c4460 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 @@ -135,7 +135,7 @@ create_parameterized_test!( fn integer_smart_div_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_div_rem_parallelized); smart_div_rem_test(param, executor); @@ -143,7 +143,7 @@ where fn integer_smart_div

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_div_parallelized); smart_div_test(param, executor); @@ -151,7 +151,7 @@ where fn integer_smart_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_rem_parallelized); smart_rem_test(param, executor); @@ -159,7 +159,7 @@ where fn integer_default_div_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::div_rem_parallelized); default_div_rem_test(param, executor); @@ -167,7 +167,7 @@ where fn integer_default_div

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::div_parallelized); default_div_test(param, executor); @@ -175,7 +175,7 @@ where fn integer_default_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::rem_parallelized); default_rem_test(param, executor); @@ -183,7 +183,7 @@ where pub(crate) fn default_div_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, RadixCiphertext), @@ -253,7 +253,7 @@ where pub(crate) fn default_div_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -298,7 +298,7 @@ where pub(crate) fn default_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -343,7 +343,7 @@ where pub(crate) fn smart_div_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), (RadixCiphertext, RadixCiphertext), @@ -386,7 +386,7 @@ where pub(crate) fn smart_div_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -426,7 +426,7 @@ where pub(crate) fn smart_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, 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 57823e01e..a4b6e669f 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 @@ -32,7 +32,7 @@ create_parameterized_test!(integer_default_checked_ilog2 { fn integer_default_trailing_zeros

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::trailing_zeros_parallelized); default_trailing_zeros_test(param, executor); @@ -40,7 +40,7 @@ where fn integer_default_trailing_ones

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::trailing_ones_parallelized); default_trailing_ones_test(param, executor); @@ -48,7 +48,7 @@ where fn integer_default_leading_zeros

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::leading_zeros_parallelized); default_leading_zeros_test(param, executor); @@ -56,7 +56,7 @@ where fn integer_default_leading_ones

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::leading_ones_parallelized); default_leading_ones_test(param, executor); @@ -64,7 +64,7 @@ where fn integer_default_ilog2

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::ilog2_parallelized); default_ilog2_test(param, executor); @@ -72,7 +72,7 @@ where fn integer_default_checked_ilog2

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::checked_ilog2_parallelized); default_checked_ilog2_test(param, executor); @@ -84,7 +84,7 @@ pub(crate) fn default_count_consecutive_bits_test( param: P, mut executor: T, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -206,7 +206,7 @@ pub(crate) fn default_count_consecutive_bits_test( pub(crate) fn default_trailing_zeros_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { default_count_consecutive_bits_test(Direction::Trailing, BitValue::Zero, param, executor); @@ -214,7 +214,7 @@ where pub(crate) fn default_trailing_ones_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { default_count_consecutive_bits_test(Direction::Trailing, BitValue::One, param, executor); @@ -222,7 +222,7 @@ where pub(crate) fn default_leading_zeros_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { default_count_consecutive_bits_test(Direction::Leading, BitValue::Zero, param, executor); @@ -230,7 +230,7 @@ where pub(crate) fn default_leading_ones_test(param: P, executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { default_count_consecutive_bits_test(Direction::Leading, BitValue::One, param, executor); @@ -238,7 +238,7 @@ where pub(crate) fn default_ilog2_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -369,7 +369,7 @@ where pub(crate) fn default_checked_ilog2_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, (RadixCiphertext, BooleanBlock)>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_mul.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_mul.rs index d721f1380..78bf3241c 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_mul.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_mul.rs @@ -22,7 +22,7 @@ create_parameterized_test!(integer_unchecked_mul); fn integer_unchecked_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_mul_parallelized); unchecked_mul_test(param, executor); @@ -30,7 +30,7 @@ where fn integer_unchecked_block_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_block_mul_parallelized); unchecked_block_mul_test(param, executor); @@ -38,7 +38,7 @@ where fn integer_unchecked_mul_corner_cases

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_mul_parallelized); unchecked_mul_corner_cases_test(param, executor); @@ -46,7 +46,7 @@ where fn integer_smart_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_mul_parallelized); smart_mul_test(param, executor); @@ -54,7 +54,7 @@ where fn integer_smart_block_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_block_mul_parallelized); smart_block_mul_test(param, executor); @@ -62,7 +62,7 @@ where fn integer_default_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::mul_parallelized); default_mul_test(param, executor); @@ -70,7 +70,7 @@ where fn integer_default_unsigned_overflowing_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_mul_parallelized); default_overflowing_mul_test(param, executor); @@ -78,7 +78,7 @@ where fn integer_default_block_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::block_mul_parallelized); default_default_block_mul_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_neg.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_neg.rs index aa66cd4b2..201727405 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_neg.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_neg.rs @@ -21,7 +21,7 @@ create_parameterized_test!(integer_default_neg); fn integer_smart_neg

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_neg_parallelized); smart_neg_test(param, executor); @@ -29,7 +29,7 @@ where fn integer_default_neg

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::neg_parallelized); default_neg_test(param, executor); @@ -52,7 +52,7 @@ impl ExpectedDegrees { pub(crate) fn unchecked_neg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -112,7 +112,7 @@ where pub(crate) fn smart_neg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a mut RadixCiphertext, RadixCiphertext>, { let param = param.into(); @@ -167,7 +167,7 @@ where pub(crate) fn default_neg_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_rotate.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_rotate.rs index 4bb88bed2..0174000de 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_rotate.rs @@ -23,7 +23,7 @@ create_parameterized_test!(integer_rotate_left); fn integer_unchecked_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_rotate_right_parallelized); unchecked_rotate_right_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_rotate_right

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::rotate_right_parallelized); default_rotate_right_test(param, executor); @@ -39,7 +39,7 @@ where fn integer_unchecked_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_rotate_left_parallelized); unchecked_rotate_left_test(param, executor); @@ -47,7 +47,7 @@ where fn integer_rotate_left

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::rotate_left_parallelized); default_rotate_left_test(param, executor); @@ -55,7 +55,7 @@ where pub(crate) fn unchecked_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -110,7 +110,7 @@ where pub(crate) fn unchecked_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -165,7 +165,7 @@ where pub(crate) fn default_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -237,7 +237,7 @@ where pub(crate) fn default_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_add.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_add.rs index cffa466a1..4be099211 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_add.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_add.rs @@ -15,7 +15,7 @@ create_parameterized_test!(integer_default_overflowing_scalar_add); fn integer_smart_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_add_parallelized); smart_scalar_add_test(param, executor); @@ -23,7 +23,7 @@ where fn integer_default_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_add_parallelized); default_scalar_add_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_default_overflowing_scalar_add

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_scalar_add_parallelized); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_bitwise_op.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_bitwise_op.rs index 03ee872e1..f7a01968d 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_bitwise_op.rs @@ -15,7 +15,7 @@ create_parameterized_test!(integer_default_scalar_bitxor); fn integer_default_scalar_bitand

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitand_parallelized); default_scalar_bitand_test(param, executor); @@ -23,7 +23,7 @@ where fn integer_default_scalar_bitor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitor_parallelized); default_scalar_bitor_test(param, executor); @@ -31,7 +31,7 @@ where fn integer_default_scalar_bitxor

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitxor_parallelized); default_scalar_bitxor_test(param, executor); 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 72dda1d5a..ff322f1dd 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 @@ -25,7 +25,7 @@ pub(crate) fn test_unchecked_scalar_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + DecomposableInto + RecomposableFrom + From, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, Scalar), BooleanBlock>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -70,7 +70,7 @@ pub(crate) fn test_smart_scalar_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -137,7 +137,7 @@ pub(crate) fn test_default_scalar_function( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto @@ -210,7 +210,7 @@ pub(crate) fn test_default_scalar_function( macro_rules! define_scalar_comparison_test_functions { ($comparison_name:ident, $clear_type:ty) => { ::paste::paste!{ - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_unchecked_scalar_function( @@ -221,7 +221,7 @@ macro_rules! define_scalar_comparison_test_functions { ) } - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_smart_scalar_function( @@ -232,7 +232,7 @@ macro_rules! define_scalar_comparison_test_functions { ) } - fn []

(param: P) where P: Into{ + fn []

(param: P) where P: Into{ let num_tests = 1; let executor = CpuFunctionExecutor::new(&ServerKey::[]); test_default_scalar_function( @@ -595,7 +595,7 @@ pub(crate) fn test_unchecked_scalar_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + DecomposableInto + RecomposableFrom, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, Scalar), RadixCiphertext>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -640,7 +640,7 @@ pub(crate) fn test_smart_scalar_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto + RecomposableFrom, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, Scalar), RadixCiphertext>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -703,7 +703,7 @@ pub(crate) fn test_default_scalar_minmax( mut executor: T, clear_fn: ClearF, ) where - P: Into, + P: Into, Scalar: UnsignedNumeric + AddAssign + DecomposableInto + RecomposableFrom, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, Scalar), RadixCiphertext>, ClearF: Fn(Scalar, Scalar) -> Scalar, @@ -942,7 +942,7 @@ mod coverage { create_parameterized_test!(integer_extensive_trivial_default_scalar_comparisons); -fn integer_extensive_trivial_default_scalar_comparisons(params: impl Into) { +fn integer_extensive_trivial_default_scalar_comparisons(params: impl Into) { let lt_executor = CpuFunctionExecutor::new(&ServerKey::scalar_lt_parallelized); let le_executor = CpuFunctionExecutor::new(&ServerKey::scalar_le_parallelized); let gt_executor = CpuFunctionExecutor::new(&ServerKey::scalar_gt_parallelized); @@ -974,7 +974,7 @@ pub(crate) fn extensive_trivial_default_scalar_comparisons_test, + P: Into, E1: for<'a> FunctionExecutor<(&'a RadixCiphertext, u128), BooleanBlock>, E2: for<'a> FunctionExecutor<(&'a RadixCiphertext, u128), BooleanBlock>, E3: for<'a> FunctionExecutor<(&'a RadixCiphertext, u128), BooleanBlock>, diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_div_mod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_div_mod.rs index 061f6230e..7cfd629cd 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_div_mod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_div_mod.rs @@ -17,7 +17,7 @@ create_parameterized_test!(integer_default_scalar_div_rem); fn integer_default_scalar_div_rem

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_div_rem_parallelized); default_scalar_div_rem_test(param, executor); @@ -25,7 +25,7 @@ where pub(crate) fn default_scalar_div_rem_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), (RadixCiphertext, RadixCiphertext)> + std::panic::UnwindSafe, { diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_dot_prod.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_dot_prod.rs index 8c913c454..a35762f43 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_dot_prod.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_dot_prod.rs @@ -7,7 +7,7 @@ use crate::integer::server_key::radix_parallel::tests_unsigned::{ }; use crate::integer::tests::create_parameterized_test; use crate::integer::{BooleanBlock, IntegerKeyKind, RadixCiphertext, RadixClientKey, ServerKey}; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::TestParameters; use rand::{thread_rng, Rng}; use std::sync::Arc; @@ -20,18 +20,18 @@ create_parameterized_test!(unchecked_boolean_scalar_dot_prod); create_parameterized_test!(smart_boolean_scalar_dot_prod); create_parameterized_test!(boolean_scalar_dot_prod); -fn unchecked_boolean_scalar_dot_prod(params: impl Into) { +fn unchecked_boolean_scalar_dot_prod(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_boolean_scalar_dot_prod_parallelized); unchecked_boolean_scalar_dot_prod_test_case(params, executor); } -fn smart_boolean_scalar_dot_prod(params: impl Into) { +fn smart_boolean_scalar_dot_prod(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::smart_boolean_scalar_dot_prod_parallelized); smart_boolean_scalar_dot_prod_test_case(params, executor); } -fn boolean_scalar_dot_prod(params: impl Into) { +fn boolean_scalar_dot_prod(params: impl Into) { let executor = CpuFunctionExecutor::new(&ServerKey::boolean_scalar_dot_prod_parallelized); default_boolean_scalar_dot_prod_test_case(params, executor); } @@ -46,7 +46,7 @@ fn boolean_dot_prod(bs: &[bool], cs: &[u64], modulus: u64) -> u64 { pub(crate) fn unchecked_boolean_scalar_dot_prod_test_case(params: P, mut dot_prod_executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [BooleanBlock], &'a [u64], u32), RadixCiphertext>, { let params = params.into(); @@ -100,7 +100,7 @@ where pub(crate) fn smart_boolean_scalar_dot_prod_test_case(params: P, mut dot_prod_executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a mut [BooleanBlock], &'a [u64], u32), RadixCiphertext>, { let params = params.into(); @@ -168,7 +168,7 @@ where pub(crate) fn default_boolean_scalar_dot_prod_test_case(params: P, mut dot_prod_executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [BooleanBlock], &'a [u64], u32), RadixCiphertext>, { let params = params.into(); 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 7c52a4b78..edf174bb9 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 @@ -37,7 +37,7 @@ create_parameterized_test!(integer_default_scalar_mul); fn integer_unchecked_scalar_mul_corner_cases

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_mul_parallelized); unchecked_scalar_mul_corner_cases_test(param, executor); @@ -45,7 +45,7 @@ where fn integer_smart_scalar_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_mul_parallelized); smart_scalar_mul_test(param, executor); @@ -53,7 +53,7 @@ where fn integer_smart_scalar_mul_u128_fix_non_reg_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_mul_parallelized); smart_scalar_mul_u128_fix_non_reg_test(param, executor); @@ -61,7 +61,7 @@ where fn integer_default_scalar_mul_u128_fix_non_reg_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_mul_parallelized); default_scalar_mul_u128_fix_non_reg_test(param, executor); @@ -69,7 +69,7 @@ where fn integer_default_scalar_mul

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_mul_parallelized); default_scalar_mul_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_rotate.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_rotate.rs index c0a86bf05..397b20367 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_rotate.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_rotate.rs @@ -19,7 +19,7 @@ create_parameterized_test!(integer_default_scalar_rotate_right); fn integer_default_scalar_rotate_left

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_rotate_left_parallelized); default_scalar_rotate_left_test(param, executor); @@ -27,7 +27,7 @@ where fn integer_unchecked_scalar_rotate_left

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_rotate_left_parallelized); unchecked_scalar_rotate_left_test(param, executor); @@ -35,7 +35,7 @@ where fn integer_default_scalar_rotate_right

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_rotate_right_parallelized); default_scalar_rotate_right_test(param, executor); @@ -43,7 +43,7 @@ where fn integer_unchecked_scalar_rotate_right

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_rotate_right_parallelized); unchecked_scalar_rotate_right_test(param, executor); @@ -51,7 +51,7 @@ where pub(crate) fn unchecked_scalar_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -117,7 +117,7 @@ where pub(crate) fn unchecked_scalar_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -183,7 +183,7 @@ where pub(crate) fn default_scalar_rotate_right_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); @@ -257,7 +257,7 @@ where pub(crate) fn default_scalar_rotate_left_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_shift.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_shift.rs index bab3e09fd..6bf755cbb 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_shift.rs @@ -17,7 +17,7 @@ create_parameterized_test!(integer_default_scalar_right_shift); fn integer_default_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_left_shift_parallelized); default_scalar_left_shift_test(param, executor); @@ -25,7 +25,7 @@ where fn integer_unchecked_scalar_left_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_left_shift_parallelized); unchecked_scalar_left_shift_test(param, executor); @@ -33,7 +33,7 @@ where fn integer_default_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_right_shift_parallelized); default_scalar_right_shift_test(param, executor); @@ -41,7 +41,7 @@ where fn integer_unchecked_scalar_right_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_right_shift_parallelized); unchecked_scalar_right_shift_test(param, executor); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_sub.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_sub.rs index 9c0e12e9c..302d9fbd8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_sub.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_scalar_sub.rs @@ -27,7 +27,7 @@ create_parameterized_test!(integer_default_overflowing_scalar_sub); fn integer_smart_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_sub_parallelized); smart_scalar_sub_test(param, executor); @@ -35,7 +35,7 @@ where fn integer_default_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_sub_parallelized); default_scalar_sub_test(param, executor); @@ -43,7 +43,7 @@ where fn integer_unchecked_left_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_left_scalar_sub); unchecked_left_scalar_sub_test(param, executor); @@ -51,7 +51,7 @@ where fn integer_smart_left_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_left_scalar_sub_parallelized); smart_left_scalar_sub_test(param, executor); @@ -59,7 +59,7 @@ where fn integer_default_left_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::left_scalar_sub_parallelized); default_left_scalar_sub_test(param, executor); @@ -67,7 +67,7 @@ where fn integer_default_overflowing_scalar_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_scalar_sub_parallelized); @@ -76,7 +76,7 @@ where pub(crate) fn unchecked_left_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(u64, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -123,7 +123,7 @@ where pub(crate) fn smart_left_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(u64, &'a mut RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -167,7 +167,7 @@ where pub(crate) fn default_left_scalar_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(u64, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_shift.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_shift.rs index bd12c7f68..d4c5f5352 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_shift.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_shift.rs @@ -19,7 +19,7 @@ create_parameterized_test!(integer_right_shift); fn integer_unchecked_left_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_left_shift_parallelized); unchecked_left_shift_test(param, executor); @@ -27,7 +27,7 @@ where fn integer_unchecked_right_shift

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_right_shift_parallelized); unchecked_right_shift_test(param, executor); @@ -35,7 +35,7 @@ where fn integer_right_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::right_shift_parallelized); default_right_shift_test(param, executor); @@ -43,7 +43,7 @@ where fn integer_left_shift

(param: P) where - P: Into + Copy, + P: Into + Copy, { let executor = CpuFunctionExecutor::new(&ServerKey::left_shift_parallelized); default_left_shift_test(param, executor); @@ -51,7 +51,7 @@ where pub(crate) fn unchecked_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -110,7 +110,7 @@ where pub(crate) fn unchecked_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -168,7 +168,7 @@ where pub(crate) fn default_left_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -249,7 +249,7 @@ where pub(crate) fn default_right_shift_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_slice.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_slice.rs index bcc8c0da0..455a520f8 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_slice.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_slice.rs @@ -17,7 +17,7 @@ use crate::shortint::parameters::coverage_parameters::*; use crate::shortint::parameters::test_params::*; use crate::shortint::parameters::*; -use super::{nb_tests_for_params, CpuFunctionExecutor, FunctionExecutor, PBSParameters, NB_CTXT}; +use super::{nb_tests_for_params, CpuFunctionExecutor, FunctionExecutor, NB_CTXT}; create_parameterized_test!(integer_unchecked_scalar_slice); create_parameterized_test!(integer_unchecked_scalar_slice_assign); @@ -46,7 +46,7 @@ where pub(crate) fn scalar_blockslice_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, Range), Result, @@ -93,7 +93,7 @@ where pub(crate) fn scalar_blockslice_assign_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, usize, usize), ()>, { let param = param.into(); @@ -137,7 +137,7 @@ where pub(crate) fn unchecked_scalar_bitslice_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, Range), Result, @@ -181,7 +181,7 @@ where pub(crate) fn unchecked_scalar_bitslice_assign_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, Range), Result<(), InvalidRangeError>, @@ -225,7 +225,7 @@ where pub(crate) fn default_scalar_bitslice_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, Range), Result, @@ -275,7 +275,7 @@ where pub(crate) fn default_scalar_bitslice_assign_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, Range), Result<(), InvalidRangeError>, @@ -325,7 +325,7 @@ where pub(crate) fn smart_scalar_bitslice_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, Range), Result, @@ -375,7 +375,7 @@ where pub(crate) fn smart_scalar_bitslice_assign_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, Range), Result<(), InvalidRangeError>, @@ -425,7 +425,7 @@ where fn integer_unchecked_scalar_slice

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_bitslice_parallelized); unchecked_scalar_bitslice_test(param, executor); @@ -433,7 +433,7 @@ where fn integer_unchecked_scalar_slice_assign

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_bitslice_assign_parallelized); @@ -442,7 +442,7 @@ where fn integer_default_scalar_slice

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitslice_parallelized); default_scalar_bitslice_test(param, executor); @@ -450,7 +450,7 @@ where fn integer_default_scalar_slice_assign

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitslice_assign_parallelized); default_scalar_bitslice_assign_test(param, executor); @@ -458,7 +458,7 @@ where fn integer_smart_scalar_slice

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_bitslice_parallelized); smart_scalar_bitslice_test(param, executor); @@ -466,7 +466,7 @@ where fn integer_smart_scalar_slice_assign

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_bitslice_assign_parallelized); smart_scalar_bitslice_assign_test(param, executor); 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 3b1601d06..db2dd1b48 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 @@ -44,7 +44,7 @@ create_parameterized_test!(integer_advanced_sub_assign_with_borrow_sequential); fn integer_unchecked_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_sub); unchecked_sub_test(param, executor); @@ -52,7 +52,7 @@ where fn integer_smart_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::smart_sub_parallelized); smart_sub_test(param, executor); @@ -60,7 +60,7 @@ where fn integer_default_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::sub_parallelized); default_sub_test(param, executor); @@ -68,7 +68,7 @@ where fn integer_extensive_trivial_default_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::sub_parallelized); extensive_trivial_default_sub_test(param, executor); @@ -76,7 +76,7 @@ where fn integer_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_sub_parallelized); default_overflowing_sub_test(param, executor); @@ -84,7 +84,7 @@ where fn integer_extensive_trivial_default_overflowing_sub

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_sub_parallelized); extensive_trivial_default_overflowing_sub_test(param, executor); @@ -92,7 +92,7 @@ where fn integer_advanced_sub_assign_with_borrow_at_least_4_bits

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &RadixCiphertext, rhs: &RadixCiphertext| { let mut result = lhs.clone(); @@ -123,7 +123,7 @@ where fn integer_advanced_sub_assign_with_borrow_sequential

(param: P) where - P: Into, + P: Into, { let func = |sks: &ServerKey, lhs: &RadixCiphertext, rhs: &RadixCiphertext| { let mut result = lhs.clone(); @@ -183,7 +183,7 @@ impl ExpectedNoiseLevels { pub(crate) fn unchecked_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -250,7 +250,7 @@ where pub(crate) fn smart_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a mut RadixCiphertext, &'a mut RadixCiphertext), RadixCiphertext, @@ -300,7 +300,7 @@ where pub(crate) fn default_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -351,7 +351,7 @@ where /// or extremely extremely fast in general, or if its plugged just as a one time thing. pub(crate) fn extensive_trivial_default_sub_test(param: P, mut sub_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>, { let param = param.into(); @@ -397,7 +397,7 @@ where pub(crate) fn default_overflowing_sub_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -537,7 +537,7 @@ pub(crate) fn extensive_trivial_default_overflowing_sub_test( param: P, mut overflowing_sub_executor: T, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sum.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sum.rs index 80425c4df..7f6dfe4e5 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sum.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_sum.rs @@ -18,14 +18,14 @@ create_parameterized_test!(integer_default_sum_ciphertexts_vec); fn integer_default_unsigned_overflowing_sum_ciphertexts_vec

(param: P) where - P: Into, + P: Into, { integer_default_unsigned_overflowing_sum_ciphertexts_test(param); } fn integer_default_sum_ciphertexts_vec

(param: P) where - P: Into, + P: Into, { // Without this the compiler seems lost, and outputs errors about // 'one type is more general than the other' probably because the @@ -39,7 +39,7 @@ where pub(crate) fn integer_default_unsigned_overflowing_sum_ciphertexts_test

(param: P) where - P: Into, + P: Into, { let param = param.into(); let nb_tests_smaller = nb_tests_smaller_for_params(param); @@ -139,7 +139,7 @@ where pub(crate) fn default_sum_ciphertexts_vec_test(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a Vec, Option>, { let param = param.into(); @@ -185,7 +185,7 @@ where fn integer_smart_sum_ciphertexts_slice

(param: P) where - P: Into, + P: Into, { let param = param.into(); let nb_tests_smaller = nb_tests_smaller_for_params(param); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_comparisons.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_comparisons.rs index e68722314..6478d71ac 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_comparisons.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_comparisons.rs @@ -25,7 +25,7 @@ create_parameterized_test!(integer_unchecked_contains_slice_test_case); fn integer_unchecked_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_all_eq_slices_parallelized); unchecked_all_eq_slices_test_case(param, executor); @@ -33,7 +33,7 @@ where fn integer_default_all_eq_slices_test_case

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::all_eq_slices_parallelized); default_all_eq_slices_test_case(param, executor); @@ -41,7 +41,7 @@ where fn integer_unchecked_contains_slice_test_case

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_contains_sub_slice_parallelized); unchecked_slice_contains_test_case(param, executor); @@ -116,7 +116,7 @@ pub(crate) fn unchecked_all_eq_slices_test_case_impl( pub(crate) fn unchecked_all_eq_slices_test_case(params: P, mut executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [RadixCiphertext], &'a [RadixCiphertext]), BooleanBlock>, { let (cks, sks) = KEY_CACHE.get_from_params(params, IntegerKeyKind::Radix); @@ -223,7 +223,7 @@ pub(crate) fn default_all_eq_slices_test_case_impl( pub(crate) fn default_all_eq_slices_test_case(params: P, mut executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [RadixCiphertext], &'a [RadixCiphertext]), BooleanBlock>, { let (cks, mut sks) = KEY_CACHE.get_from_params(params, IntegerKeyKind::Radix); @@ -242,7 +242,7 @@ where pub(crate) fn unchecked_slice_contains_test_case(params: P, mut executor: E) where - P: Into, + P: Into, E: for<'a> FunctionExecutor<(&'a [RadixCiphertext], &'a [RadixCiphertext]), BooleanBlock>, { let (cks, mut sks) = KEY_CACHE.get_from_params(params, IntegerKeyKind::Radix); diff --git a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_find.rs b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_find.rs index 68a09fdb5..c26418afd 100644 --- a/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_find.rs +++ b/tfhe/src/integer/server_key/radix_parallel/tests_unsigned/test_vector_find.rs @@ -44,7 +44,7 @@ create_parameterized_test!(integer_default_first_index_of_clear); fn integer_unchecked_match_value

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_match_value_parallelized); unchecked_match_value_test_case(param, executor); @@ -52,7 +52,7 @@ where fn integer_unchecked_match_value_or

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_match_value_or_parallelized); unchecked_match_value_or_test_case(param, executor); @@ -60,7 +60,7 @@ where fn integer_unchecked_contains

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_contains_parallelized); unchecked_contains_test_case(param, executor); @@ -68,7 +68,7 @@ where fn integer_unchecked_contains_clear

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_contains_clear_parallelized); unchecked_contains_clear_test_case(param, executor); @@ -76,7 +76,7 @@ where fn integer_unchecked_is_in_clears

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_is_in_clears_parallelized); unchecked_is_in_clears_test_case(param, executor); @@ -84,7 +84,7 @@ where fn integer_unchecked_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_index_in_clears_parallelized); unchecked_index_in_clears_test_case(param, executor); @@ -92,7 +92,7 @@ where fn integer_unchecked_first_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_first_index_in_clears_parallelized); @@ -101,7 +101,7 @@ where fn integer_unchecked_index_of

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_index_of_parallelized); unchecked_index_of_test_case(param, executor); @@ -109,7 +109,7 @@ where fn integer_unchecked_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_index_of_clear_parallelized); unchecked_index_of_clear_test_case(param, executor); @@ -117,7 +117,7 @@ where fn integer_unchecked_first_index_of

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_first_index_of_parallelized); unchecked_first_index_of_test_case(param, executor); @@ -125,7 +125,7 @@ where fn integer_unchecked_first_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_first_index_of_clear_parallelized); @@ -136,7 +136,7 @@ where fn integer_default_match_value

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::match_value_parallelized); default_match_value_test_case(param, executor); @@ -144,7 +144,7 @@ where fn integer_default_match_value_or

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::match_value_or_parallelized); default_match_value_or_test_case(param, executor); @@ -152,7 +152,7 @@ where fn integer_default_contains

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::contains_parallelized); default_contains_test_case(param, executor); @@ -160,7 +160,7 @@ where fn integer_default_contains_clear

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::contains_clear_parallelized); default_contains_clear_test_case(param, executor); @@ -168,7 +168,7 @@ where fn integer_default_is_in_clears

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::is_in_clears_parallelized); default_is_in_clears_test_case(param, executor); @@ -176,7 +176,7 @@ where fn integer_default_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::index_in_clears_parallelized); default_index_in_clears_test_case(param, executor); @@ -184,7 +184,7 @@ where fn integer_default_first_index_in_clears

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::first_index_in_clears_parallelized); default_first_index_in_clears_test_case(param, executor); @@ -192,7 +192,7 @@ where fn integer_default_index_of

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::index_of_parallelized); default_index_of_test_case(param, executor); @@ -200,7 +200,7 @@ where fn integer_default_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::index_of_clear_parallelized); default_index_of_clear_test_case(param, executor); @@ -208,7 +208,7 @@ where fn integer_default_first_index_of

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::first_index_of_parallelized); default_first_index_of_test_case(param, executor); @@ -216,7 +216,7 @@ where fn integer_default_first_index_of_clear

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&ServerKey::first_index_of_clear_parallelized); default_first_index_of_clear_test_case(param, executor); @@ -356,7 +356,7 @@ fn draw_unique_randoms( pub(crate) fn unchecked_match_value_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a MatchValues), (RadixCiphertext, BooleanBlock), @@ -471,7 +471,7 @@ where pub(crate) fn default_match_value_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a RadixCiphertext, &'a MatchValues), (RadixCiphertext, BooleanBlock), @@ -546,7 +546,7 @@ where pub(crate) fn unchecked_match_value_or_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a MatchValues, u64), RadixCiphertext>, { let param = param.into(); @@ -651,7 +651,7 @@ where pub(crate) fn default_match_value_or_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a MatchValues, u64), RadixCiphertext>, { let param = param.into(); @@ -716,7 +716,7 @@ where pub(crate) fn unchecked_contains_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], &'a RadixCiphertext), BooleanBlock>, { let param = param.into(); @@ -786,7 +786,7 @@ where pub(crate) fn default_contains_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], &'a RadixCiphertext), BooleanBlock>, { let param = param.into(); @@ -854,7 +854,7 @@ where pub(crate) fn unchecked_contains_clear_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], u64), BooleanBlock>, { let param = param.into(); @@ -917,7 +917,7 @@ where pub(crate) fn default_contains_clear_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], u64), BooleanBlock>, { let param = param.into(); @@ -981,7 +981,7 @@ where pub(crate) fn unchecked_is_in_clears_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a [u64]), BooleanBlock>, { let param = param.into(); @@ -1038,7 +1038,7 @@ where pub(crate) fn default_is_in_clears_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a [u64]), BooleanBlock>, { let param = param.into(); @@ -1096,7 +1096,7 @@ where pub(crate) fn unchecked_index_in_clears_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a [u64]), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1161,7 +1161,7 @@ where pub(crate) fn default_index_in_clears_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a [u64]), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1226,7 +1226,7 @@ where pub(crate) fn unchecked_first_index_in_clears_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a [u64]), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1291,7 +1291,7 @@ where pub(crate) fn default_first_index_in_clears_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a [u64]), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1355,7 +1355,7 @@ where pub(crate) fn unchecked_index_of_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a [RadixCiphertext], &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -1429,7 +1429,7 @@ where pub(crate) fn default_index_of_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a [RadixCiphertext], &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -1504,7 +1504,7 @@ where pub(crate) fn unchecked_index_of_clear_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], u64), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1573,7 +1573,7 @@ where pub(crate) fn default_index_of_clear_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], u64), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1639,7 +1639,7 @@ where pub(crate) fn unchecked_first_index_of_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a [RadixCiphertext], &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -1718,7 +1718,7 @@ where pub(crate) fn default_first_index_of_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a [RadixCiphertext], &'a RadixCiphertext), (RadixCiphertext, BooleanBlock), @@ -1802,7 +1802,7 @@ where pub(crate) fn unchecked_first_index_of_clear_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], u64), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); @@ -1876,7 +1876,7 @@ where pub(crate) fn default_first_index_of_clear_test_case(param: P, mut executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a [RadixCiphertext], u64), (RadixCiphertext, BooleanBlock)>, { let param = param.into(); diff --git a/tfhe/src/shortint/keycache.rs b/tfhe/src/shortint/keycache.rs index 524f6f9cf..d078635ba 100644 --- a/tfhe/src/shortint/keycache.rs +++ b/tfhe/src/shortint/keycache.rs @@ -11,6 +11,8 @@ use crate::shortint::wopbs::WopbsKey; use crate::shortint::{ClientKey, KeySwitchingKey, ServerKey}; use serde::{Deserialize, Serialize}; +use super::atomic_pattern::AtomicPatternParameters; + named_params_impl!( ShortintParameterSet => V1_1_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128, V1_1_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128, @@ -315,6 +317,8 @@ named_params_impl!( ShortintParameterSet => V1_1_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128, V1_1_PARAM_MESSAGE_3_CARRY_3_KS_PBS_TUNIFORM_2M128, V1_1_PARAM_MESSAGE_4_CARRY_4_KS_PBS_TUNIFORM_2M128, + // KS32 AP with TUniform + V1_1_PARAM_MESSAGE_2_CARRY_2_KS32_PBS_TUNIFORM_2M128, // Wopbs LEGACY_WOPBS_PARAM_MESSAGE_1_CARRY_0_KS_PBS, LEGACY_WOPBS_PARAM_MESSAGE_1_CARRY_1_KS_PBS, @@ -428,6 +432,12 @@ impl NamedParam for WopbsParameters { } } +impl NamedParam for AtomicPatternParameters { + fn name(&self) -> String { + ShortintParameterSet::from(*self).name() + } +} + named_params_impl!(ShortintKeySwitchingParameters => V1_1_PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS_GAUSSIAN_2M128, ; fallback => ks_params_default_name @@ -468,8 +478,8 @@ named_params_impl!( NoiseSquashingParameters => V1_1_NOISE_SQUASHING_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128, ); -impl From for (ClientKey, ServerKey) { - fn from(param: PBSParameters) -> Self { +impl From for (ClientKey, ServerKey) { + fn from(param: AtomicPatternParameters) -> Self { let param_set = ShortintParameterSet::from(param); param_set.into() } @@ -484,7 +494,7 @@ impl From for (ClientKey, ServerKey) { } pub struct Keycache { - inner: ImplKeyCache, + inner: ImplKeyCache, } impl Default for Keycache { @@ -554,7 +564,7 @@ impl SharedKeySwitchingKey { impl Keycache { pub fn get_from_param

(&self, param: P) -> SharedKey where - P: Into, + P: Into, { SharedKey { inner: self.inner.get(param.into()), diff --git a/tfhe/src/shortint/parameters/mod.rs b/tfhe/src/shortint/parameters/mod.rs index f56a99f21..0df285d23 100644 --- a/tfhe/src/shortint/parameters/mod.rs +++ b/tfhe/src/shortint/parameters/mod.rs @@ -68,6 +68,8 @@ pub use ks32::KeySwitch32PBSParameters; pub use multi_bit::MultiBitPBSParameters; pub use noise_squashing::NoiseSquashingParameters; pub use parameters_wopbs::*; +#[cfg(test)] +pub use test_params::TestParameters; /// The modulus of the message space. For a given plaintext $p$ we have the message $m$ defined as /// $m = p\bmod{MessageModulus}$ and so $0 <= m < MessageModulus$. @@ -588,16 +590,11 @@ impl ShortintParameterSet { impl

From

for ShortintParameterSet where - P: Into, + P: Into, { fn from(value: P) -> Self { - Self::new_pbs_param_set(value.into()) - } -} - -impl From for ShortintParameterSet { - fn from(value: AtomicPatternParameters) -> Self { - match value { + let ap_params: AtomicPatternParameters = value.into(); + match ap_params { AtomicPatternParameters::Standard(parameters) => Self::new_pbs_param_set(parameters), AtomicPatternParameters::KeySwitch32(parameters) => { Self::new_ks32_pbs_param_set(parameters) diff --git a/tfhe/src/shortint/parameters/test_params.rs b/tfhe/src/shortint/parameters/test_params.rs index 3df0ed686..164adfacd 100644 --- a/tfhe/src/shortint/parameters/test_params.rs +++ b/tfhe/src/shortint/parameters/test_params.rs @@ -1,10 +1,14 @@ use super::current_params::*; +use super::AtomicPatternParameters; use super::{ ClassicPBSParameters, CompactPublicKeyEncryptionParameters, CompressionParameters, MultiBitPBSParameters, ShortintKeySwitchingParameters, }; +/// Alias for the type of parameters used by tests +pub type TestParameters = AtomicPatternParameters; + // Classic // CPK Gaussian pub const TEST_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128: ClassicPBSParameters = diff --git a/tfhe/src/shortint/server_key/tests/modulus_switch_compression.rs b/tfhe/src/shortint/server_key/tests/modulus_switch_compression.rs index 3b1648d25..d697f0bb7 100644 --- a/tfhe/src/shortint/server_key/tests/modulus_switch_compression.rs +++ b/tfhe/src/shortint/server_key/tests/modulus_switch_compression.rs @@ -1,7 +1,7 @@ use super::NB_TESTS; use crate::shortint::keycache::KEY_CACHE; use crate::shortint::parameters::test_params::*; -use crate::shortint::parameters::{NoiseLevel, PBSParameters}; +use crate::shortint::parameters::NoiseLevel; use crate::shortint::server_key::tests::parameterized_test::create_parameterized_test; use rand::Rng; @@ -9,7 +9,7 @@ create_parameterized_test!(shortint_modulus_switch_compression); fn shortint_modulus_switch_compression

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); diff --git a/tfhe/src/shortint/server_key/tests/parameterized_test.rs b/tfhe/src/shortint/server_key/tests/parameterized_test.rs index 095d9a064..0e21e2152 100644 --- a/tfhe/src/shortint/server_key/tests/parameterized_test.rs +++ b/tfhe/src/shortint/server_key/tests/parameterized_test.rs @@ -174,7 +174,7 @@ fn test_shortint_keyswitch_programmable_bootstrap_many_lut_pbs_ks_ci_run_filter( fn shortint_encrypt_decrypt

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let cks = keys.client_key(); @@ -196,7 +196,7 @@ where fn shortint_encrypt_with_message_modulus_decrypt

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let cks = keys.client_key(); @@ -221,7 +221,7 @@ where fn shortint_encrypt_decrypt_without_padding

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let cks = keys.client_key(); @@ -244,7 +244,7 @@ where fn shortint_keyswitch_bootstrap

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -274,7 +274,7 @@ where fn shortint_keyswitch_programmable_bootstrap

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -300,7 +300,7 @@ where fn shortint_keyswitch_programmable_bootstrap_many_lut

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -386,7 +386,7 @@ where fn shortint_carry_extract

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -416,7 +416,7 @@ where fn shortint_message_extract

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -442,7 +442,7 @@ where fn shortint_generate_lookup_table

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -468,7 +468,7 @@ where fn shortint_unchecked_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -500,7 +500,7 @@ where fn shortint_smart_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -535,7 +535,7 @@ where fn shortint_default_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -564,7 +564,7 @@ where fn shortint_compressed_public_key_smart_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -599,7 +599,7 @@ where fn shortint_public_key_smart_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -634,7 +634,7 @@ where fn shortint_unchecked_scalar_bitxor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -662,7 +662,7 @@ where fn shortint_unchecked_scalar_bitor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -690,7 +690,7 @@ where fn shortint_unchecked_scalar_bitand

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -719,7 +719,7 @@ where fn shortint_smart_scalar_bitand

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -750,7 +750,7 @@ where fn shortint_default_scalar_bitand

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -780,7 +780,7 @@ where fn shortint_smart_scalar_bitor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -811,7 +811,7 @@ where fn shortint_default_scalar_bitor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -841,7 +841,7 @@ where fn shortint_smart_scalar_bitxor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -872,7 +872,7 @@ where fn shortint_default_scalar_bitxor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -902,7 +902,7 @@ where fn shortint_smart_mul_lsb

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -941,7 +941,7 @@ where fn shortint_default_mul_lsb

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -971,7 +971,7 @@ where fn shortint_unchecked_neg

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -997,7 +997,7 @@ where fn shortint_smart_neg

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1029,7 +1029,7 @@ where fn shortint_default_neg

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1055,7 +1055,7 @@ where fn shortint_unchecked_scalar_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1081,7 +1081,7 @@ where fn shortint_smart_scalar_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1114,7 +1114,7 @@ where fn shortint_default_scalar_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1142,7 +1142,7 @@ where fn shortint_unchecked_scalar_sub

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1168,7 +1168,7 @@ where fn shortint_smart_scalar_sub

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1201,7 +1201,7 @@ where fn shortint_default_scalar_sub

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1229,7 +1229,7 @@ where fn shortint_unchecked_scalar_mul

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1256,7 +1256,7 @@ where fn shortint_smart_scalar_mul

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1290,7 +1290,7 @@ where fn shortint_default_scalar_mul

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1320,7 +1320,7 @@ where fn shortint_unchecked_right_shift

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1345,7 +1345,7 @@ where fn shortint_default_right_shift

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1370,7 +1370,7 @@ where fn shortint_unchecked_left_shift

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1395,7 +1395,7 @@ where fn shortint_default_left_shift

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1420,7 +1420,7 @@ where fn shortint_unchecked_sub

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1446,7 +1446,7 @@ where fn shortint_smart_sub

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1478,7 +1478,7 @@ where fn shortint_default_sub

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1506,7 +1506,7 @@ where fn shortint_mul_small_carry

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1534,7 +1534,7 @@ where fn shortint_encrypt_with_message_modulus_unchecked_mul_lsb_small_carry_and_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1567,7 +1567,7 @@ where fn shortint_encrypt_with_message_and_carry_modulus_unchecked_mul_lsb_small_carry_and_add

( param: P, ) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1615,7 +1615,7 @@ fn shortint_encrypt_with_message_and_carry_modulus_unchecked_mul_lsb_small_carry fn shortint_mux

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1644,7 +1644,7 @@ where fn shortint_trivial_pbs

(param: P) where - P: Into, + P: Into, { let param = param.into(); let full_modulus = param.message_modulus().0 * param.carry_modulus().0; @@ -1706,7 +1706,7 @@ where fn shortint_trivial_pbs_many_lut

(param: P) where - P: Into, + P: Into, { let param = param.into(); let msg_modulus = param.message_modulus().0; 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 65115a9e5..216d4484c 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 @@ -1,6 +1,5 @@ use crate::shortint::keycache::KEY_CACHE; use crate::shortint::parameters::test_params::*; -use crate::shortint::parameters::PBSParameters; use crate::shortint::server_key::tests::parameterized_test::create_parameterized_test; use rand::Rng; @@ -158,7 +157,7 @@ create_parameterized_test_bivariate_pbs_compliant!(shortint_unchecked_less_or_eq fn shortint_keyswitch_bivariate_programmable_bootstrap

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -186,7 +185,7 @@ where fn shortint_compressed_public_key_smart_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -222,7 +221,7 @@ where fn shortint_public_key_smart_add

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -258,7 +257,7 @@ where fn shortint_unchecked_bitand

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -285,7 +284,7 @@ where fn shortint_unchecked_bitor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -313,7 +312,7 @@ where fn shortint_unchecked_bitxor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -341,7 +340,7 @@ where fn shortint_smart_bitand

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -376,7 +375,7 @@ where fn shortint_default_bitand

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -411,7 +410,7 @@ where fn shortint_smart_bitor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -446,7 +445,7 @@ where fn shortint_default_bitor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -481,7 +480,7 @@ where fn shortint_smart_bitxor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -516,7 +515,7 @@ where fn shortint_default_bitxor

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -551,7 +550,7 @@ where fn shortint_unchecked_greater

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -578,7 +577,7 @@ where fn shortint_smart_greater

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -605,7 +604,7 @@ where fn shortint_default_greater

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -632,7 +631,7 @@ where fn shortint_unchecked_greater_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -659,7 +658,7 @@ where fn shortint_smart_greater_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -694,7 +693,7 @@ where fn shortint_default_greater_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -729,7 +728,7 @@ where fn shortint_unchecked_less

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -756,7 +755,7 @@ where fn shortint_smart_less

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -791,7 +790,7 @@ where fn shortint_default_less

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -826,7 +825,7 @@ where fn shortint_unchecked_less_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -853,7 +852,7 @@ where fn shortint_unchecked_less_or_equal_trivial

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -880,7 +879,7 @@ where fn shortint_smart_less_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -915,7 +914,7 @@ where fn shortint_default_less_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -950,7 +949,7 @@ where fn shortint_unchecked_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -977,7 +976,7 @@ where fn shortint_smart_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1012,7 +1011,7 @@ where fn shortint_default_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1047,7 +1046,7 @@ where fn shortint_smart_scalar_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1074,7 +1073,7 @@ where fn shortint_smart_scalar_less

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1101,7 +1100,7 @@ where fn shortint_smart_scalar_less_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1128,7 +1127,7 @@ where fn shortint_smart_scalar_greater

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1155,7 +1154,7 @@ where fn shortint_smart_scalar_greater_or_equal

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1182,7 +1181,7 @@ where fn shortint_unchecked_div

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1221,7 +1220,7 @@ where fn shortint_unchecked_scalar_div

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1246,7 +1245,7 @@ where fn shortint_unchecked_mod

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1271,7 +1270,7 @@ where fn shortint_unchecked_mul_lsb

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1298,7 +1297,7 @@ where fn shortint_unchecked_mul_msb

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1325,7 +1324,7 @@ where fn shortint_smart_mul_msb

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); @@ -1364,7 +1363,7 @@ where fn shortint_default_mul_msb

(param: P) where - P: Into, + P: Into, { let keys = KEY_CACHE.get_from_param(param); let (cks, sks) = (keys.client_key(), keys.server_key()); diff --git a/tfhe/src/strings/test_functions/test_common.rs b/tfhe/src/strings/test_functions/test_common.rs index b081e0d06..df524dfd5 100644 --- a/tfhe/src/strings/test_functions/test_common.rs +++ b/tfhe/src/strings/test_functions/test_common.rs @@ -2,8 +2,7 @@ use crate::integer::keycache::KEY_CACHE; use crate::integer::server_key::radix_parallel::tests_cases_unsigned::FunctionExecutor; use crate::integer::server_key::radix_parallel::tests_unsigned::{CpuFunctionExecutor, NotTuple}; use crate::integer::{BooleanBlock, IntegerKeyKind, RadixClientKey, ServerKey as IntegerServerKey}; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::{ClearString, FheString, GenericPattern, GenericPatternRef}; use crate::strings::client_key::ClientKey; use crate::strings::server_key::{FheStringIsEmpty, FheStringLen, ServerKey}; @@ -16,7 +15,7 @@ fn test_encrypt_decrypt_parameterized() { fn test_encrypt_decrypt

(param: P) where - P: Into, + P: Into, { let (cks, _sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -43,7 +42,7 @@ impl NotTuple for &FheString {} #[allow(clippy::needless_pass_by_value)] fn is_empty_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, str: &FheString| { let sk = ServerKey::new(sk); @@ -54,7 +53,7 @@ where pub(crate) fn is_empty_test_impl(param: P, mut is_empty_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a FheString, FheStringIsEmpty>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -111,7 +110,7 @@ fn len_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn len_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, str: &FheString| { let sk = ServerKey::new(sk); @@ -122,7 +121,7 @@ where pub(crate) fn len_test_impl(param: P, mut len_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a FheString, FheStringLen>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -189,7 +188,7 @@ fn strip_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn strip_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -228,7 +227,7 @@ pub(crate) fn strip_test_impl( mut strip_executor: T, clear_function: for<'a> fn(&'a str, &'a str) -> Option<&'a str>, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, GenericPatternRef<'a>), (FheString, BooleanBlock)>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -299,7 +298,7 @@ fn comp_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn comp_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -332,7 +331,7 @@ pub(crate) fn comp_test_impl( mut comp_executor: T, clear_function: fn(&str, &str) -> bool, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, GenericPatternRef<'a>), BooleanBlock>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/strings/test_functions/test_concat.rs b/tfhe/src/strings/test_functions/test_concat.rs index 8694db42c..faeafd746 100644 --- a/tfhe/src/strings/test_functions/test_concat.rs +++ b/tfhe/src/strings/test_functions/test_concat.rs @@ -2,8 +2,7 @@ use crate::integer::keycache::KEY_CACHE; use crate::integer::server_key::radix_parallel::tests_cases_unsigned::FunctionExecutor; use crate::integer::server_key::radix_parallel::tests_unsigned::CpuFunctionExecutor; use crate::integer::{IntegerKeyKind, RadixClientKey, ServerKey as IntegerServerKey}; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::{FheString, UIntArg}; use crate::strings::client_key::ClientKey; use crate::strings::server_key::ServerKey; @@ -19,7 +18,7 @@ fn concat_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn concat_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, in1: &FheString, in2: &FheString| { @@ -31,7 +30,7 @@ where pub(crate) fn concat_test_impl(param: P, mut concat_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, &'a FheString), FheString>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -84,7 +83,7 @@ fn repeat_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn repeat_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, str: &FheString, n: &UIntArg| { @@ -96,7 +95,7 @@ where pub(crate) fn repeat_test_impl(param: P, mut repeat_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, &'a UIntArg), FheString>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/strings/test_functions/test_contains.rs b/tfhe/src/strings/test_functions/test_contains.rs index ad901e6ca..ae6404b1d 100644 --- a/tfhe/src/strings/test_functions/test_contains.rs +++ b/tfhe/src/strings/test_functions/test_contains.rs @@ -2,8 +2,7 @@ use crate::integer::keycache::KEY_CACHE; use crate::integer::server_key::radix_parallel::tests_cases_unsigned::FunctionExecutor; use crate::integer::server_key::radix_parallel::tests_unsigned::CpuFunctionExecutor; use crate::integer::{BooleanBlock, IntegerKeyKind, RadixClientKey, ServerKey as IntegerServerKey}; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::{ClearString, FheString, GenericPattern, GenericPatternRef}; use crate::strings::client_key::ClientKey; use crate::strings::server_key::ServerKey; @@ -17,7 +16,7 @@ fn contains_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn contains_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -60,7 +59,7 @@ pub(crate) fn contains_test_impl( mut contains_executor: T, clear_function: for<'a> fn(&'a str, &'a str) -> bool, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, GenericPatternRef<'a>), BooleanBlock>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/strings/test_functions/test_find_replace.rs b/tfhe/src/strings/test_functions/test_find_replace.rs index 2a6b0116a..90d09bba6 100644 --- a/tfhe/src/strings/test_functions/test_find_replace.rs +++ b/tfhe/src/strings/test_functions/test_find_replace.rs @@ -4,8 +4,7 @@ use crate::integer::server_key::radix_parallel::tests_unsigned::CpuFunctionExecu use crate::integer::{ BooleanBlock, IntegerKeyKind, RadixCiphertext, RadixClientKey, ServerKey as IntegerServerKey, }; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::{ ClearString, FheString, GenericPattern, GenericPatternRef, UIntArg, }; @@ -25,7 +24,7 @@ fn find_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn find_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -61,7 +60,7 @@ pub(crate) fn find_test_impl( mut find_executor: T, clear_function: for<'a> fn(&'a str, &'a str) -> Option, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a FheString, GenericPatternRef<'a>), (RadixCiphertext, BooleanBlock), @@ -136,7 +135,7 @@ fn replace_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn replace_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, @@ -151,7 +150,7 @@ where pub(crate) fn replace_test_impl(param: P, mut replace_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, GenericPatternRef<'a>, &'a FheString), FheString>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -232,7 +231,7 @@ fn replacen_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn replacen_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, @@ -248,7 +247,7 @@ where pub(crate) fn replacen_test_impl(param: P, mut replacen_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< ( &'a FheString, diff --git a/tfhe/src/strings/test_functions/test_split.rs b/tfhe/src/strings/test_functions/test_split.rs index a70cf552b..8b7124374 100644 --- a/tfhe/src/strings/test_functions/test_split.rs +++ b/tfhe/src/strings/test_functions/test_split.rs @@ -2,8 +2,7 @@ use crate::integer::keycache::KEY_CACHE; use crate::integer::server_key::radix_parallel::tests_cases_unsigned::FunctionExecutor; use crate::integer::server_key::radix_parallel::tests_unsigned::CpuFunctionExecutor; use crate::integer::{BooleanBlock, IntegerKeyKind, RadixClientKey, ServerKey as IntegerServerKey}; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::{ ClearString, FheString, GenericPattern, GenericPatternRef, UIntArg, }; @@ -44,7 +43,7 @@ fn split_once_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn split_once_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -84,7 +83,7 @@ pub(crate) fn split_once_test_impl( mut split_once_executor: T, clear_function: for<'a> fn(&'a str, &'a str) -> Option<(&'a str, &'a str)>, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a FheString, GenericPatternRef<'a>), (FheString, FheString, BooleanBlock), @@ -164,7 +163,7 @@ fn split_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn split_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -225,7 +224,7 @@ pub(crate) fn split_test_impl( mut split_executor: T, clear_function: for<'a> fn(&'a str, &'a str) -> Box + 'a>, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a FheString, GenericPatternRef<'a>), Box FheStringIterator<&'b IntegerServerKey>>, @@ -312,7 +311,7 @@ fn splitn_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn splitn_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -353,7 +352,7 @@ pub(crate) fn splitn_test_impl( mut splitn_executor: T, clear_function: for<'a> fn(&'a str, &'a str, u16) -> Box + 'a>, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< (&'a FheString, GenericPatternRef<'a>, UIntArg), Box FheStringIterator<&'b IntegerServerKey>>, diff --git a/tfhe/src/strings/test_functions/test_up_low_case.rs b/tfhe/src/strings/test_functions/test_up_low_case.rs index 62a26ffe1..52b9d8e36 100644 --- a/tfhe/src/strings/test_functions/test_up_low_case.rs +++ b/tfhe/src/strings/test_functions/test_up_low_case.rs @@ -2,8 +2,7 @@ use crate::integer::keycache::KEY_CACHE; use crate::integer::server_key::radix_parallel::tests_cases_unsigned::FunctionExecutor; use crate::integer::server_key::radix_parallel::tests_unsigned::CpuFunctionExecutor; use crate::integer::{BooleanBlock, IntegerKeyKind, RadixClientKey, ServerKey as IntegerServerKey}; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::{ClearString, FheString, GenericPattern, GenericPatternRef}; use crate::strings::client_key::ClientKey; use crate::strings::server_key::ServerKey; @@ -27,7 +26,7 @@ fn to_lower_upper_case_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn to_lower_upper_case_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -63,7 +62,7 @@ pub(crate) fn to_lower_upper_case_test_impl( mut to_lower_upper_case_executor: T, clear_function: for<'a> fn(&'a str) -> String, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a FheString, FheString>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -110,7 +109,7 @@ fn eq_ignore_case_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn eq_ignore_case_test

(param: P) where - P: Into, + P: Into, { let executor = CpuFunctionExecutor::new(&|sk: &IntegerServerKey, @@ -125,7 +124,7 @@ where pub(crate) fn eq_ignore_case_test_impl(param: P, mut eq_ignore_case_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<(&'a FheString, GenericPatternRef<'a>), BooleanBlock>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); diff --git a/tfhe/src/strings/test_functions/test_whitespace.rs b/tfhe/src/strings/test_functions/test_whitespace.rs index 9b985be7d..da2632703 100644 --- a/tfhe/src/strings/test_functions/test_whitespace.rs +++ b/tfhe/src/strings/test_functions/test_whitespace.rs @@ -2,8 +2,7 @@ use crate::integer::keycache::KEY_CACHE; use crate::integer::server_key::radix_parallel::tests_cases_unsigned::FunctionExecutor; use crate::integer::server_key::radix_parallel::tests_unsigned::CpuFunctionExecutor; use crate::integer::{IntegerKeyKind, RadixClientKey, ServerKey as IntegerServerKey}; -use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128; -use crate::shortint::PBSParameters; +use crate::shortint::parameters::{TestParameters, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128}; use crate::strings::ciphertext::FheString; use crate::strings::client_key::ClientKey; use crate::strings::server_key::{split_ascii_whitespace, FheStringIterator, ServerKey}; @@ -20,7 +19,7 @@ fn trim_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn trim_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let ops: [( @@ -63,7 +62,7 @@ pub(crate) fn trim_test_impl( mut trim_executor: T, clear_function: for<'a> fn(&'a str) -> &'a str, ) where - P: Into, + P: Into, T: for<'a> FunctionExecutor<&'a FheString, FheString>, { let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix); @@ -120,7 +119,7 @@ fn split_whitespace_test_parameterized() { #[allow(clippy::needless_pass_by_value)] fn split_whitespace_test

(param: P) where - P: Into, + P: Into, { #[allow(clippy::type_complexity)] let fhe_func: fn( @@ -136,7 +135,7 @@ where pub(crate) fn split_whitespace_test_impl(param: P, mut split_whitespace_executor: T) where - P: Into, + P: Into, T: for<'a> FunctionExecutor< &'a FheString, Box FheStringIterator<&'b IntegerServerKey>>,