Skip to content

Commit

Permalink
Remove bitwise operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed Oct 4, 2023
1 parent b32c7da commit 13fab09
Showing 1 changed file with 0 additions and 144 deletions.
144 changes: 0 additions & 144 deletions crates/stark-felt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,150 +690,6 @@ mod arithmetic {
}
}

impl ops::Shl<usize> for Felt {
type Output = Felt;
fn shl(self, rhs: usize) -> Self::Output {
Self(FieldElement::from(&self.0.representative().shl(rhs)))
}
}

impl ops::Shl<usize> for &Felt {
type Output = Felt;

fn shl(self, rhs: usize) -> Self::Output {
Felt(FieldElement::from(&self.0.representative().shl(rhs)))
}
}

impl ops::Shr<usize> for Felt {
type Output = Felt;
fn shr(self, rhs: usize) -> Self::Output {
Self(FieldElement::from(&self.0.representative().shr(rhs)))
}
}

impl ops::Shr<usize> for &Felt {
type Output = Felt;

fn shr(self, rhs: usize) -> Self::Output {
Felt(FieldElement::from(&self.0.representative().shr(rhs)))
}
}

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::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<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::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<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 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<I: Iterator<Item = Self>>(iter: I) -> Self {
let mut base = Self::ZERO;
Expand Down

0 comments on commit 13fab09

Please sign in to comment.