From 92ef9b4dd80848c4b1eb92cfd6f9fd04b72ff57a Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Apr 2021 20:59:20 +0100 Subject: [PATCH] Field - Add into_repr method. This is needed at least while we have Bn254 intead of a generic field impl --- crates/noir_field/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/noir_field/src/lib.rs b/crates/noir_field/src/lib.rs index 6bf19b7f4f8..1b3c2c47493 100644 --- a/crates/noir_field/src/lib.rs +++ b/crates/noir_field/src/lib.rs @@ -122,6 +122,12 @@ impl FieldElement { FieldElement(inv) } + // XXX: This method is used while this field element + // implementation is not generic. + pub fn into_repr(self) -> Fr { + self.0 + } + pub fn to_hex(&self) -> String { let mut bytes = to_bytes!(self.0).unwrap(); bytes.reverse();