Skip to content

Commit

Permalink
Implicitly use encoding from BE bytes only (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea authored Jan 17, 2024
1 parent ea1cb85 commit ba3850e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions lightclient-circuits/src/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ use halo2_base::{
poseidon::hasher::PoseidonSponge, AssignedValue, Context, QuantumCell,
};
use halo2_ecc::{bigint::ProperCrtUint, bls12_381::FpChip, fields::FieldChip};
use halo2curves::{
bls12_381::{self, Fq},
group::UncompressedEncoding,
};
use halo2curves::bls12_381::{self, Fq};
use itertools::Itertools;
use pse_poseidon::Poseidon as PoseidonNative;

Expand Down Expand Up @@ -107,7 +104,7 @@ pub fn poseidon_committee_commitment_from_uncompressed(
.iter()
.cloned()
.map(|bytes| {
halo2curves::bls12_381::G1Affine::from_uncompressed_unchecked(
halo2curves::bls12_381::G1Affine::from_uncompressed_unchecked_be(
&bytes.as_slice().try_into().unwrap(),
)
.unwrap()
Expand Down
9 changes: 3 additions & 6 deletions lightclient-circuits/src/sync_step_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ use halo2_ecc::{
},
fields::FieldChip,
};
use halo2curves::{
bls12_381::{G1Affine, G2Affine},
group::UncompressedEncoding,
};
use halo2curves::bls12_381::{G1Affine, G2Affine};
use itertools::Itertools;
use num_bigint::BigUint;
use ssz_rs::Merkleized;
Expand Down Expand Up @@ -87,7 +84,7 @@ impl<S: Spec, F: Field> StepCircuit<S, F> {
.as_slice()
.iter()
.map(|bytes| {
G1Affine::from_uncompressed_unchecked(&bytes.as_slice().try_into().unwrap())
G1Affine::from_uncompressed_unchecked_be(&bytes.as_slice().try_into().unwrap())
.unwrap()
})
.collect_vec();
Expand Down Expand Up @@ -267,7 +264,7 @@ impl<S: Spec, F: Field> StepCircuit<S, F> {
.as_slice()
.iter()
.map(|bytes| {
G1Affine::from_uncompressed_unchecked(&bytes.as_slice().try_into().unwrap())
G1Affine::from_uncompressed_unchecked_be(&bytes.as_slice().try_into().unwrap())
.unwrap()
})
.collect_vec();
Expand Down

0 comments on commit ba3850e

Please sign in to comment.