Skip to content

Commit ae49cad

Browse files
committed
ledger/pi: use from_hex from FieldHelpers
1 parent ba9048c commit ae49cad

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ledger/src/proofs/public_input/scalars.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use ark_ff::{BigInteger256, Field, FromBytes};
1+
use ark_ff::{BigInteger256, Field};
22
use kimchi::proof::ProofEvaluations;
33
use mina_curves::pasta::{Fp, Fq};
4+
use o1_utils::field_helpers::FieldHelpers;
45

56
use crate::proofs::field::FieldWitness;
67

@@ -44,13 +45,7 @@ where
4445
s = &s[2..];
4546
}
4647

47-
let mut bytes = <[u8; 32]>::default();
48-
hex::decode_to_slice(s, &mut bytes).unwrap();
49-
bytes.reverse();
50-
51-
let value = FromBytes::read(&bytes[..]).expect("Should not fail");
52-
let bigint = BigInteger256::new(value);
53-
F::from(bigint) // Never fail, we hardcode them with string literals
48+
F::from_hex(s).expect("Must not fail")
5449
}
5550

5651
fn field<F: FieldWitness>(s: &str) -> F {

0 commit comments

Comments
 (0)