Skip to content

Commit

Permalink
Merge pull request private-attribution#1138 from akoshelev/rust-179
Browse files Browse the repository at this point in the history
Fix for Rust 1.79
  • Loading branch information
akoshelev authored Jun 13, 2024
2 parents 40bdad2 + 080f988 commit c56449c
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ipa-core/src/ff/boolean_array.rs
Original file line number Diff line number Diff line change
@@ -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))
}
}

2 changes: 1 addition & 1 deletion ipa-core/src/ff/galois_field.rs
Original file line number Diff line number Diff line change
@@ -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))
}
}

2 changes: 2 additions & 0 deletions ipa-core/src/ff/prime_field.rs
Original file line number Diff line number Diff line change
@@ -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 <Self as SharedValue>::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 <Self as SharedValue>::Storage,
1 change: 0 additions & 1 deletion ipa-core/src/helpers/gateway/mod.rs
Original file line number Diff line number Diff line change
@@ -39,7 +39,6 @@ pub type MpcTransportImpl = TransportImpl<crate::helpers::HelperIdentity>;
#[cfg(feature = "in-memory-infra")]
pub type ShardTransportImpl = TransportImpl<ShardIndex>;

#[cfg(feature = "real-world-infra")]
#[cfg(feature = "real-world-infra")]
pub type MpcTransportImpl = crate::sync::Arc<crate::net::HttpTransport>;
#[cfg(feature = "real-world-infra")]

0 comments on commit c56449c

Please sign in to comment.