diff --git a/contracts/zkllvm/circuit1/commitment.sol b/contracts/zkllvm/circuit1/commitment.sol index a8ce01a..3fa52dc 100644 --- a/contracts/zkllvm/circuit1/commitment.sol +++ b/contracts/zkllvm/circuit1/commitment.sol @@ -453,8 +453,9 @@ library modular_commitment_scheme_circuit1 { bytes calldata proof_of_work = blob[blob.length - 4:]; transcript.update_transcript(tr_state, proof_of_work); - transcript.get_integral_challenge_be(tr_state, 4); - + uint256 p_o_w = transcript.get_integral_challenge_be(tr_state, 4); + if (p_o_w & 4294901760 != 0) return false; + unchecked{ offset += 0x8 + r; @@ -586,4 +587,4 @@ library modular_commitment_scheme_circuit1 { return true; } } - \ No newline at end of file + diff --git a/contracts/zkllvm/circuit2/commitment.sol b/contracts/zkllvm/circuit2/commitment.sol index 2f13324..d01f9fa 100644 --- a/contracts/zkllvm/circuit2/commitment.sol +++ b/contracts/zkllvm/circuit2/commitment.sol @@ -585,4 +585,4 @@ library modular_commitment_scheme_circuit2 { return true; } } - \ No newline at end of file + diff --git a/contracts/zkllvm/circuit3/commitment.sol b/contracts/zkllvm/circuit3/commitment.sol index cfc1c94..9c59646 100644 --- a/contracts/zkllvm/circuit3/commitment.sol +++ b/contracts/zkllvm/circuit3/commitment.sol @@ -457,8 +457,9 @@ library modular_commitment_scheme_circuit3 { bytes calldata proof_of_work = blob[blob.length - 4:]; transcript.update_transcript(tr_state, proof_of_work); - transcript.get_integral_challenge_be(tr_state, 4); - + uint256 p_o_w = transcript.get_integral_challenge_be(tr_state, 4); + if (p_o_w & 4294901760 != 0) return false; + unchecked{ offset += 0x8 + r; diff --git a/contracts/zkllvm/circuit4/commitment.sol b/contracts/zkllvm/circuit4/commitment.sol index 0273f8d..40ccf7f 100644 --- a/contracts/zkllvm/circuit4/commitment.sol +++ b/contracts/zkllvm/circuit4/commitment.sol @@ -457,8 +457,9 @@ library modular_commitment_scheme_circuit4 { bytes calldata proof_of_work = blob[blob.length - 4:]; transcript.update_transcript(tr_state, proof_of_work); - transcript.get_integral_challenge_be(tr_state, 4); - + uint256 p_o_w = transcript.get_integral_challenge_be(tr_state, 4); + if (p_o_w & 4294901760 != 0) return false; + unchecked{ offset += 0x8 + r; diff --git a/contracts/zkllvm/circuit6/commitment.sol b/contracts/zkllvm/circuit6/commitment.sol index 100e30a..dd44fb8 100644 --- a/contracts/zkllvm/circuit6/commitment.sol +++ b/contracts/zkllvm/circuit6/commitment.sol @@ -460,8 +460,9 @@ library modular_commitment_scheme_circuit6 { bytes calldata proof_of_work = blob[blob.length - 4:]; transcript.update_transcript(tr_state, proof_of_work); - transcript.get_integral_challenge_be(tr_state, 4); - + uint256 p_o_w = transcript.get_integral_challenge_be(tr_state, 4); + if (p_o_w & 4294901760 != 0) return false; + unchecked{ offset += 0x8 + r;