Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions acvm-repo/acir_field/src/field_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::AcirField;

// XXX: Switch out for a trait and proper implementations
// This implementation is inefficient, can definitely remove hex usage and Iterator instances for trivial functionality
#[derive(Default, Clone, Copy, Eq, PartialOrd, Ord)]
#[derive(Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FieldElement<F: PrimeField>(F);

impl<F: PrimeField> std::fmt::Display for FieldElement<F> {
Expand Down Expand Up @@ -43,18 +43,6 @@ impl<F: PrimeField> std::fmt::Debug for FieldElement<F> {
}
}

impl<F: PrimeField> std::hash::Hash for FieldElement<F> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
state.write(&self.to_be_bytes());
}
}

impl<F: PrimeField> PartialEq for FieldElement<F> {
fn eq(&self, other: &Self) -> bool {
self.to_be_bytes() == other.to_be_bytes()
}
}

impl<F: PrimeField> From<i128> for FieldElement<F> {
fn from(mut a: i128) -> FieldElement<F> {
let mut negative = false;
Expand Down