diff --git a/ipa-core/src/ff/boolean_array.rs b/ipa-core/src/ff/boolean_array.rs index 11f585c58..b6fa73a94 100644 --- a/ipa-core/src/ff/boolean_array.rs +++ b/ipa-core/src/ff/boolean_array.rs @@ -140,7 +140,7 @@ macro_rules! boolean_array_impl_small { v.0.iter() .by_refs() .enumerate() - .fold(0_u128, |acc, (i, b)| acc + ((*b as u128) << i)) + .fold(0_u128, |acc, (i, b)| acc + (u128::from(*b) << i)) } } diff --git a/ipa-core/src/ff/galois_field.rs b/ipa-core/src/ff/galois_field.rs index 884a7de7c..531785201 100644 --- a/ipa-core/src/ff/galois_field.rs +++ b/ipa-core/src/ff/galois_field.rs @@ -395,7 +395,7 @@ macro_rules! bit_array_impl { .iter() .by_refs() .enumerate() - .fold(0_u128, |acc, (i, b)| acc + ((*b as u128) << i)) + .fold(0_u128, |acc, (i, b)| acc + (u128::from(*b) << i)) } } diff --git a/ipa-core/src/ff/prime_field.rs b/ipa-core/src/ff/prime_field.rs index 2ae8e3193..1d8113ea2 100644 --- a/ipa-core/src/ff/prime_field.rs +++ b/ipa-core/src/ff/prime_field.rs @@ -123,6 +123,7 @@ macro_rules! field_impl { fn add(self, rhs: Self) -> Self::Output { let c = u64::from; debug_assert!(c(Self::PRIME) < (u64::MAX >> 1)); + #[allow(clippy::cast_possible_truncation)] Self(((c(self.0) + c(rhs.0)) % c(Self::PRIME)) as ::Storage) } } @@ -149,6 +150,7 @@ macro_rules! field_impl { let c = u64::from; debug_assert!(c(Self::PRIME) < (u64::MAX >> 1)); // TODO(mt) - constant time? + #[allow(clippy::cast_possible_truncation)] Self( ((c(Self::PRIME) + c(self.0) - c(rhs.0)) % c(Self::PRIME)) as ::Storage, diff --git a/ipa-core/src/helpers/gateway/mod.rs b/ipa-core/src/helpers/gateway/mod.rs index 7f4b45fca..0178d2557 100644 --- a/ipa-core/src/helpers/gateway/mod.rs +++ b/ipa-core/src/helpers/gateway/mod.rs @@ -39,7 +39,6 @@ pub type MpcTransportImpl = TransportImpl; #[cfg(feature = "in-memory-infra")] pub type ShardTransportImpl = TransportImpl; -#[cfg(feature = "real-world-infra")] #[cfg(feature = "real-world-infra")] pub type MpcTransportImpl = crate::sync::Arc; #[cfg(feature = "real-world-infra")]