mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-07 22:04:10 -05:00
chore: update toolchain to 2025-04-28
This commit is contained in:
@@ -66,7 +66,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
assert!(a.len() % 8 == 0);
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:02X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:02X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
@@ -74,7 +74,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
fn get_hexagonal_string_from_u64(a: Vec<u64>) -> String {
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:016X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:016X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ impl<const N: usize, T> Index<usize> for StaticDeque<N, T> {
|
||||
/// 0 is youngest
|
||||
fn index(&self, i: usize) -> &T {
|
||||
if i >= N {
|
||||
panic!("Index {:?} too high for size {:?}", i, N);
|
||||
panic!("Index {i:?} too high for size {N:?}");
|
||||
}
|
||||
&self.arr[(N + self.cursor - i - 1) % N]
|
||||
}
|
||||
@@ -66,7 +66,7 @@ impl<const N: usize, T> IndexMut<usize> for StaticDeque<N, T> {
|
||||
/// 0 is youngest
|
||||
fn index_mut(&mut self, i: usize) -> &mut T {
|
||||
if i >= N {
|
||||
panic!("Index {:?} too high for size {:?}", i, N);
|
||||
panic!("Index {i:?} too high for size {N:?}");
|
||||
}
|
||||
&mut self.arr[(N + self.cursor - i - 1) % N]
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
assert!(a.len() % 8 == 0);
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:02X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:02X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
@@ -74,7 +74,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
fn get_hexagonal_string_from_u64(a: Vec<u64>) -> String {
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:016X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:016X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ fn main() {
|
||||
};
|
||||
let mut headers_modified = bindings_modified;
|
||||
for header in headers {
|
||||
println!("cargo:rerun-if-changed={}", header);
|
||||
println!("cargo:rerun-if-changed={header}");
|
||||
// Check modification times
|
||||
let header_modified = std::fs::metadata(header).unwrap().modified().unwrap();
|
||||
if header_modified > headers_modified {
|
||||
|
||||
@@ -277,8 +277,7 @@ pub fn test_hl_clientkey(
|
||||
if test_params != key_params {
|
||||
Err(test.failure(
|
||||
format!(
|
||||
"Invalid {} parameters:\n Expected :\n{:?}\nGot:\n{:?}",
|
||||
format, test_params, key_params
|
||||
"Invalid {format} parameters:\n Expected :\n{test_params:?}\nGot:\n{key_params:?}",
|
||||
),
|
||||
format,
|
||||
))
|
||||
@@ -327,8 +326,7 @@ pub fn test_hl_pubkey(
|
||||
if decrypted != value {
|
||||
Err(test.failure(
|
||||
format!(
|
||||
"Failed to decrypt value encrypted with public key, got {} expected {}",
|
||||
decrypted, value
|
||||
"Failed to decrypt value encrypted with public key, got {decrypted} expected {value}",
|
||||
),
|
||||
format,
|
||||
))
|
||||
|
||||
@@ -74,9 +74,9 @@ fn run_test<M: TestedModule>(
|
||||
let test_result = M::run_test(test_dir, testcase, format);
|
||||
|
||||
match &test_result {
|
||||
TestResult::Success(r) => println!("{}", r),
|
||||
TestResult::Failure(r) => println!("{}", r),
|
||||
TestResult::Skipped(r) => println!("{}", r),
|
||||
TestResult::Success(r) => println!("{r}"),
|
||||
TestResult::Failure(r) => println!("{r}"),
|
||||
TestResult::Skipped(r) => println!("{r}"),
|
||||
}
|
||||
|
||||
test_result
|
||||
|
||||
@@ -20,9 +20,8 @@ impl AesBlockCipher for AesniBlockCipher {
|
||||
if !(aes_detected && sse2_detected) {
|
||||
panic!(
|
||||
"The AesniBlockCipher requires both aes and sse2 x86 CPU features.\n\
|
||||
aes feature available: {}\nsse2 feature available: {}\n\
|
||||
aes feature available: {aes_detected}\nsse2 feature available: {sse2_detected}\n\
|
||||
Please consider enabling the SoftwareRandomGenerator with the `software-prng` feature",
|
||||
aes_detected, sse2_detected
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ mod test {
|
||||
Compress::Yes => Params::uncompress(bincode::deserialize(&bincode::serialize(
|
||||
&public_params.compress(),
|
||||
)?)?)
|
||||
.map_err(|e| Box::new(ErrorKind::Custom(format!("Failed to uncompress: {}", e)))),
|
||||
.map_err(|e| Box::new(ErrorKind::Custom(format!("Failed to uncompress: {e}")))),
|
||||
Compress::No => bincode::deserialize(&bincode::serialize(&public_params)?),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ impl Display for InvalidSerializedAffineError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
InvalidSerializedAffineError::InvalidFp(fp_error) => {
|
||||
write!(f, "Invalid fp element in affine: {}", fp_error)
|
||||
write!(f, "Invalid fp element in affine: {fp_error}")
|
||||
}
|
||||
InvalidSerializedAffineError::InvalidCompressedXCoordinate => {
|
||||
write!(
|
||||
@@ -262,10 +262,10 @@ impl Display for InvalidSerializedGroupElementsError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
InvalidSerializedGroupElementsError::InvalidAffine(affine_error) => {
|
||||
write!(f, "Invalid Affine in GroupElement: {}", affine_error)
|
||||
write!(f, "Invalid Affine in GroupElement: {affine_error}")
|
||||
}
|
||||
InvalidSerializedGroupElementsError::InvalidGlistDimension(arr_error) => {
|
||||
write!(f, "invalid number of elements in g_list: {}", arr_error)
|
||||
write!(f, "invalid number of elements in g_list: {arr_error}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,10 +357,10 @@ impl Display for InvalidSerializedPublicParamsError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
InvalidSerializedPublicParamsError::InvalidGroupElements(group_error) => {
|
||||
write!(f, "Invalid PublicParams: {}", group_error)
|
||||
write!(f, "Invalid PublicParams: {group_error}")
|
||||
}
|
||||
InvalidSerializedPublicParamsError::InvalidHashDimension(arr_error) => {
|
||||
write!(f, "invalid size of hash: {}", arr_error)
|
||||
write!(f, "invalid size of hash: {arr_error}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,9 +875,7 @@ fn bench_server_key_binary_scalar_function_clean_inputs<F, G>(
|
||||
let clear_1 = rng_func(&mut rng, bit_size);
|
||||
assert!(
|
||||
range.contains(&clear_1),
|
||||
"{:?} is not within the range {:?}",
|
||||
clear_1,
|
||||
range
|
||||
"{clear_1:?} is not within the range {range:?}",
|
||||
);
|
||||
|
||||
(ct_0, clear_1)
|
||||
@@ -916,9 +914,7 @@ fn bench_server_key_binary_scalar_function_clean_inputs<F, G>(
|
||||
let clear_1 = rng_func(&mut rng, bit_size);
|
||||
assert!(
|
||||
range.contains(&clear_1),
|
||||
"{:?} is not within the range {:?}",
|
||||
clear_1,
|
||||
range
|
||||
"{clear_1:?} is not within the range {range:?}",
|
||||
);
|
||||
clear_1
|
||||
})
|
||||
|
||||
@@ -107,7 +107,7 @@ fn main() {
|
||||
match ops() {
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
println!("correctness of operations is not guaranteed due to error: {}", e);
|
||||
println!("correctness of operations is not guaranteed due to error: {e}");
|
||||
return;
|
||||
},
|
||||
}
|
||||
|
||||
@@ -135,14 +135,14 @@ fn main() {
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
|
||||
let mode = ParityMode::Even;
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
}
|
||||
```
|
||||
@@ -348,7 +348,7 @@ fn main() {
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
assert_eq!(decrypted_parity_bit, clear_parity_bit);
|
||||
|
||||
@@ -357,7 +357,7 @@ fn main() {
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
assert_eq!(decrypted_parity_bit, clear_parity_bit);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fn build_branches(
|
||||
re: &RegExpr,
|
||||
c_pos: usize,
|
||||
) -> Vec<(LazyExecution, usize)> {
|
||||
trace!("program pointer: regex={:?}, content pos={}", re, c_pos);
|
||||
trace!("program pointer: regex={re:?}, content pos={c_pos}");
|
||||
match re {
|
||||
RegExpr::Sof => {
|
||||
if c_pos == 0 {
|
||||
|
||||
@@ -241,7 +241,7 @@ impl std::fmt::Debug for Executed {
|
||||
1 => write!(f, "t"),
|
||||
_ => write!(f, "{}", u8_to_char(*c)),
|
||||
},
|
||||
Self::CtPos { at } => write!(f, "ct_{}", at),
|
||||
Self::CtPos { at } => write!(f, "ct_{at}"),
|
||||
Self::And { a, b } => {
|
||||
write!(f, "(")?;
|
||||
a.fmt(f)?;
|
||||
|
||||
@@ -119,7 +119,7 @@ impl fmt::Debug for RegExpr {
|
||||
at_most,
|
||||
} => {
|
||||
let stringify_opt_n = |opt_n: &Option<usize>| -> String {
|
||||
opt_n.map_or("*".to_string(), |n| format!("{:?}", n))
|
||||
opt_n.map_or("*".to_string(), |n| format!("{n:?}"))
|
||||
};
|
||||
repeat_re.fmt(f)?;
|
||||
write!(
|
||||
|
||||
@@ -33,7 +33,7 @@ fn main() {
|
||||
|
||||
input = input.trim_end_matches('\n').to_string();
|
||||
|
||||
println!("You entered: \"{}\"", input);
|
||||
println!("You entered: \"{input}\"");
|
||||
|
||||
// CLIENT PADS DATA AND ENCRYPTS IT
|
||||
|
||||
@@ -52,7 +52,7 @@ fn main() {
|
||||
let output = decrypt_bools(&encrypted_output, &ck);
|
||||
let outhex = bools_to_hex(output);
|
||||
|
||||
println!("{}", outhex);
|
||||
println!("{outhex}");
|
||||
}
|
||||
|
||||
fn encrypt_bools(bools: &Vec<bool>, ck: &ClientKey) -> Vec<Ciphertext> {
|
||||
|
||||
@@ -12,7 +12,7 @@ pub fn pad_sha256_input(input: &str) -> Vec<bool> {
|
||||
// hex value can be converted to bytes
|
||||
no_prefix.to_string()
|
||||
} else {
|
||||
format!("0{}", no_prefix) // pad hex value to ensure a correct conversion to bytes
|
||||
format!("0{no_prefix}") // pad hex value to ensure a correct conversion to bytes
|
||||
};
|
||||
hex_input
|
||||
.as_bytes()
|
||||
|
||||
@@ -158,7 +158,7 @@ pub fn bools_to_hex(bools: Vec<bool>) -> String {
|
||||
counter += 1;
|
||||
|
||||
if counter == 8 {
|
||||
hex_string.push_str(&format!("{:02x}", byte));
|
||||
hex_string.push_str(&format!("{byte:02x}"));
|
||||
byte = 0;
|
||||
counter = 0;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ pub fn bools_to_hex(bools: Vec<bool>) -> String {
|
||||
// Handle any remaining bits in case the bools vector length is not a multiple of 8
|
||||
if counter > 0 {
|
||||
byte <<= 8 - counter;
|
||||
hex_string.push_str(&format!("{:02x}", byte));
|
||||
hex_string.push_str(&format!("{byte:02x}"));
|
||||
}
|
||||
|
||||
hex_string
|
||||
|
||||
@@ -78,7 +78,7 @@ pub fn cpk_and_cctl_sizes(results_file: &Path) {
|
||||
.build();
|
||||
let cctl_size = bincode::serialize(&encrypted_inputs).unwrap().len();
|
||||
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {} bytes", cctl_size);
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {cctl_size} bytes");
|
||||
|
||||
write_result(&mut file, &test_name, cctl_size);
|
||||
write_to_json::<u64, _>(
|
||||
@@ -124,7 +124,7 @@ pub fn cpk_and_cctl_sizes(results_file: &Path) {
|
||||
.build();
|
||||
let cctl_size = bincode::serialize(&encrypted_inputs).unwrap().len();
|
||||
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {} bytes", cctl_size);
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {cctl_size} bytes");
|
||||
|
||||
write_result(&mut file, &test_name, cctl_size);
|
||||
write_to_json::<u64, _>(
|
||||
|
||||
@@ -351,14 +351,14 @@ fn write_all_params_in_file<U: UnsignedInteger, T: ParamDetails<U> + Copy + Name
|
||||
let (ref_param, ref_param_name) = &group[0];
|
||||
let formatted_param = match key.parameters_format {
|
||||
ParametersFormat::Lwe => {
|
||||
param_names_augmented.push(format!("{}_LWE", ref_param_name));
|
||||
param_names_augmented.push(format!("{ref_param_name}_LWE"));
|
||||
format_lwe_parameters_to_lattice_estimator(
|
||||
(ref_param, ref_param_name.as_str()),
|
||||
&similar_params,
|
||||
)
|
||||
}
|
||||
ParametersFormat::Glwe => {
|
||||
param_names_augmented.push(format!("{}_GLWE", ref_param_name));
|
||||
param_names_augmented.push(format!("{ref_param_name}_GLWE"));
|
||||
format_glwe_parameters_to_lattice_estimator(
|
||||
(ref_param, ref_param_name.as_str()),
|
||||
&similar_params,
|
||||
|
||||
@@ -139,7 +139,7 @@ fn measure_serialized_size<T: serde::Serialize, P: Into<CryptoParametersRecord<u
|
||||
) {
|
||||
let serialized = bincode::serialize(to_serialize).unwrap();
|
||||
let size = serialized.len();
|
||||
let test_name = format!("shortint_key_sizes_{}_{}", param_name, test_name_suffix);
|
||||
let test_name = format!("shortint_key_sizes_{param_name}_{test_name_suffix}");
|
||||
write_result(file, &test_name, size);
|
||||
write_to_json::<u64, _>(
|
||||
&test_name,
|
||||
@@ -151,10 +151,7 @@ fn measure_serialized_size<T: serde::Serialize, P: Into<CryptoParametersRecord<u
|
||||
vec![],
|
||||
);
|
||||
|
||||
println!(
|
||||
"{} {} -> size: {} bytes",
|
||||
test_name_suffix, param_name, size,
|
||||
);
|
||||
println!("{test_name_suffix} {param_name} -> size: {size} bytes",);
|
||||
}
|
||||
|
||||
fn tuniform_key_set_sizes(results_file: &Path) {
|
||||
|
||||
@@ -55,7 +55,7 @@ pub fn parse_wasm_benchmarks(results_file: &Path, raw_results_file: &Path) {
|
||||
let name_parts = full_name.split("_mean_").collect::<Vec<_>>();
|
||||
let bench_name = name_parts[0];
|
||||
let params: PBSParameters = params_from_name(name_parts[1]).into();
|
||||
println!("{:?}", name_parts);
|
||||
println!("{name_parts:?}");
|
||||
if bench_name.contains("_size") {
|
||||
write_result(&mut file, &prefixed_full_name, *val as usize);
|
||||
} else {
|
||||
|
||||
@@ -157,7 +157,7 @@ pub unsafe fn programmable_bootstrap_async<T: UnsignedInteger>(
|
||||
lwe_array_in.as_c_ptr(0),
|
||||
lwe_in_indexes.as_c_ptr(0),
|
||||
bootstrapping_key.as_c_ptr(0),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
ms_noise_reduction_ptr,
|
||||
pbs_buffer,
|
||||
lwe_dimension.0 as u32,
|
||||
@@ -226,7 +226,7 @@ pub unsafe fn programmable_bootstrap_128_async<T: UnsignedInteger>(
|
||||
test_vector.as_c_ptr(0),
|
||||
lwe_array_in.as_c_ptr(0),
|
||||
bootstrapping_key.as_c_ptr(0),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
ms_noise_reduction_ptr,
|
||||
pbs_buffer,
|
||||
lwe_dimension.0 as u32,
|
||||
@@ -616,9 +616,9 @@ pub unsafe fn add_lwe_ciphertext_vector_async<T: UnsignedInteger>(
|
||||
cuda_add_lwe_ciphertext_vector_64(
|
||||
streams.ptr[0],
|
||||
streams.gpu_indexes[0].get(),
|
||||
&mut lwe_array_out_data,
|
||||
&lwe_array_in_1_data,
|
||||
&lwe_array_in_2_data,
|
||||
&raw mut lwe_array_out_data,
|
||||
&raw const lwe_array_in_1_data,
|
||||
&raw const lwe_array_in_2_data,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -658,9 +658,9 @@ pub unsafe fn add_lwe_ciphertext_vector_assign_async<T: UnsignedInteger>(
|
||||
cuda_add_lwe_ciphertext_vector_64(
|
||||
streams.ptr[0],
|
||||
streams.gpu_indexes[0].get(),
|
||||
&mut lwe_array_out_data,
|
||||
&lwe_array_out_data,
|
||||
&lwe_array_in_data,
|
||||
&raw mut lwe_array_out_data,
|
||||
&raw const lwe_array_out_data,
|
||||
&raw const lwe_array_in_data,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -616,7 +616,7 @@ pub unsafe fn expand_async<T: UnsignedInteger, B: Numeric>(
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
computing_ks_key.ptr.as_ptr(),
|
||||
casting_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_expand_without_verification_64(
|
||||
streams.ptr.as_ptr(),
|
||||
|
||||
@@ -275,7 +275,7 @@ pub unsafe fn scalar_addition_integer_radix_assign_async<T: UnsignedInteger>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_lwe_array,
|
||||
&raw mut cuda_ffi_lwe_array,
|
||||
scalar_input.as_c_ptr(0),
|
||||
h_scalar_input.as_ptr().cast::<std::ffi::c_void>(),
|
||||
num_scalars,
|
||||
@@ -374,13 +374,13 @@ pub unsafe fn unchecked_scalar_mul_integer_radix_kb_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_lwe_array,
|
||||
&raw mut cuda_ffi_lwe_array,
|
||||
decomposed_scalar.as_ptr().cast::<u64>(),
|
||||
has_at_least_one_set.as_ptr().cast::<u64>(),
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
polynomial_size.0 as u32,
|
||||
message_modulus.0 as u32,
|
||||
num_scalars,
|
||||
@@ -631,9 +631,9 @@ pub unsafe fn unchecked_add_integer_radix_assign_async(
|
||||
cuda_add_lwe_ciphertext_vector_64(
|
||||
streams.ptr[0],
|
||||
streams.gpu_indexes[0].get(),
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
);
|
||||
update_noise_degree(radix_lwe_left, &cuda_ffi_radix_lwe_left);
|
||||
}
|
||||
@@ -767,14 +767,14 @@ pub unsafe fn unchecked_mul_integer_radix_kb_assign_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
is_boolean_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
is_boolean_right,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
mem_ptr,
|
||||
polynomial_size.0 as u32,
|
||||
num_blocks,
|
||||
@@ -917,13 +917,13 @@ pub unsafe fn unchecked_bitop_integer_radix_kb_assign_async<T: UnsignedInteger,
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_bitop(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -1036,15 +1036,15 @@ pub unsafe fn unchecked_scalar_bitop_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe,
|
||||
&cuda_ffi_radix_lwe,
|
||||
&raw mut cuda_ffi_radix_lwe,
|
||||
&raw const cuda_ffi_radix_lwe,
|
||||
clear_blocks.as_c_ptr(0),
|
||||
h_clear_blocks.as_ptr().cast::<std::ffi::c_void>(),
|
||||
min(clear_blocks.len() as u32, num_blocks),
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_bitop(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -1208,13 +1208,13 @@ pub unsafe fn unchecked_comparison_integer_radix_kb_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
|
||||
cleanup_cuda_integer_comparison(
|
||||
@@ -1361,14 +1361,14 @@ pub unsafe fn unchecked_scalar_comparison_integer_radix_kb_async<T: UnsignedInte
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
scalar_blocks.as_c_ptr(0),
|
||||
h_scalar_blocks.as_ptr().cast::<std::ffi::c_void>(),
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
num_scalar_blocks,
|
||||
);
|
||||
|
||||
@@ -1474,10 +1474,10 @@ pub unsafe fn full_propagate_assign_async<T: UnsignedInteger, B: Numeric>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_input,
|
||||
&raw mut cuda_ffi_radix_lwe_input,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_blocks,
|
||||
);
|
||||
@@ -1614,13 +1614,13 @@ pub(crate) unsafe fn propagate_single_carry_assign_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_input,
|
||||
&mut cuda_ffi_carry_out,
|
||||
&cuda_ffi_carry_in,
|
||||
&raw mut cuda_ffi_radix_lwe_input,
|
||||
&raw mut cuda_ffi_carry_out,
|
||||
&raw const cuda_ffi_carry_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
requested_flag as u32,
|
||||
uses_carry,
|
||||
);
|
||||
@@ -1784,14 +1784,14 @@ pub(crate) unsafe fn add_and_propagate_single_carry_assign_async<T: UnsignedInte
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_lhs_input,
|
||||
&cuda_ffi_rhs_input,
|
||||
&mut cuda_ffi_carry_out,
|
||||
&cuda_ffi_carry_in,
|
||||
&raw mut cuda_ffi_lhs_input,
|
||||
&raw const cuda_ffi_rhs_input,
|
||||
&raw mut cuda_ffi_carry_out,
|
||||
&raw const cuda_ffi_carry_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
requested_flag as u32,
|
||||
uses_carry,
|
||||
);
|
||||
@@ -1896,12 +1896,12 @@ pub unsafe fn unchecked_scalar_left_shift_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_logical_scalar_shift(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2003,12 +2003,12 @@ pub unsafe fn unchecked_scalar_logical_right_shift_integer_radix_kb_assign_async
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_logical_scalar_shift(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2109,12 +2109,12 @@ pub unsafe fn unchecked_scalar_arithmetic_right_shift_integer_radix_kb_assign_as
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_arithmetic_scalar_shift(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2244,12 +2244,12 @@ pub unsafe fn unchecked_right_shift_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2376,12 +2376,12 @@ pub unsafe fn unchecked_left_shift_integer_radix_kb_assign_async<T: UnsignedInte
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2516,12 +2516,12 @@ pub unsafe fn unchecked_rotate_right_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2656,12 +2656,12 @@ pub unsafe fn unchecked_rotate_left_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2861,14 +2861,14 @@ pub unsafe fn unchecked_cmux_integer_radix_kb_async<T: UnsignedInteger, B: Numer
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_condition,
|
||||
&cuda_ffi_radix_lwe_true,
|
||||
&cuda_ffi_radix_lwe_false,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_condition,
|
||||
&raw const cuda_ffi_radix_lwe_true,
|
||||
&raw const cuda_ffi_radix_lwe_false,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_cmux(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2975,12 +2975,12 @@ pub unsafe fn unchecked_scalar_rotate_left_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
n,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_scalar_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3087,12 +3087,12 @@ pub unsafe fn unchecked_scalar_rotate_right_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
n,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_scalar_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3207,12 +3207,12 @@ pub unsafe fn unchecked_partial_sum_ciphertexts_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_result,
|
||||
&mut cuda_ffi_radix_list,
|
||||
&raw mut cuda_ffi_result,
|
||||
&raw mut cuda_ffi_radix_list,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_partial_sum_ciphertexts_vec(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3326,11 +3326,11 @@ pub unsafe fn apply_univariate_lut_kb_async<T: UnsignedInteger, B: Numeric>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&cuda_ffi_input,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw const cuda_ffi_input,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
);
|
||||
cleanup_cuda_apply_univariate_lut_kb_64(
|
||||
@@ -3446,11 +3446,11 @@ pub unsafe fn apply_many_univariate_lut_kb_async<T: UnsignedInteger, B: Numeric>
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&cuda_ffi_input,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw const cuda_ffi_input,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_many_lut,
|
||||
lut_stride,
|
||||
@@ -3582,12 +3582,12 @@ pub unsafe fn apply_bivariate_lut_kb_async<T: UnsignedInteger, B: Numeric>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&cuda_ffi_input_1,
|
||||
&cuda_ffi_input_2,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw const cuda_ffi_input_1,
|
||||
&raw const cuda_ffi_input_2,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_blocks,
|
||||
shift,
|
||||
@@ -3744,15 +3744,15 @@ pub unsafe fn unchecked_div_rem_integer_radix_kb_assign_async<T: UnsignedInteger
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_quotient,
|
||||
&mut cuda_ffi_remainder,
|
||||
&cuda_ffi_numerator,
|
||||
&cuda_ffi_divisor,
|
||||
&raw mut cuda_ffi_quotient,
|
||||
&raw mut cuda_ffi_remainder,
|
||||
&raw const cuda_ffi_numerator,
|
||||
&raw const cuda_ffi_divisor,
|
||||
is_signed,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_div_rem(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3870,11 +3870,11 @@ pub unsafe fn compute_prefix_sum_hillis_steele_async<T: UnsignedInteger, B: Nume
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&mut cuda_ffi_generates_or_propagates,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw mut cuda_ffi_generates_or_propagates,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_blocks,
|
||||
);
|
||||
@@ -3930,7 +3930,7 @@ pub unsafe fn reverse_blocks_inplace_async(
|
||||
.collect::<Vec<u32>>()
|
||||
.as_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_output,
|
||||
&raw mut cuda_ffi_radix_lwe_output,
|
||||
);
|
||||
update_noise_degree(radix_lwe_output, &cuda_ffi_radix_lwe_output);
|
||||
}
|
||||
@@ -4085,14 +4085,14 @@ pub(crate) unsafe fn unchecked_unsigned_overflowing_sub_integer_radix_kb_assign_
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&mut cuda_ffi_carry_out,
|
||||
&cuda_ffi_carry_in,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_carry_out,
|
||||
&raw const cuda_ffi_carry_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
compute_overflow as u32,
|
||||
uses_input_borrow,
|
||||
);
|
||||
@@ -4187,12 +4187,12 @@ pub unsafe fn unchecked_signed_abs_radix_kb_assign_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_ct,
|
||||
&raw mut cuda_ffi_ct,
|
||||
mem_ptr,
|
||||
true,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_abs_inplace(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -4326,12 +4326,12 @@ pub unsafe fn unchecked_is_at_least_one_comparisons_block_true_integer_radix_kb_
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
radix_lwe_in.d_blocks.lwe_ciphertext_count().0 as u32,
|
||||
);
|
||||
|
||||
@@ -4468,12 +4468,12 @@ pub unsafe fn unchecked_are_all_comparisons_block_true_integer_radix_kb_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
radix_lwe_in.d_blocks.lwe_ciphertext_count().0 as u32,
|
||||
);
|
||||
|
||||
@@ -4539,8 +4539,8 @@ pub unsafe fn unchecked_negate_integer_radix_async(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
message_modulus,
|
||||
carry_modulus,
|
||||
radix_lwe_in.d_blocks.lwe_ciphertext_count().0 as u32,
|
||||
|
||||
@@ -159,7 +159,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_add(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 + msg2, clear);
|
||||
|
||||
@@ -120,7 +120,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_bitand(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 & msg2, clear);
|
||||
@@ -306,7 +306,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_bitor(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 | msg2, clear);
|
||||
@@ -495,7 +495,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_bitxor(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 ^ msg2, clear);
|
||||
|
||||
@@ -191,7 +191,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_neg(&ctxt);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(255, clear);
|
||||
|
||||
@@ -178,7 +178,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_small_scalar_mul(&ct, scalar);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg * scalar, clear);
|
||||
|
||||
@@ -175,7 +175,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_sub(&ctxt_1, &ctxt_2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(0, clear);
|
||||
|
||||
@@ -1 +1 @@
|
||||
nightly-2025-04-16
|
||||
nightly-2025-04-28
|
||||
|
||||
@@ -62,8 +62,7 @@ impl AssociatedType for DispatchType {
|
||||
return Err(syn::Error::new(
|
||||
lt.lifetime.span(),
|
||||
format!(
|
||||
"Lifetime name {} conflicts with the one used by macro `Version`",
|
||||
LIFETIME_NAME
|
||||
"Lifetime name {LIFETIME_NAME} conflicts with the one used by macro `Version`"
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ impl AssociatedType for VersionType {
|
||||
return Err(syn::Error::new(
|
||||
lt.lifetime.span(),
|
||||
format!(
|
||||
"Lifetime name {} conflicts with the one used by macro `Version`",
|
||||
LIFETIME_NAME
|
||||
"Lifetime name {LIFETIME_NAME} conflicts with the one used by macro `Version`",
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ impl VersionizeImplementor {
|
||||
add_trait_where_clause(
|
||||
&mut generics,
|
||||
[&parse_quote!(#dispatch_enum_path #dispatch_ty_generics)],
|
||||
&[format!("{}<Self>", DISPATCH_TRAIT_NAME,)],
|
||||
&[format!("{DISPATCH_TRAIT_NAME}<Self>")],
|
||||
)?;
|
||||
}
|
||||
Self::Convert(convert_attr) => {
|
||||
@@ -220,7 +220,7 @@ impl VersionizeImplementor {
|
||||
[&parse_quote!(#convert_type_path)],
|
||||
&[
|
||||
VERSIONIZE_OWNED_TRAIT_NAME,
|
||||
&format!("{}<Self>", FROM_TRAIT_NAME),
|
||||
&format!("{FROM_TRAIT_NAME}<Self>"),
|
||||
],
|
||||
)?;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ impl VersionizeImplementor {
|
||||
let mut generics = input_generics.clone();
|
||||
let convert_type_path = &convert_attr.conversion_target;
|
||||
let into_trait = match convert_attr.conversion_type {
|
||||
ConversionType::Direct => format!("{}<Self>", INTO_TRAIT_NAME),
|
||||
ConversionType::Direct => format!("{INTO_TRAIT_NAME}<Self>"),
|
||||
ConversionType::Try => {
|
||||
// Doing a TryFrom requires that the error
|
||||
// impl Error + Send + Sync + 'static
|
||||
@@ -268,7 +268,7 @@ impl VersionizeImplementor {
|
||||
&[STATIC_LIFETIME_NAME],
|
||||
)?;
|
||||
|
||||
format!("{}<Self>", TRY_INTO_TRAIT_NAME)
|
||||
format!("{TRY_INTO_TRAIT_NAME}<Self>")
|
||||
}
|
||||
};
|
||||
add_trait_where_clause(
|
||||
@@ -276,7 +276,7 @@ impl VersionizeImplementor {
|
||||
[&parse_quote!(#convert_type_path)],
|
||||
&[
|
||||
UNVERSIONIZE_TRAIT_NAME,
|
||||
&format!("{}<Self>", FROM_TRAIT_NAME),
|
||||
&format!("{FROM_TRAIT_NAME}<Self>"),
|
||||
&into_trait,
|
||||
],
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user