From 13fab09b3fa16896b882ff52986c0da8741748c4 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Wed, 4 Oct 2023 14:38:04 -0300 Subject: [PATCH] Remove bitwise operators --- crates/stark-felt/src/lib.rs | 144 ----------------------------------- 1 file changed, 144 deletions(-) diff --git a/crates/stark-felt/src/lib.rs b/crates/stark-felt/src/lib.rs index cf199de..b5cb609 100644 --- a/crates/stark-felt/src/lib.rs +++ b/crates/stark-felt/src/lib.rs @@ -690,150 +690,6 @@ mod arithmetic { } } - impl ops::Shl for Felt { - type Output = Felt; - fn shl(self, rhs: usize) -> Self::Output { - Self(FieldElement::from(&self.0.representative().shl(rhs))) - } - } - - impl ops::Shl for &Felt { - type Output = Felt; - - fn shl(self, rhs: usize) -> Self::Output { - Felt(FieldElement::from(&self.0.representative().shl(rhs))) - } - } - - impl ops::Shr for Felt { - type Output = Felt; - fn shr(self, rhs: usize) -> Self::Output { - Self(FieldElement::from(&self.0.representative().shr(rhs))) - } - } - - impl ops::Shr for &Felt { - type Output = Felt; - - fn shr(self, rhs: usize) -> Self::Output { - Felt(FieldElement::from(&self.0.representative().shr(rhs))) - } - } - - impl ops::BitAnd for Felt { - type Output = Felt; - fn bitand(self, rhs: Felt) -> Self::Output { - Self(FieldElement::from( - &self.0.representative().bitand(rhs.0.representative()), - )) - } - } - - impl ops::BitAnd for &Felt { - type Output = Felt; - - fn bitand(self, rhs: Felt) -> Self::Output { - Felt(FieldElement::from( - &self.0.representative().bitand(rhs.0.representative()), - )) - } - } - - impl ops::BitAnd<&Felt> for Felt { - type Output = Felt; - fn bitand(self, rhs: &Felt) -> Self::Output { - Self(FieldElement::from( - &self.0.representative().bitand(rhs.0.representative()), - )) - } - } - - impl ops::BitAnd<&Felt> for &Felt { - type Output = Felt; - - fn bitand(self, rhs: &Felt) -> Self::Output { - Felt(FieldElement::from( - &self.0.representative().bitand(rhs.0.representative()), - )) - } - } - - impl ops::BitOr for Felt { - type Output = Felt; - fn bitor(self, rhs: Felt) -> Self::Output { - Self(FieldElement::from( - &self.0.representative().bitor(rhs.0.representative()), - )) - } - } - - impl ops::BitOr for &Felt { - type Output = Felt; - - fn bitor(self, rhs: Felt) -> Self::Output { - Felt(FieldElement::from( - &self.0.representative().bitor(rhs.0.representative()), - )) - } - } - - impl ops::BitOr<&Felt> for Felt { - type Output = Felt; - fn bitor(self, rhs: &Felt) -> Self::Output { - Self(FieldElement::from( - &self.0.representative().bitor(rhs.0.representative()), - )) - } - } - - impl ops::BitOr<&Felt> for &Felt { - type Output = Felt; - - fn bitor(self, rhs: &Felt) -> Self::Output { - Felt(FieldElement::from( - &self.0.representative().bitor(rhs.0.representative()), - )) - } - } - - impl ops::BitXor for Felt { - type Output = Felt; - fn bitxor(self, rhs: Felt) -> Self::Output { - Self(FieldElement::from( - &self.0.representative().bitxor(rhs.0.representative()), - )) - } - } - - impl ops::BitXor for &Felt { - type Output = Felt; - - fn bitxor(self, rhs: Felt) -> Self::Output { - Felt(FieldElement::from( - &self.0.representative().bitxor(rhs.0.representative()), - )) - } - } - - impl ops::BitXor<&Felt> for Felt { - type Output = Felt; - fn bitxor(self, rhs: &Felt) -> Self::Output { - Self(FieldElement::from( - &self.0.representative().bitxor(rhs.0.representative()), - )) - } - } - - impl ops::BitXor<&Felt> for &Felt { - type Output = Felt; - - fn bitxor(self, rhs: &Felt) -> Self::Output { - Felt(FieldElement::from( - &self.0.representative().bitxor(rhs.0.representative()), - )) - } - } - impl iter::Sum for Felt { fn sum>(iter: I) -> Self { let mut base = Self::ZERO;