mirror of
https://github.com/Sunscreen-tech/Sunscreen.git
synced 2026-04-19 03:00:06 -04:00
Appease clippy
This commit is contained in:
@@ -620,7 +620,7 @@ pub fn parallel_multiscalar_multiplication(s: &[Scalar], p: &[RistrettoPoint]) -
|
||||
.par_iter()
|
||||
.chunks(16384)
|
||||
.zip(p.par_iter().chunks(16384))
|
||||
.map(|(s, p)| RistrettoPoint::vartime_multiscalar_mul(s.into_iter(), p.into_iter()))
|
||||
.map(|(s, p)| RistrettoPoint::vartime_multiscalar_mul(s, p))
|
||||
.reduce(RistrettoPoint::default, |x, p| x + p);
|
||||
|
||||
msm
|
||||
@@ -769,7 +769,7 @@ mod test {
|
||||
fn can_pad() {
|
||||
type Fq = FqSeal128_8192;
|
||||
|
||||
let a = vec![Fq::from(1), Fq::from(2), Fq::from(3)];
|
||||
let a = [Fq::from(1), Fq::from(2), Fq::from(3)];
|
||||
|
||||
let b = a.pad_to_power_of_2();
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ impl EncryptionParameters {
|
||||
};
|
||||
|
||||
let mut borrowed_modulus = Vec::with_capacity(len as usize);
|
||||
let borrowed_modulus_ptr = borrowed_modulus.as_mut_ptr() as *mut *mut c_void;
|
||||
let borrowed_modulus_ptr = borrowed_modulus.as_mut_ptr();
|
||||
|
||||
unsafe {
|
||||
convert_seal_error(bindgen::EncParams_GetCoeffModulus(
|
||||
|
||||
@@ -176,7 +176,7 @@ impl CoefficientModulus {
|
||||
let length = bit_sizes.len() as u64;
|
||||
|
||||
let mut coefficients: Vec<*mut c_void> = Vec::with_capacity(bit_sizes.len());
|
||||
let coefficients_ptr = coefficients.as_mut_ptr() as *mut *mut c_void;
|
||||
let coefficients_ptr = coefficients.as_mut_ptr();
|
||||
|
||||
convert_seal_error(unsafe {
|
||||
bindgen::CoeffModulus_Create1(degree, length, bit_sizes.as_mut_ptr(), coefficients_ptr)
|
||||
@@ -208,7 +208,7 @@ impl CoefficientModulus {
|
||||
})?;
|
||||
|
||||
let mut coefficients: Vec<*mut c_void> = Vec::with_capacity(len as usize);
|
||||
let coefficients_ptr = coefficients.as_mut_ptr() as *mut *mut c_void;
|
||||
let coefficients_ptr = coefficients.as_mut_ptr();
|
||||
|
||||
convert_seal_error(unsafe {
|
||||
bindgen::CoeffModulus_BFVDefault(
|
||||
|
||||
@@ -257,11 +257,10 @@ where
|
||||
(Context::Seal(ctx), InnerCiphertext::Seal(ciphertexts)) => {
|
||||
let decryptor = Decryptor::new(ctx, &private_key.0)?;
|
||||
|
||||
Ok(ciphertexts
|
||||
.iter()
|
||||
.fold(Ok(u32::MAX), |min: Result<u32>, c| {
|
||||
Ok(u32::min(min?, decryptor.invariant_noise_budget(&c.data)?))
|
||||
})?)
|
||||
Ok(ciphertexts.iter().try_fold(u32::MAX, |min, c| {
|
||||
let m = u32::min(min, decryptor.invariant_noise_budget(&c.data)?);
|
||||
Ok::<_, seal_fhe::Error>(m)
|
||||
})?)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user