mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 06:38:06 -05:00
chore(tests): add support for AP in tests and benches
This commit is contained in:
committed by
Nicolas Sarlin
parent
c17a2527b7
commit
8a26df9177
@@ -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
|
||||
|
||||
@@ -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<tfhe::shortint::PBSParameters>, IntoIter<usize>>,
|
||||
params_and_bit_sizes: itertools::Product<
|
||||
IntoIter<tfhe::shortint::atomic_pattern::AtomicPatternParameters>,
|
||||
IntoIter<usize>,
|
||||
>,
|
||||
}
|
||||
|
||||
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<Self::Item> {
|
||||
let (param, bit_size) = self.params_and_bit_sizes.next()?;
|
||||
@@ -105,6 +112,12 @@ pub mod shortint_utils {
|
||||
|
||||
impl From<PBSParameters> for CryptoParametersRecord<u64> {
|
||||
fn from(params: PBSParameters) -> Self {
|
||||
AtomicPatternParameters::from(params).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AtomicPatternParameters> for CryptoParametersRecord<u64> {
|
||||
fn from(params: AtomicPatternParameters) -> Self {
|
||||
CryptoParametersRecord {
|
||||
lwe_dimension: Some(params.lwe_dimension()),
|
||||
glwe_dimension: Some(params.glwe_dimension()),
|
||||
|
||||
@@ -65,7 +65,7 @@ pub struct CudaLweBootstrapKey {
|
||||
impl CudaLweBootstrapKey {
|
||||
pub fn from_lwe_bootstrap_key<InputBskCont: Container>(
|
||||
bsk: &LweBootstrapKey<InputBskCont>,
|
||||
ms_noise_reduction_key: Option<&ModulusSwitchNoiseReductionKey>,
|
||||
ms_noise_reduction_key: Option<&ModulusSwitchNoiseReductionKey<u64>>,
|
||||
streams: &CudaStreams,
|
||||
) -> Self
|
||||
where
|
||||
|
||||
@@ -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<impl Into<AtomicPatternParameters>>) -> ClientKey {
|
||||
pub(crate) fn setup_gpu(params: Option<impl Into<TestParameters>>) -> ClientKey {
|
||||
let config = params
|
||||
.map_or_else(ConfigBuilder::default, |p| {
|
||||
ConfigBuilder::with_custom_parameters(p.into())
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<impl Into<AtomicPatternParameters>>) -> ClientKey {
|
||||
pub(crate) fn setup_cpu(params: Option<impl Into<TestParameters>>) -> ClientKey {
|
||||
let config = params
|
||||
.map_or_else(ConfigBuilder::default, |p| {
|
||||
ConfigBuilder::with_custom_parameters(p.into())
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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<u64> =
|
||||
|
||||
@@ -18,7 +18,7 @@ create_gpu_parameterized_test!(no_cmux_erc20 {
|
||||
|
||||
fn safe_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let overflowing_add_executor =
|
||||
GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_add);
|
||||
@@ -37,7 +37,7 @@ where
|
||||
|
||||
fn whitepaper_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge);
|
||||
let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add);
|
||||
@@ -54,7 +54,7 @@ where
|
||||
|
||||
fn no_cmux_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge);
|
||||
let mul_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::mul);
|
||||
|
||||
@@ -14,7 +14,7 @@ create_gpu_parameterized_test!(random_op_sequence {
|
||||
});
|
||||
fn random_op_sequence<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Clone,
|
||||
P: Into<TestParameters> + Clone,
|
||||
{
|
||||
// Binary Ops Executors
|
||||
let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add);
|
||||
|
||||
@@ -15,7 +15,7 @@ create_gpu_parameterized_test!(signed_no_cmux_erc20 {
|
||||
|
||||
fn signed_whitepaper_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge);
|
||||
let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add);
|
||||
@@ -32,7 +32,7 @@ where
|
||||
|
||||
fn signed_no_cmux_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let ge_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::ge);
|
||||
let mul_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::mul);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(signed_random_op_sequence {
|
||||
});
|
||||
fn signed_random_op_sequence<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Clone,
|
||||
P: Into<TestParameters> + Clone,
|
||||
{
|
||||
// Binary Ops Executors
|
||||
let add_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_signed_abs);
|
||||
|
||||
fn integer_signed_unchecked_abs<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_abs);
|
||||
signed_unchecked_absolute_value_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_signed_abs<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::abs);
|
||||
signed_default_absolute_value_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_add);
|
||||
|
||||
fn integer_unchecked_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_add);
|
||||
signed_unchecked_add_test(param, executor);
|
||||
@@ -24,7 +24,7 @@ where
|
||||
|
||||
fn integer_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::add);
|
||||
signed_default_add_test(param, executor);
|
||||
@@ -32,7 +32,7 @@ where
|
||||
|
||||
fn integer_unchecked_signed_overflowing_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_add);
|
||||
signed_unchecked_overflowing_add_test(param, executor);
|
||||
|
||||
@@ -20,7 +20,7 @@ create_gpu_parameterized_test!(integer_signed_default_bitxor);
|
||||
|
||||
fn integer_signed_unchecked_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitand);
|
||||
signed_unchecked_bitand_test(param, executor);
|
||||
@@ -28,7 +28,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitor);
|
||||
signed_unchecked_bitor_test(param, executor);
|
||||
@@ -36,7 +36,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitxor);
|
||||
signed_unchecked_bitxor_test(param, executor);
|
||||
@@ -44,7 +44,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitnot<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitnot);
|
||||
signed_default_bitnot_test(param, executor);
|
||||
@@ -52,7 +52,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitand);
|
||||
signed_default_bitand_test(param, executor);
|
||||
@@ -60,7 +60,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitor);
|
||||
signed_default_bitor_test(param, executor);
|
||||
@@ -68,7 +68,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitxor);
|
||||
signed_default_bitxor_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_if_then_else);
|
||||
|
||||
fn integer_unchecked_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::if_then_else);
|
||||
signed_default_if_then_else_test(param, executor);
|
||||
|
||||
@@ -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 [<integer_signed_unchecked_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_unchecked_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::[<unchecked_ $comparison_name>]);
|
||||
test_signed_unchecked_function(
|
||||
@@ -31,7 +31,7 @@ macro_rules! define_gpu_signed_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_default_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_default_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
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<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_min);
|
||||
test_signed_unchecked_minmax(params, 2, executor, std::cmp::min::<i128>)
|
||||
@@ -68,7 +68,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_max_128_bits<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_max);
|
||||
test_signed_unchecked_minmax(params, 2, executor, std::cmp::max::<i128>)
|
||||
@@ -76,7 +76,7 @@ where
|
||||
|
||||
fn integer_signed_min_128_bits<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::min);
|
||||
test_signed_default_minmax(params, 2, executor, std::cmp::min::<i128>);
|
||||
@@ -84,7 +84,7 @@ where
|
||||
|
||||
fn integer_signed_max_128_bits<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::max);
|
||||
test_signed_default_minmax(params, 2, executor, std::cmp::max::<i128>);
|
||||
|
||||
@@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_signed_unchecked_div_rem);
|
||||
|
||||
fn integer_signed_unchecked_div_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::div_rem);
|
||||
signed_unchecked_div_rem_test(param, executor);
|
||||
|
||||
@@ -18,7 +18,7 @@ create_gpu_parameterized_test!(integer_signed_default_checked_ilog2);
|
||||
|
||||
fn integer_signed_default_trailing_zeros<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_zeros);
|
||||
default_trailing_zeros_test(param, executor);
|
||||
@@ -26,7 +26,7 @@ where
|
||||
|
||||
fn integer_signed_default_trailing_ones<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_ones);
|
||||
default_trailing_ones_test(param, executor);
|
||||
@@ -34,7 +34,7 @@ where
|
||||
|
||||
fn integer_signed_default_leading_zeros<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_zeros);
|
||||
default_leading_zeros_test(param, executor);
|
||||
@@ -42,7 +42,7 @@ where
|
||||
|
||||
fn integer_signed_default_leading_ones<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_ones);
|
||||
default_leading_ones_test(param, executor);
|
||||
@@ -50,7 +50,7 @@ where
|
||||
|
||||
fn integer_signed_default_ilog2<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::ilog2);
|
||||
default_ilog2_test(param, executor);
|
||||
@@ -58,7 +58,7 @@ where
|
||||
|
||||
fn integer_signed_default_checked_ilog2<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::checked_ilog2);
|
||||
default_checked_ilog2_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_mul);
|
||||
|
||||
fn integer_unchecked_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_mul);
|
||||
signed_unchecked_mul_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::mul);
|
||||
signed_default_mul_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_neg);
|
||||
|
||||
fn integer_unchecked_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_neg);
|
||||
signed_unchecked_neg_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::neg);
|
||||
signed_default_neg_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_rotate_right);
|
||||
|
||||
fn integer_unchecked_rotate_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_left);
|
||||
signed_default_rotate_left_test(param, executor);
|
||||
|
||||
@@ -15,7 +15,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_scalar_add);
|
||||
|
||||
fn integer_signed_unchecked_scalar_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_scalar_add);
|
||||
signed_default_overflowing_scalar_add_test(param, executor);
|
||||
|
||||
@@ -15,7 +15,7 @@ create_gpu_parameterized_test!(integer_signed_default_scalar_bitxor);
|
||||
|
||||
fn integer_signed_default_scalar_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitxor);
|
||||
signed_default_scalar_bitxor_test(param, executor);
|
||||
|
||||
@@ -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 [<integer_signed_unchecked_scalar_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_unchecked_scalar_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::[<unchecked_scalar_ $comparison_name>]);
|
||||
test_signed_unchecked_scalar_function(
|
||||
@@ -31,7 +31,7 @@ macro_rules! define_gpu_signed_scalar_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_default_scalar_ $comparison_name $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_default_scalar_ $comparison_name $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 10;
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::[<scalar_ $comparison_name>]);
|
||||
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<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_min);
|
||||
test_signed_unchecked_scalar_minmax(params, 2, executor, std::cmp::min::<i128>);
|
||||
@@ -66,7 +66,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_scalar_max_i128<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_max);
|
||||
test_signed_unchecked_scalar_minmax(params, 2, executor, std::cmp::max::<i128>);
|
||||
@@ -74,7 +74,7 @@ where
|
||||
|
||||
fn integer_signed_scalar_min_i128<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_min);
|
||||
test_signed_default_scalar_minmax(params, 2, executor, std::cmp::min::<i128>);
|
||||
@@ -82,7 +82,7 @@ where
|
||||
|
||||
fn integer_signed_scalar_max_i128<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_max);
|
||||
test_signed_default_scalar_minmax(params, 2, executor, std::cmp::max::<i128>);
|
||||
|
||||
@@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_signed_unchecked_scalar_div_rem);
|
||||
|
||||
fn integer_signed_unchecked_scalar_div_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_scalar_div_rem);
|
||||
signed_unchecked_scalar_div_rem_test(param, executor);
|
||||
|
||||
@@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_signed_unchecked_scalar_mul);
|
||||
|
||||
fn integer_signed_unchecked_scalar_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_mul);
|
||||
signed_unchecked_scalar_mul_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_scalar_rotate_right);
|
||||
|
||||
fn integer_signed_unchecked_scalar_rotate_left<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_rotate_right);
|
||||
signed_default_scalar_rotate_right_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_scalar_right_shift);
|
||||
|
||||
fn integer_signed_unchecked_scalar_left_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_right_shift);
|
||||
signed_default_scalar_right_shift_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_scalar_sub);
|
||||
|
||||
fn integer_signed_unchecked_scalar_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_scalar_sub);
|
||||
signed_default_overflowing_scalar_sub_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_signed_right_shift);
|
||||
|
||||
fn integer_signed_unchecked_right_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::left_shift);
|
||||
signed_default_left_shift_test(param, executor);
|
||||
|
||||
@@ -17,7 +17,7 @@ create_gpu_parameterized_test!(integer_signed_overflowing_sub);
|
||||
|
||||
fn integer_unchecked_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_sub);
|
||||
signed_unchecked_sub_test(param, executor);
|
||||
@@ -25,7 +25,7 @@ where
|
||||
|
||||
fn integer_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::sub);
|
||||
signed_default_sub_test(param, executor);
|
||||
@@ -33,7 +33,7 @@ where
|
||||
|
||||
fn integer_unchecked_signed_overflowing_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::signed_overflowing_sub);
|
||||
signed_default_overflowing_sub_test(param, executor);
|
||||
|
||||
@@ -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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::all_eq_slices);
|
||||
default_all_eq_slices_test_case(param, executor);
|
||||
|
||||
@@ -23,7 +23,7 @@ create_gpu_parameterized_test!(multi_device_integer_default_overflowing_add);
|
||||
|
||||
fn integer_unchecked_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_add);
|
||||
unchecked_add_test(param, executor);
|
||||
@@ -31,7 +31,7 @@ where
|
||||
|
||||
fn integer_unchecked_add_assign<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_add_assign);
|
||||
unchecked_add_assign_test(param, executor);
|
||||
@@ -39,7 +39,7 @@ where
|
||||
|
||||
fn integer_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::add);
|
||||
default_add_test(param, executor);
|
||||
@@ -47,7 +47,7 @@ where
|
||||
|
||||
fn multi_device_integer_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::add);
|
||||
let num_gpus = get_number_of_gpus();
|
||||
@@ -58,7 +58,7 @@ where
|
||||
|
||||
fn integer_sum_ciphertexts_vec<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
// 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_add);
|
||||
let num_gpus = get_number_of_gpus();
|
||||
|
||||
@@ -20,7 +20,7 @@ create_gpu_parameterized_test!(integer_bitxor);
|
||||
|
||||
fn integer_unchecked_bitnot<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitnot);
|
||||
unchecked_bitnot_test(param, executor);
|
||||
@@ -28,7 +28,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitand);
|
||||
unchecked_bitand_test(param, executor);
|
||||
@@ -36,7 +36,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitor);
|
||||
unchecked_bitor_test(param, executor);
|
||||
@@ -44,7 +44,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_bitxor);
|
||||
unchecked_bitxor_test(param, executor);
|
||||
@@ -52,7 +52,7 @@ where
|
||||
|
||||
fn integer_bitnot<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitnot);
|
||||
default_bitnot_test(param, executor);
|
||||
@@ -60,7 +60,7 @@ where
|
||||
|
||||
fn integer_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitand);
|
||||
default_bitand_test(param, executor);
|
||||
@@ -68,7 +68,7 @@ where
|
||||
|
||||
fn integer_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitor);
|
||||
default_bitor_test(param, executor);
|
||||
@@ -76,7 +76,7 @@ where
|
||||
|
||||
fn integer_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::bitxor);
|
||||
default_bitxor_test(param, executor);
|
||||
|
||||
@@ -13,14 +13,14 @@ create_gpu_parameterized_test!(multi_device_integer_if_then_else);
|
||||
|
||||
fn integer_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::if_then_else);
|
||||
default_if_then_else_test(param, executor);
|
||||
}
|
||||
fn multi_device_integer_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::if_then_else);
|
||||
let num_gpus = get_number_of_gpus();
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::shortint::parameters::*;
|
||||
macro_rules! define_gpu_comparison_test_functions {
|
||||
($comparison_name:ident, $clear_type:ty) => {
|
||||
::paste::paste!{
|
||||
fn [<integer_unchecked_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters>{
|
||||
fn [<integer_unchecked_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters>{
|
||||
let num_tests = 1;
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::[<unchecked_ $comparison_name>]);
|
||||
test_unchecked_function(
|
||||
@@ -32,7 +32,7 @@ macro_rules! define_gpu_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_default_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_default_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
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 [<multi_device_integer_default_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<multi_device_integer_default_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
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<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_min);
|
||||
test_unchecked_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
@@ -86,7 +86,7 @@ where
|
||||
|
||||
fn integer_unchecked_max_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_max);
|
||||
test_unchecked_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
@@ -94,7 +94,7 @@ where
|
||||
|
||||
fn integer_min_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::min);
|
||||
test_default_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
@@ -102,7 +102,7 @@ where
|
||||
|
||||
fn integer_max_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::max);
|
||||
test_default_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
|
||||
@@ -14,7 +14,7 @@ create_gpu_parameterized_test!(integer_rem);
|
||||
|
||||
fn integer_div<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::div);
|
||||
default_div_test(param, executor);
|
||||
@@ -22,7 +22,7 @@ where
|
||||
|
||||
fn integer_div_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::div_rem);
|
||||
default_div_rem_test(param, executor);
|
||||
@@ -30,7 +30,7 @@ where
|
||||
|
||||
fn integer_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::rem);
|
||||
default_rem_test(param, executor);
|
||||
|
||||
@@ -18,7 +18,7 @@ create_gpu_parameterized_test!(integer_default_checked_ilog2);
|
||||
|
||||
fn integer_default_trailing_zeros<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_zeros);
|
||||
default_trailing_zeros_test(param, executor);
|
||||
@@ -26,7 +26,7 @@ where
|
||||
|
||||
fn integer_default_trailing_ones<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::trailing_ones);
|
||||
default_trailing_ones_test(param, executor);
|
||||
@@ -34,7 +34,7 @@ where
|
||||
|
||||
fn integer_default_leading_zeros<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_zeros);
|
||||
default_leading_zeros_test(param, executor);
|
||||
@@ -42,7 +42,7 @@ where
|
||||
|
||||
fn integer_default_leading_ones<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::leading_ones);
|
||||
default_leading_ones_test(param, executor);
|
||||
@@ -50,7 +50,7 @@ where
|
||||
|
||||
fn integer_default_ilog2<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::ilog2);
|
||||
default_ilog2_test(param, executor);
|
||||
@@ -58,7 +58,7 @@ where
|
||||
|
||||
fn integer_default_checked_ilog2<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::checked_ilog2);
|
||||
default_checked_ilog2_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_mul);
|
||||
|
||||
fn integer_unchecked_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_mul);
|
||||
unchecked_mul_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::mul);
|
||||
default_mul_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_neg);
|
||||
|
||||
fn integer_unchecked_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_neg);
|
||||
unchecked_neg_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::neg);
|
||||
default_neg_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_rotate_right);
|
||||
|
||||
fn integer_unchecked_rotate_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_rotate_right);
|
||||
unchecked_rotate_right_test(param, executor);
|
||||
@@ -24,7 +24,7 @@ where
|
||||
|
||||
fn integer_rotate_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_right);
|
||||
default_rotate_right_test(param, executor);
|
||||
@@ -32,7 +32,7 @@ where
|
||||
|
||||
fn integer_unchecked_rotate_left<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_rotate_left);
|
||||
unchecked_rotate_left_test(param, executor);
|
||||
@@ -40,7 +40,7 @@ where
|
||||
|
||||
fn integer_rotate_left<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::rotate_left);
|
||||
default_rotate_left_test(param, executor);
|
||||
|
||||
@@ -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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_add);
|
||||
unchecked_scalar_add_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_scalar_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_scalar_add);
|
||||
default_overflowing_scalar_add_test(param, executor);
|
||||
|
||||
@@ -14,7 +14,7 @@ create_gpu_parameterized_test!(integer_scalar_bitxor);
|
||||
|
||||
fn integer_scalar_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitand);
|
||||
default_scalar_bitand_test(param, executor);
|
||||
@@ -22,7 +22,7 @@ where
|
||||
|
||||
fn integer_scalar_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitor);
|
||||
default_scalar_bitor_test(param, executor);
|
||||
@@ -30,7 +30,7 @@ where
|
||||
|
||||
fn integer_scalar_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_bitxor);
|
||||
default_scalar_bitxor_test(param, executor);
|
||||
|
||||
@@ -23,7 +23,7 @@ use rand::Rng;
|
||||
macro_rules! define_gpu_scalar_comparison_test_functions {
|
||||
($comparison_name:ident, $clear_type:ty) => {
|
||||
::paste::paste!{
|
||||
fn [<integer_unchecked_scalar_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters>{
|
||||
fn [<integer_unchecked_scalar_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters>{
|
||||
let num_tests = 1;
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::[<unchecked_scalar_ $comparison_name>]);
|
||||
test_unchecked_scalar_function(
|
||||
@@ -34,7 +34,7 @@ macro_rules! define_gpu_scalar_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_default_scalar_ $comparison_name $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_default_scalar_ $comparison_name $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::[<scalar_ $comparison_name>]);
|
||||
test_default_scalar_function(
|
||||
@@ -61,7 +61,7 @@ macro_rules! define_gpu_scalar_comparison_test_functions {
|
||||
|
||||
fn integer_unchecked_scalar_min_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_scalar_min);
|
||||
test_unchecked_scalar_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
@@ -69,7 +69,7 @@ where
|
||||
|
||||
fn integer_unchecked_scalar_max_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::unchecked_scalar_max);
|
||||
test_unchecked_scalar_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
@@ -77,7 +77,7 @@ where
|
||||
|
||||
fn integer_scalar_min_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::scalar_min);
|
||||
test_default_scalar_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
@@ -85,7 +85,7 @@ where
|
||||
|
||||
fn integer_scalar_max_u256<P>(params: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(CudaServerKey::scalar_max);
|
||||
test_default_scalar_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
@@ -96,7 +96,7 @@ where
|
||||
// compared to the ciphertext
|
||||
fn integer_unchecked_scalar_comparisons_edge<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let p = param.into();
|
||||
let num_block = 1;
|
||||
|
||||
@@ -10,7 +10,7 @@ create_gpu_parameterized_test!(integer_scalar_div_rem);
|
||||
|
||||
fn integer_scalar_div_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_div_rem);
|
||||
default_scalar_div_rem_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_scalar_mul);
|
||||
|
||||
fn integer_unchecked_scalar_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_mul);
|
||||
default_scalar_mul_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_scalar_rotate_right);
|
||||
|
||||
fn integer_unchecked_scalar_rotate_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_rotate_left);
|
||||
default_scalar_rotate_left_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_scalar_right_shift);
|
||||
|
||||
fn integer_unchecked_scalar_right_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_left_shift);
|
||||
default_scalar_left_shift_test(param, executor);
|
||||
|
||||
@@ -13,7 +13,7 @@ create_gpu_parameterized_test!(integer_scalar_sub);
|
||||
|
||||
fn integer_unchecked_scalar_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_scalar_sub);
|
||||
unchecked_scalar_sub_test(param, executor);
|
||||
@@ -21,7 +21,7 @@ where
|
||||
|
||||
fn integer_scalar_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::scalar_sub);
|
||||
default_scalar_sub_test(param, executor);
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_right_shift);
|
||||
|
||||
fn integer_unchecked_right_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_right_shift);
|
||||
unchecked_right_shift_test(param, executor);
|
||||
@@ -24,7 +24,7 @@ where
|
||||
|
||||
fn integer_right_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::right_shift);
|
||||
default_right_shift_test(param, executor);
|
||||
@@ -32,7 +32,7 @@ where
|
||||
|
||||
fn integer_unchecked_left_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_left_shift);
|
||||
unchecked_left_shift_test(param, executor);
|
||||
@@ -40,7 +40,7 @@ where
|
||||
|
||||
fn integer_left_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::left_shift);
|
||||
default_left_shift_test(param, executor);
|
||||
|
||||
@@ -19,7 +19,7 @@ create_gpu_parameterized_test!(multi_device_integer_default_overflowing_sub);
|
||||
|
||||
fn integer_unchecked_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_sub);
|
||||
unchecked_sub_test(param, executor);
|
||||
@@ -27,7 +27,7 @@ where
|
||||
|
||||
fn integer_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::sub);
|
||||
default_sub_test(param, executor);
|
||||
@@ -35,7 +35,7 @@ where
|
||||
|
||||
fn multi_device_integer_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::sub);
|
||||
let num_gpus = get_number_of_gpus();
|
||||
@@ -46,7 +46,7 @@ where
|
||||
|
||||
fn integer_default_overflowing_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::unsigned_overflowing_sub);
|
||||
let num_gpus = get_number_of_gpus();
|
||||
|
||||
@@ -16,7 +16,7 @@ create_gpu_parameterized_test!(integer_unchecked_contains_slice_test_case);
|
||||
|
||||
fn integer_unchecked_all_eq_slices_test_case<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_contains_sub_slice);
|
||||
unchecked_slice_contains_test_case(param, executor);
|
||||
|
||||
@@ -45,7 +45,7 @@ create_gpu_parameterized_test!(integer_default_first_index_of_clear);
|
||||
|
||||
fn integer_unchecked_match_value<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_contains);
|
||||
unchecked_contains_test_case(param, executor);
|
||||
@@ -69,7 +69,7 @@ where
|
||||
|
||||
fn integer_unchecked_contains_clear<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::unchecked_first_index_in_clears);
|
||||
unchecked_first_index_in_clears_test_case(param, executor);
|
||||
}
|
||||
fn integer_unchecked_index_of<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::contains);
|
||||
default_contains_test_case(param, executor);
|
||||
@@ -158,7 +158,7 @@ where
|
||||
|
||||
fn integer_default_contains_clear<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = GpuFunctionExecutor::new(&CudaServerKey::first_index_of_clear);
|
||||
default_first_index_of_clear_test_case(param, executor);
|
||||
|
||||
@@ -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<P>(&self, params: P, key_kind: IntegerKeyKind) -> (ClientKey, ServerKey)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<AtomicPatternParameters>,
|
||||
{
|
||||
let cache = &crate::shortint::keycache::KEY_CACHE;
|
||||
|
||||
|
||||
@@ -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<PBSParameters>) {
|
||||
fn boolean_bitxor(params: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
fn boolean_bitor(params: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
fn boolean_bitand(params: impl Into<TestParameters>) {
|
||||
let (cks, sks) = KEY_CACHE.get_from_params(params.into(), IntegerKeyKind::Radix);
|
||||
|
||||
for (clear_0, clear_1) in INPUT_BOOLEANS {
|
||||
|
||||
@@ -358,7 +358,7 @@ fn integer_smart_add(param: ClassicPBSParameters) {
|
||||
|
||||
fn integer_unchecked_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitand);
|
||||
unchecked_bitand_test(param, executor);
|
||||
@@ -366,7 +366,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitor);
|
||||
unchecked_bitor_test(param, executor);
|
||||
@@ -374,7 +374,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitxor);
|
||||
unchecked_bitxor_test(param, executor);
|
||||
@@ -382,7 +382,7 @@ where
|
||||
|
||||
fn integer_smart_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitand);
|
||||
smart_bitand_test(param, executor);
|
||||
@@ -390,7 +390,7 @@ where
|
||||
|
||||
fn integer_smart_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitor);
|
||||
smart_bitor_test(param, executor);
|
||||
@@ -398,7 +398,7 @@ where
|
||||
|
||||
fn integer_smart_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_mul);
|
||||
unchecked_mul_test(param, executor);
|
||||
@@ -637,7 +637,7 @@ where
|
||||
|
||||
fn integer_smart_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_mul);
|
||||
smart_mul_test(param, executor);
|
||||
@@ -645,7 +645,7 @@ where
|
||||
|
||||
fn integer_unchecked_scalar_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_add);
|
||||
unchecked_scalar_add_test(param, executor);
|
||||
@@ -653,7 +653,7 @@ where
|
||||
|
||||
fn integer_smart_scalar_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_scalar_add);
|
||||
smart_scalar_add_test(param, executor);
|
||||
@@ -661,7 +661,7 @@ where
|
||||
|
||||
fn integer_unchecked_scalar_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_scalar_sub);
|
||||
unchecked_scalar_sub_test(param, executor);
|
||||
@@ -669,7 +669,7 @@ where
|
||||
|
||||
fn integer_smart_scalar_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_sub);
|
||||
default_overflowing_sub_test(param, executor);
|
||||
@@ -746,13 +746,13 @@ where
|
||||
|
||||
fn integer_full_propagate<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::full_propagate);
|
||||
full_propagate_test(param, executor);
|
||||
}
|
||||
|
||||
fn integer_create_trivial_min_max(param: impl Into<PBSParameters>) {
|
||||
fn integer_create_trivial_min_max(param: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn integer_signed_decryption_correctly_sign_extend(param: impl Into<PBSParameters>) {
|
||||
fn integer_signed_decryption_correctly_sign_extend(param: impl Into<TestParameters>) {
|
||||
// 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
|
||||
//
|
||||
|
||||
@@ -76,7 +76,7 @@ mod tests {
|
||||
|
||||
pub(crate) fn reverse_bits_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -116,7 +116,7 @@ mod tests {
|
||||
|
||||
fn integer_reverse_bits<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::reverse_bits_parallelized);
|
||||
reverse_bits_test(param, executor);
|
||||
|
||||
@@ -72,7 +72,7 @@ use crate::shortint::server_key::CiphertextNoiseDegree;
|
||||
|
||||
pub(crate) fn unchecked_mul_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -227,7 +227,7 @@ where
|
||||
|
||||
pub(crate) fn unchecked_scalar_sub_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -460,7 +460,7 @@ where
|
||||
|
||||
pub(crate) fn smart_mul_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a mut RadixCiphertext, &'a mut RadixCiphertext),
|
||||
RadixCiphertext,
|
||||
@@ -505,7 +505,7 @@ where
|
||||
|
||||
pub(crate) fn smart_block_mul_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(
|
||||
&'a mut RadixCiphertext,
|
||||
@@ -560,7 +560,7 @@ where
|
||||
|
||||
pub(crate) fn smart_bitand_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a mut RadixCiphertext, &'a mut RadixCiphertext),
|
||||
RadixCiphertext,
|
||||
@@ -608,7 +608,7 @@ where
|
||||
|
||||
pub(crate) fn smart_bitor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a mut RadixCiphertext, &'a mut RadixCiphertext),
|
||||
RadixCiphertext,
|
||||
@@ -657,7 +657,7 @@ where
|
||||
|
||||
pub(crate) fn smart_bitxor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a mut RadixCiphertext, &'a mut RadixCiphertext),
|
||||
RadixCiphertext,
|
||||
@@ -710,7 +710,7 @@ where
|
||||
|
||||
pub(crate) fn smart_scalar_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a RadixCiphertext, &'a RadixCiphertext),
|
||||
(RadixCiphertext, BooleanBlock),
|
||||
@@ -1051,7 +1051,7 @@ where
|
||||
|
||||
pub(crate) fn unchecked_bitnot_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1083,7 +1083,7 @@ where
|
||||
|
||||
pub(crate) fn unchecked_bitand_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1127,7 +1127,7 @@ where
|
||||
|
||||
pub(crate) fn unchecked_bitor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1170,7 +1170,7 @@ where
|
||||
|
||||
pub(crate) fn unchecked_bitxor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1213,7 +1213,7 @@ where
|
||||
|
||||
pub(crate) fn default_bitand_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1264,7 +1264,7 @@ where
|
||||
|
||||
pub(crate) fn default_bitor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1315,7 +1315,7 @@ where
|
||||
|
||||
pub(crate) fn default_bitxor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1366,7 +1366,7 @@ where
|
||||
|
||||
pub(crate) fn default_bitnot_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1407,7 +1407,7 @@ where
|
||||
|
||||
pub(crate) fn default_scalar_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -1992,7 +1992,7 @@ where
|
||||
|
||||
pub(crate) fn default_scalar_bitor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -2045,7 +2045,7 @@ where
|
||||
|
||||
pub(crate) fn default_scalar_bitxor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, u64), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -2222,7 +2222,7 @@ where
|
||||
|
||||
pub(crate) fn full_propagate_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a mut RadixCiphertext, ()>,
|
||||
{
|
||||
let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix);
|
||||
|
||||
@@ -27,7 +27,7 @@ create_parameterized_test!(overflow_erc20 {
|
||||
|
||||
fn safe_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let overflowing_add_executor =
|
||||
CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_add_parallelized);
|
||||
@@ -46,7 +46,7 @@ where
|
||||
|
||||
fn whitepaper_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let ge_executor = CpuFunctionExecutor::new(&ServerKey::ge_parallelized);
|
||||
let mul_executor = CpuFunctionExecutor::new(&ServerKey::mul_parallelized);
|
||||
@@ -74,7 +74,7 @@ where
|
||||
|
||||
fn overflow_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let overflowing_sub_executor =
|
||||
CpuFunctionExecutor::new(&ServerKey::unsigned_overflowing_sub_parallelized);
|
||||
@@ -99,7 +99,7 @@ pub(crate) fn safe_erc20_test<P, T1, T2, T3, T4>(
|
||||
mut if_then_else_executor: T3,
|
||||
mut bitor_executor: T4,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T1: for<'a> FunctionExecutor<
|
||||
(&'a RadixCiphertext, &'a RadixCiphertext),
|
||||
(RadixCiphertext, BooleanBlock),
|
||||
@@ -242,7 +242,7 @@ pub(crate) fn whitepaper_erc20_test<P, T1, T2, T3, T4>(
|
||||
mut if_then_else_executor: T3,
|
||||
mut sub_executor: T4,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T1, T2, T3, T4>(
|
||||
mut add_executor: T3,
|
||||
mut sub_executor: T4,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T1, T2, T3, T4, T5>(
|
||||
mut mul_executor: T4,
|
||||
mut add_executor: T5,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T1: for<'a> FunctionExecutor<
|
||||
(&'a RadixCiphertext, &'a RadixCiphertext),
|
||||
(RadixCiphertext, BooleanBlock),
|
||||
|
||||
@@ -53,7 +53,7 @@ pub(crate) type Log2OpExecutor =
|
||||
Box<dyn for<'a> FunctionExecutor<&'a RadixCiphertext, RadixCiphertext>>;
|
||||
fn random_op_sequence<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Clone,
|
||||
P: Into<TestParameters> + Clone,
|
||||
{
|
||||
// Binary Ops Executors
|
||||
let add_executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized);
|
||||
@@ -464,7 +464,7 @@ pub(crate) fn random_op_sequence_test<P>(
|
||||
)],
|
||||
log2_ops: &mut [(Log2OpExecutor, impl Fn(u64) -> u64, String)],
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let param = param.into();
|
||||
let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix);
|
||||
|
||||
@@ -22,7 +22,7 @@ create_parameterized_test!(no_cmux_erc20 {
|
||||
|
||||
fn whitepaper_erc20<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T1, T2, T3, T4>(
|
||||
mut if_then_else_executor: T3,
|
||||
mut sub_executor: T4,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T1: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
BooleanBlock,
|
||||
@@ -162,7 +162,7 @@ pub(crate) fn signed_no_cmux_erc20_test<P, T1, T2, T3, T4>(
|
||||
mut add_executor: T3,
|
||||
mut sub_executor: T4,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T1: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
BooleanBlock,
|
||||
|
||||
@@ -82,7 +82,7 @@ pub(crate) type SignedLog2OpExecutor =
|
||||
Box<dyn for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>>;
|
||||
fn random_op_sequence<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Clone,
|
||||
P: Into<TestParameters> + Clone,
|
||||
{
|
||||
// Binary Ops Executors
|
||||
let add_executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized);
|
||||
@@ -548,7 +548,7 @@ pub(crate) fn signed_random_op_sequence_test<P>(
|
||||
String,
|
||||
)],
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let param = param.into();
|
||||
let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix);
|
||||
|
||||
@@ -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<PBSParameters>) {
|
||||
fn integer_signed_encrypt_decrypt_128_bits(param: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn integer_signed_encrypt_decrypt(param: impl Into<PBSParameters>) {
|
||||
fn integer_signed_encrypt_decrypt(param: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
//================================================================================
|
||||
create_parameterized_test!(integer_signed_unchecked_scalar_div_rem_floor);
|
||||
|
||||
fn integer_signed_unchecked_scalar_div_rem_floor(param: impl Into<PBSParameters>) {
|
||||
fn integer_signed_unchecked_scalar_div_rem_floor(param: impl Into<TestParameters>) {
|
||||
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<PBSParameters>
|
||||
|
||||
create_parameterized_test!(integer_signed_default_scalar_div_rem);
|
||||
|
||||
fn integer_signed_default_scalar_div_rem(param: impl Into<PBSParameters>) {
|
||||
fn integer_signed_default_scalar_div_rem(param: impl Into<TestParameters>) {
|
||||
let (cks, mut sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix);
|
||||
sks.set_deterministic_pbs_execution(true);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ create_parameterized_test!(modulus_switch_compression_signed);
|
||||
|
||||
fn modulus_switch_compression_signed<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let size = 4;
|
||||
let (cks, sks) = gen_keys_radix(param, size);
|
||||
|
||||
@@ -21,7 +21,7 @@ create_parameterized_test!(integer_signed_smart_absolute_value);
|
||||
|
||||
fn integer_signed_default_absolute_value<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -96,7 +96,7 @@ where
|
||||
|
||||
pub(crate) fn signed_smart_absolute_value_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -73,7 +73,7 @@ create_parameterized_test!(
|
||||
|
||||
fn integer_signed_unchecked_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor =
|
||||
CpuFunctionExecutor::new(&ServerKey::unchecked_signed_overflowing_add_parallelized);
|
||||
@@ -98,7 +98,7 @@ where
|
||||
|
||||
fn integer_signed_default_overflowing_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(
|
||||
param: P,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(
|
||||
param: P,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
// 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
@@ -298,7 +298,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_overflowing_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
@@ -488,7 +488,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -538,7 +538,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -645,7 +645,7 @@ where
|
||||
|
||||
pub(crate) fn signed_smart_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a mut SignedRadixCiphertext, &'a mut SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
|
||||
@@ -26,7 +26,7 @@ create_parameterized_test!(integer_signed_default_bitxor);
|
||||
|
||||
fn integer_signed_unchecked_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitand_parallelized);
|
||||
signed_unchecked_bitand_test(param, executor);
|
||||
@@ -34,7 +34,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitor_parallelized);
|
||||
signed_unchecked_bitor_test(param, executor);
|
||||
@@ -42,7 +42,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitxor_parallelized);
|
||||
signed_unchecked_bitxor_test(param, executor);
|
||||
@@ -50,7 +50,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitnot<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitnot);
|
||||
signed_default_bitnot_test(param, executor);
|
||||
@@ -58,7 +58,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitand_parallelized);
|
||||
signed_default_bitand_test(param, executor);
|
||||
@@ -66,7 +66,7 @@ where
|
||||
|
||||
fn integer_signed_default_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitor_parallelized);
|
||||
signed_default_bitor_test(param, executor);
|
||||
@@ -74,14 +74,14 @@ where
|
||||
|
||||
fn integer_signed_default_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitxor_parallelized);
|
||||
signed_default_bitxor_test(param, executor);
|
||||
}
|
||||
pub(crate) fn signed_unchecked_bitand_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -114,7 +114,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_bitor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -147,7 +147,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_bitxor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -180,7 +180,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_bitnot_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -213,7 +213,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_bitand_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -270,7 +270,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_bitor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -327,7 +327,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_bitxor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
|
||||
@@ -24,7 +24,7 @@ create_parameterized_test!(integer_signed_block_shift_left);
|
||||
|
||||
fn integer_signed_block_shift_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -139,7 +139,7 @@ where
|
||||
|
||||
pub(crate) fn default_block_shift_right_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
|
||||
@@ -22,7 +22,7 @@ create_parameterized_test!(integer_signed_default_scalar_if_then_else);
|
||||
|
||||
fn integer_signed_unchecked_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let func =
|
||||
|sks: &ServerKey,
|
||||
@@ -43,7 +43,7 @@ where
|
||||
|
||||
fn integer_signed_default_scalar_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(
|
||||
&'a BooleanBlock,
|
||||
@@ -170,7 +170,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_scalar_if_then_else_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(
|
||||
&'a BooleanBlock,
|
||||
|
||||
@@ -26,7 +26,7 @@ pub(crate) fn test_signed_unchecked_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -105,7 +105,7 @@ pub(crate) fn test_signed_smart_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -195,7 +195,7 @@ pub(crate) fn test_signed_default_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -288,7 +288,7 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
::paste::paste!{
|
||||
// Fist we "specialialize" the test_signed fns
|
||||
|
||||
fn [<integer_signed_unchecked_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_unchecked_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<unchecked_ $comparison_name>]);
|
||||
test_signed_unchecked_function(
|
||||
@@ -299,7 +299,7 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_unchecked_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_unchecked_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<unchecked_ $comparison_name _parallelized>]);
|
||||
test_signed_unchecked_function(
|
||||
@@ -310,7 +310,7 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_smart_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_smart_ $comparison_name _ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<smart_ $comparison_name>]);
|
||||
test_signed_smart_function(
|
||||
@@ -321,7 +321,7 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_smart_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_smart_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<smart_ $comparison_name _parallelized>]);
|
||||
test_signed_smart_function(
|
||||
@@ -332,7 +332,7 @@ macro_rules! define_signed_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_default_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_signed_default_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<TestParameters> {
|
||||
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<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -514,7 +514,7 @@ pub(crate) fn test_signed_smart_minmax<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -604,7 +604,7 @@ pub(crate) fn test_signed_default_minmax<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -686,32 +686,32 @@ pub(crate) fn test_signed_default_minmax<P, T, ClearF, Scalar>(
|
||||
mod no_coverage {
|
||||
use super::*;
|
||||
|
||||
fn integer_signed_unchecked_min_parallelized_128_bits(params: impl Into<PBSParameters>) {
|
||||
fn integer_signed_unchecked_min_parallelized_128_bits(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_min_parallelized);
|
||||
test_signed_unchecked_minmax(params, 2, executor, std::cmp::min::<i128>)
|
||||
}
|
||||
|
||||
fn integer_signed_unchecked_max_parallelized_128_bits(params: impl Into<PBSParameters>) {
|
||||
fn integer_signed_unchecked_max_parallelized_128_bits(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_max_parallelized);
|
||||
test_signed_unchecked_minmax(params, 2, executor, std::cmp::max::<i128>)
|
||||
}
|
||||
|
||||
fn integer_signed_smart_min_parallelized_128_bits(params: impl Into<PBSParameters>) {
|
||||
fn integer_signed_smart_min_parallelized_128_bits(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_min_parallelized);
|
||||
test_signed_smart_minmax(params, 2, executor, std::cmp::min::<i128>);
|
||||
}
|
||||
|
||||
fn integer_signed_smart_max_parallelized_128_bits(params: impl Into<PBSParameters>) {
|
||||
fn integer_signed_smart_max_parallelized_128_bits(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_max_parallelized);
|
||||
test_signed_smart_minmax(params, 2, executor, std::cmp::max::<i128>);
|
||||
}
|
||||
|
||||
fn integer_signed_min_parallelized_128_bits(params: impl Into<PBSParameters>) {
|
||||
fn integer_signed_min_parallelized_128_bits(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::min_parallelized);
|
||||
test_signed_default_minmax(params, 2, executor, std::cmp::min::<i128>);
|
||||
}
|
||||
|
||||
fn integer_signed_max_parallelized_128_bits(params: impl Into<PBSParameters>) {
|
||||
fn integer_signed_max_parallelized_128_bits(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::max_parallelized);
|
||||
test_signed_default_minmax(params, 2, executor, std::cmp::max::<i128>);
|
||||
}
|
||||
@@ -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<PBSParameters>) {
|
||||
fn integer_extensive_trivial_signed_default_comparisons(params: impl Into<TestParameters>) {
|
||||
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, E1, E2, E3, E
|
||||
mut min_executor: E5,
|
||||
mut max_executor: E6,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
E1: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
BooleanBlock,
|
||||
|
||||
@@ -17,7 +17,7 @@ create_parameterized_test!(integer_signed_default_count_zeros_ones);
|
||||
|
||||
fn integer_extensive_trivial_signed_default_count_zeros_ones<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, E1, E2>(
|
||||
mut count_zeros_executor: E1,
|
||||
mut count_ones_executor: E2,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, E1, E2>(
|
||||
mut count_zeros_executor: E1,
|
||||
mut count_ones_executor: E2,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
E1: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>,
|
||||
E2: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>,
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ create_parameterized_test!(
|
||||
);
|
||||
fn integer_signed_unchecked_div_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, SignedRadixCiphertext),
|
||||
@@ -139,7 +139,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_div_rem_floor_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, SignedRadixCiphertext),
|
||||
|
||||
@@ -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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::leading_ones_parallelized);
|
||||
default_leading_ones_test(param, executor);
|
||||
@@ -70,7 +70,7 @@ where
|
||||
|
||||
fn integer_signed_default_ilog2<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::ilog2_parallelized);
|
||||
default_ilog2_test(param, executor);
|
||||
@@ -78,7 +78,7 @@ where
|
||||
|
||||
fn integer_signed_default_checked_ilog2<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(
|
||||
param: P,
|
||||
mut executor: T,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -207,7 +207,7 @@ pub(crate) fn signed_default_count_consecutive_bits_test<P, T>(
|
||||
|
||||
pub(crate) fn default_trailing_zeros_test<P, T>(param: P, executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -379,7 +379,7 @@ where
|
||||
|
||||
pub(crate) fn default_checked_ilog2_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, (RadixCiphertext, BooleanBlock)>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -40,7 +40,7 @@ create_parameterized_test!(
|
||||
|
||||
fn integer_signed_unchecked_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_mul_parallelized);
|
||||
signed_unchecked_mul_test(param, executor);
|
||||
@@ -48,13 +48,13 @@ where
|
||||
|
||||
fn integer_signed_default_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::mul_parallelized);
|
||||
signed_default_mul_test(param, executor);
|
||||
}
|
||||
|
||||
fn integer_signed_default_overflowing_mul(param: impl Into<PBSParameters>) {
|
||||
fn integer_signed_default_overflowing_mul(param: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
|
||||
pub(crate) fn signed_unchecked_mul_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -221,7 +221,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_mul_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
|
||||
@@ -21,7 +21,7 @@ create_parameterized_test!(integer_signed_default_neg);
|
||||
|
||||
fn integer_signed_unchecked_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_neg);
|
||||
signed_unchecked_neg_test(param, executor);
|
||||
@@ -29,7 +29,7 @@ where
|
||||
|
||||
fn integer_signed_smart_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_neg_parallelized);
|
||||
signed_smart_neg_test(param, executor);
|
||||
@@ -37,7 +37,7 @@ where
|
||||
|
||||
fn integer_signed_default_neg<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -98,7 +98,7 @@ where
|
||||
|
||||
pub(crate) fn signed_smart_neg_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a mut SignedRadixCiphertext, SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -136,7 +136,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_neg_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<&'a SignedRadixCiphertext, SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -28,7 +28,7 @@ create_parameterized_test!(integer_signed_rotate_left);
|
||||
|
||||
pub(crate) fn signed_default_rotate_left_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -122,7 +122,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_rotate_right_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -214,7 +214,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_rotate_left_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -273,7 +273,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_rotate_right_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -332,7 +332,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_rotate_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::rotate_left_parallelized);
|
||||
signed_default_rotate_left_test(param, executor);
|
||||
|
||||
@@ -24,7 +24,7 @@ create_parameterized_test!(integer_signed_default_overflowing_scalar_add);
|
||||
|
||||
fn integer_signed_unchecked_scalar_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, i64),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
|
||||
@@ -21,7 +21,7 @@ create_parameterized_test!(integer_signed_default_scalar_bitxor);
|
||||
|
||||
fn integer_signed_default_scalar_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::scalar_bitxor_parallelized);
|
||||
signed_default_scalar_bitxor_test(param, executor);
|
||||
}
|
||||
pub(crate) fn signed_default_scalar_bitand_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -25,7 +25,7 @@ pub(crate) fn test_signed_unchecked_scalar_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto<u64> + From<bool>,
|
||||
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<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -158,7 +158,7 @@ pub(crate) fn test_signed_default_scalar_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric
|
||||
+ RecomposableSignedInteger
|
||||
+ DecomposableInto<u64>
|
||||
@@ -231,7 +231,7 @@ pub(crate) fn test_signed_default_scalar_function<P, T, ClearF, Scalar>(
|
||||
macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
($comparison_name:ident, $clear_type:ty) => {
|
||||
::paste::paste!{
|
||||
fn [<integer_signed_unchecked_scalar_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<PBSParameters>{
|
||||
fn [<integer_signed_unchecked_scalar_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<TestParameters>{
|
||||
let num_tests = 2;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<unchecked_scalar_ $comparison_name _parallelized>]);
|
||||
test_signed_unchecked_scalar_function(
|
||||
@@ -242,7 +242,7 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_smart_scalar_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<PBSParameters>{
|
||||
fn [<integer_signed_smart_scalar_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<TestParameters>{
|
||||
let num_tests = 2;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<smart_scalar_ $comparison_name _parallelized>]);
|
||||
test_signed_smart_scalar_function(
|
||||
@@ -253,7 +253,7 @@ macro_rules! define_signed_scalar_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_signed_default_scalar_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<PBSParameters>{
|
||||
fn [<integer_signed_default_scalar_ $comparison_name _parallelized_ $clear_type>]<P>(param: P) where P: Into<TestParameters>{
|
||||
let num_tests = 2;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<scalar_ $comparison_name _parallelized>]);
|
||||
test_signed_default_scalar_function(
|
||||
@@ -384,7 +384,7 @@ pub(crate) fn test_signed_unchecked_scalar_minmax<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto<u64>,
|
||||
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<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto<u64> + 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<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: SignedNumeric + RecomposableSignedInteger + DecomposableInto<u64> + 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<PBSParameters>) {
|
||||
fn integer_extensive_trivial_signed_default_scalar_comparisons(params: impl Into<TestParameters>) {
|
||||
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, E1, E2
|
||||
mut min_executor: E5,
|
||||
mut max_executor: E6,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
E1: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i128), BooleanBlock>,
|
||||
E2: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i128), BooleanBlock>,
|
||||
E3: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i128), BooleanBlock>,
|
||||
|
||||
@@ -20,7 +20,7 @@ create_parameterized_test!(integer_signed_unchecked_scalar_div_rem);
|
||||
|
||||
fn integer_signed_unchecked_scalar_div_rem<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, i64),
|
||||
(SignedRadixCiphertext, SignedRadixCiphertext),
|
||||
|
||||
@@ -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<PBSParameters>) {
|
||||
fn signed_unchecked_boolean_scalar_dot_prod(params: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
fn signed_smart_boolean_scalar_dot_prod(params: impl Into<TestParameters>) {
|
||||
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<PBSParameters>) {
|
||||
fn signed_boolean_scalar_dot_prod(params: impl Into<TestParameters>) {
|
||||
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<P, E>(
|
||||
params: P,
|
||||
mut dot_prod_executor: E,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, E>(
|
||||
params: P,
|
||||
mut dot_prod_executor: E,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, E>(
|
||||
params: P,
|
||||
mut dot_prod_executor: E,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
E: for<'a> FunctionExecutor<(&'a [BooleanBlock], &'a [i64], u32), SignedRadixCiphertext>,
|
||||
{
|
||||
let params = params.into();
|
||||
|
||||
@@ -17,7 +17,7 @@ create_parameterized_test!(integer_signed_unchecked_scalar_mul);
|
||||
|
||||
fn integer_signed_unchecked_scalar_mul<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -23,7 +23,7 @@ create_parameterized_test!(integer_signed_default_scalar_rotate_right);
|
||||
|
||||
fn integer_signed_unchecked_scalar_rotate_left<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -23,7 +23,7 @@ create_parameterized_test!(integer_signed_default_scalar_right_shift);
|
||||
|
||||
fn integer_signed_unchecked_scalar_left_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a SignedRadixCiphertext, i64), SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -26,7 +26,7 @@ create_parameterized_test!(integer_signed_default_left_scalar_sub);
|
||||
|
||||
fn integer_signed_unchecked_scalar_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, i64),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
@@ -292,7 +292,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_left_scalar_sub_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(i64, &'a SignedRadixCiphertext), SignedRadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -26,7 +26,7 @@ create_parameterized_test!(integer_signed_right_shift);
|
||||
|
||||
pub(crate) fn signed_default_left_shift_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -117,7 +117,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_right_shift_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -208,7 +208,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_left_shift_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -270,7 +270,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_right_shift_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a RadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -331,7 +331,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_right_shift<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + Copy,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::left_shift_parallelized);
|
||||
signed_default_left_shift_test(param, executor);
|
||||
|
||||
@@ -46,7 +46,7 @@ create_parameterized_test!(integer_extensive_trivial_signed_default_overflowing_
|
||||
|
||||
fn integer_signed_unchecked_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_sub);
|
||||
signed_unchecked_sub_test(param, executor);
|
||||
@@ -54,7 +54,7 @@ where
|
||||
|
||||
fn integer_signed_unchecked_overflowing_sub<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
@@ -262,7 +262,7 @@ where
|
||||
|
||||
pub(crate) fn signed_unchecked_overflowing_sub_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
@@ -384,7 +384,7 @@ pub(crate) fn extensive_trivial_signed_default_overflowing_sub_test<P, T>(
|
||||
param: P,
|
||||
mut overflowing_sub_executor: T,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
(SignedRadixCiphertext, BooleanBlock),
|
||||
@@ -436,7 +436,7 @@ pub(crate) fn extensive_trivial_signed_default_overflowing_sub_test<P, T>(
|
||||
|
||||
pub(crate) fn signed_unchecked_sub_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
@@ -486,7 +486,7 @@ where
|
||||
|
||||
pub(crate) fn signed_default_sub_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut sub_executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a SignedRadixCiphertext, &'a SignedRadixCiphertext),
|
||||
SignedRadixCiphertext,
|
||||
|
||||
@@ -18,7 +18,7 @@ create_parameterized_test!(integer_signed_default_all_eq_slices_test_case);
|
||||
|
||||
fn integer_signed_unchecked_all_eq_slices_test_case<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, E>(params: P, mut executor: E)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
E: for<'a> FunctionExecutor<
|
||||
(&'a [SignedRadixCiphertext], &'a [SignedRadixCiphertext]),
|
||||
BooleanBlock,
|
||||
@@ -50,7 +50,7 @@ where
|
||||
|
||||
fn integer_signed_default_all_eq_slices_test_case<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, E>(params: P, mut executor: E)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
E: for<'a> FunctionExecutor<
|
||||
(&'a [SignedRadixCiphertext], &'a [SignedRadixCiphertext]),
|
||||
BooleanBlock,
|
||||
|
||||
@@ -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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::full_propagate_parallelized);
|
||||
full_propagate_test(param, executor);
|
||||
|
||||
@@ -12,7 +12,7 @@ create_parameterized_test!(modulus_switch_compression);
|
||||
|
||||
fn modulus_switch_compression<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let size = 4;
|
||||
let (cks, sks) = gen_keys_radix(param, size);
|
||||
|
||||
@@ -63,7 +63,7 @@ create_parameterized_test!(
|
||||
|
||||
fn integer_unchecked_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_add_parallelized);
|
||||
unchecked_add_test(param, executor);
|
||||
@@ -71,7 +71,7 @@ where
|
||||
|
||||
fn integer_unchecked_add_assign<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_add_assign_parallelized);
|
||||
unchecked_add_assign_test(param, executor);
|
||||
@@ -79,7 +79,7 @@ where
|
||||
|
||||
fn integer_smart_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_add_parallelized);
|
||||
smart_add_test(param, executor);
|
||||
@@ -87,7 +87,7 @@ where
|
||||
|
||||
fn integer_default_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::add_parallelized);
|
||||
default_add_test(param, executor);
|
||||
@@ -95,7 +95,7 @@ where
|
||||
|
||||
fn integer_extensive_trivial_default_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
// 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
// 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let func = |sks: &ServerKey, lhs: &RadixCiphertext, rhs: &RadixCiphertext| {
|
||||
let mut result = lhs.clone();
|
||||
@@ -231,7 +231,7 @@ where
|
||||
|
||||
fn integer_default_overflowing_add<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a mut RadixCiphertext, &'a RadixCiphertext), ()>,
|
||||
{
|
||||
let param = param.into();
|
||||
@@ -387,7 +387,7 @@ where
|
||||
|
||||
pub(crate) fn smart_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a mut RadixCiphertext, &'a mut RadixCiphertext),
|
||||
RadixCiphertext,
|
||||
@@ -447,7 +447,7 @@ where
|
||||
|
||||
pub(crate) fn default_add_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(&'a RadixCiphertext, &'a RadixCiphertext),
|
||||
(RadixCiphertext, BooleanBlock),
|
||||
|
||||
@@ -25,7 +25,7 @@ create_parameterized_test!(integer_unchecked_bitxor);
|
||||
|
||||
fn integer_smart_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitand_parallelized);
|
||||
smart_bitand_test(param, executor);
|
||||
@@ -33,7 +33,7 @@ where
|
||||
|
||||
fn integer_smart_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitor_parallelized);
|
||||
smart_bitor_test(param, executor);
|
||||
@@ -41,7 +41,7 @@ where
|
||||
|
||||
fn integer_smart_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_bitxor_parallelized);
|
||||
smart_bitxor_test(param, executor);
|
||||
@@ -49,7 +49,7 @@ where
|
||||
|
||||
fn integer_default_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitand_parallelized);
|
||||
default_bitand_test(param, executor);
|
||||
@@ -57,7 +57,7 @@ where
|
||||
|
||||
fn integer_default_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitor_parallelized);
|
||||
default_bitor_test(param, executor);
|
||||
@@ -65,7 +65,7 @@ where
|
||||
|
||||
fn integer_default_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitxor_parallelized);
|
||||
default_bitxor_test(param, executor);
|
||||
@@ -73,7 +73,7 @@ where
|
||||
|
||||
fn integer_default_bitnot<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitnot);
|
||||
default_bitnot_test(param, executor);
|
||||
@@ -81,7 +81,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitand<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitand_parallelized);
|
||||
unchecked_bitand_test(param, executor);
|
||||
@@ -89,7 +89,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitor_parallelized);
|
||||
unchecked_bitor_test(param, executor);
|
||||
@@ -97,7 +97,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitxor<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_bitxor_parallelized);
|
||||
unchecked_bitxor_test(param, executor);
|
||||
@@ -105,7 +105,7 @@ where
|
||||
|
||||
fn integer_unchecked_bitnot<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::bitnot);
|
||||
unchecked_bitnot_test(param, executor);
|
||||
|
||||
@@ -19,7 +19,7 @@ create_parameterized_test!(integer_block_rotate_left);
|
||||
|
||||
fn integer_block_rotate_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -19,7 +19,7 @@ create_parameterized_test!(integer_block_shift_left);
|
||||
|
||||
fn integer_block_shift_right<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters> + Copy,
|
||||
P: Into<TestParameters> + 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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a RadixCiphertext, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -20,7 +20,7 @@ create_parameterized_test!(integer_default_scalar_if_then_else);
|
||||
|
||||
fn integer_unchecked_left_scalar_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
fn func(
|
||||
sks: &ServerKey,
|
||||
@@ -36,7 +36,7 @@ where
|
||||
|
||||
fn integer_smart_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
let func =
|
||||
|sks: &ServerKey, cond: &BooleanBlock, lhs: &RadixCiphertext, rhs: &RadixCiphertext| {
|
||||
@@ -56,7 +56,7 @@ where
|
||||
|
||||
fn integer_default_scalar_if_then_else<P>(param: P)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
{
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<
|
||||
(
|
||||
&'a mut BooleanBlock,
|
||||
@@ -134,7 +134,7 @@ where
|
||||
|
||||
pub(crate) fn default_if_then_else_test<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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<P, T>(param: P, mut executor: T)
|
||||
where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
T: for<'a> FunctionExecutor<(&'a BooleanBlock, u64, &'a RadixCiphertext), RadixCiphertext>,
|
||||
{
|
||||
let param = param.into();
|
||||
|
||||
@@ -25,7 +25,7 @@ pub(crate) fn test_unchecked_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: UnsignedNumeric
|
||||
+ AddAssign<Scalar>
|
||||
+ DecomposableInto<u64>
|
||||
@@ -86,7 +86,7 @@ pub(crate) fn test_smart_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: UnsignedNumeric
|
||||
+ AddAssign<Scalar>
|
||||
+ DecomposableInto<u64>
|
||||
@@ -173,7 +173,7 @@ pub(crate) fn test_default_function<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: UnsignedNumeric
|
||||
+ AddAssign<Scalar>
|
||||
+ DecomposableInto<u64>
|
||||
@@ -262,7 +262,7 @@ pub(crate) fn test_default_function<P, T, ClearF, Scalar>(
|
||||
macro_rules! define_comparison_test_functions {
|
||||
($comparison_name:ident, $clear_type:ty) => {
|
||||
::paste::paste!{
|
||||
fn [<integer_unchecked_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters>{
|
||||
fn [<integer_unchecked_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters>{
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<unchecked_ $comparison_name>]);
|
||||
test_unchecked_function(
|
||||
@@ -273,7 +273,7 @@ macro_rules! define_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_unchecked_ $comparison_name _parallelized_ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_unchecked_ $comparison_name _parallelized_ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<unchecked_ $comparison_name _parallelized>]);
|
||||
test_unchecked_function(
|
||||
@@ -284,7 +284,7 @@ macro_rules! define_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_smart_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_smart_ $comparison_name _ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<smart_ $comparison_name>]);
|
||||
test_smart_function(
|
||||
@@ -295,7 +295,7 @@ macro_rules! define_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_smart_ $comparison_name _parallelized_ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_smart_ $comparison_name _parallelized_ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
let num_tests = 1;
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::[<smart_ $comparison_name _parallelized>]);
|
||||
test_smart_function(
|
||||
@@ -306,7 +306,7 @@ macro_rules! define_comparison_test_functions {
|
||||
)
|
||||
}
|
||||
|
||||
fn [<integer_default_ $comparison_name _parallelized_ $clear_type:lower>]<P>(param: P) where P: Into<PBSParameters> {
|
||||
fn [<integer_default_ $comparison_name _parallelized_ $clear_type:lower>]<P>(param: P) where P: Into<TestParameters> {
|
||||
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<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: UnsignedNumeric
|
||||
+ AddAssign<Scalar>
|
||||
+ DecomposableInto<u64>
|
||||
@@ -466,7 +466,7 @@ pub(crate) fn test_smart_minmax<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: UnsignedNumeric
|
||||
+ AddAssign<Scalar>
|
||||
+ DecomposableInto<u64>
|
||||
@@ -556,7 +556,7 @@ pub(crate) fn test_default_minmax<P, T, ClearF, Scalar>(
|
||||
mut executor: T,
|
||||
clear_fn: ClearF,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
Scalar: UnsignedNumeric
|
||||
+ AddAssign<Scalar>
|
||||
+ DecomposableInto<u64>
|
||||
@@ -636,32 +636,32 @@ pub(crate) fn test_default_minmax<P, T, ClearF, Scalar>(
|
||||
mod no_coverage {
|
||||
use super::*;
|
||||
|
||||
fn integer_unchecked_min_parallelized_u256(params: impl Into<PBSParameters>) {
|
||||
fn integer_unchecked_min_parallelized_u256(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_min_parallelized);
|
||||
test_unchecked_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
}
|
||||
|
||||
fn integer_unchecked_max_parallelized_u256(params: impl Into<PBSParameters>) {
|
||||
fn integer_unchecked_max_parallelized_u256(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::unchecked_max_parallelized);
|
||||
test_unchecked_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
}
|
||||
|
||||
fn integer_smart_min_parallelized_u256(params: impl Into<PBSParameters>) {
|
||||
fn integer_smart_min_parallelized_u256(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_min_parallelized);
|
||||
test_smart_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
}
|
||||
|
||||
fn integer_smart_max_parallelized_u256(params: impl Into<PBSParameters>) {
|
||||
fn integer_smart_max_parallelized_u256(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::smart_max_parallelized);
|
||||
test_smart_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
}
|
||||
|
||||
fn integer_min_parallelized_u256(params: impl Into<PBSParameters>) {
|
||||
fn integer_min_parallelized_u256(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::min_parallelized);
|
||||
test_default_minmax(params, 2, executor, std::cmp::min::<U256>);
|
||||
}
|
||||
|
||||
fn integer_max_parallelized_u256(params: impl Into<PBSParameters>) {
|
||||
fn integer_max_parallelized_u256(params: impl Into<TestParameters>) {
|
||||
let executor = CpuFunctionExecutor::new(&ServerKey::max_parallelized);
|
||||
test_default_minmax(params, 2, executor, std::cmp::max::<U256>);
|
||||
}
|
||||
@@ -762,7 +762,7 @@ mod coverage {
|
||||
|
||||
create_parameterized_test!(integer_extensive_trivial_default_comparisons);
|
||||
|
||||
fn integer_extensive_trivial_default_comparisons(params: impl Into<PBSParameters>) {
|
||||
fn integer_extensive_trivial_default_comparisons(params: impl Into<TestParameters>) {
|
||||
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, E1, E2, E3, E4, E5,
|
||||
mut min_executor: E5,
|
||||
mut max_executor: E6,
|
||||
) where
|
||||
P: Into<PBSParameters>,
|
||||
P: Into<TestParameters>,
|
||||
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>,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user