Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea committed Mar 6, 2024
1 parent e8f33fd commit f3fcca2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lightclient-circuits/src/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const R_F: usize = 8;
///
/// Each Poseidon sponge absorbs `POSEIDON_SIZE`-2 elements and previos sponge output if it's not the first batch, ie. onion commitment.
///
/// Assumes that LIMB_BITS * 2 < 254 (BN254).
/// Assumes that:
/// - `LIMB_BITS` * 2 < 254 (BN254)
/// - `x_coords` and `y_signs_packed` are not zero length
pub fn g1_array_poseidon<F: Field>(
ctx: &mut Context<F>,
fp_chip: &FpChip<F>,
Expand Down Expand Up @@ -69,6 +71,8 @@ pub fn g1_array_poseidon<F: Field>(
})
.collect_vec();

assert!(!limbs.is_empty(), "No G1 affines to hash");

let mut poseidon = PoseidonSponge::<F, T, POSEIDON_SIZE>::new::<R_F, R_P, 0>(ctx);

let mut current_poseidon_hash = None;
Expand Down

0 comments on commit f3fcca2

Please sign in to comment.