Skip to content

Commit

Permalink
Fix clearing of bits
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Oct 11, 2023
1 parent 28cfa79 commit 6082ca6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lightclient-circuits/src/committee_update_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,18 @@ impl<S: Spec, F: Field> CommitteeUpdateCircuit<S, F> {
Ok(public_inputs)
}

pub fn instance(args: &witness::CommitteeRotationArgs<S, F>) -> Vec<Vec<bn256::Fr>> {
pub fn instance(args: &witness::CommitteeRotationArgs<S, F>) -> Vec<Vec<bn256::Fr>>
where
[(); { S::SYNC_COMMITTEE_SIZE }]:,
{
let pubkeys_x = args.pubkeys_compressed.iter().cloned().map(|mut bytes| {
bytes[47] &= 0b11111000;
bytes[47] &= 0b00011111;
bls12_381::Fq::from_bytes_le(&bytes)
});

let poseidon_commitment = fq_array_poseidon_native::<bn256::Fr>(pubkeys_x).unwrap();

let mut pk_vector: Vector<Vector<u8, 48>, 512> = args
let mut pk_vector: Vector<Vector<u8, 48>, { S::SYNC_COMMITTEE_SIZE }> = args
.pubkeys_compressed
.iter()
.cloned()
Expand Down
1 change: 0 additions & 1 deletion lightclient-circuits/src/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ pub fn fq_array_poseidon_native<F: Field>(
.collect_vec()
})
.collect_vec();

let mut poseidon = PoseidonNative::<F, POSEIDON_SIZE, { POSEIDON_SIZE - 1 }>::new(R_F, R_P);
let mut current_poseidon_hash = None;

Expand Down

0 comments on commit 6082ca6

Please sign in to comment.