Skip to content

Commit

Permalink
fix hash calc error
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Sep 11, 2024
1 parent c79c8d1 commit 957a20d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/air/public_input.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ fn hash_data_init(
n_verifier_friendly_commitment_layers: felt252
) {
hash_data.append(n_verifier_friendly_commitment_layers);
hash_data.append(*public_input.log_n_steps);
hash_data.append(*public_input.range_check_min);
hash_data.append(*public_input.range_check_max);
hash_data.append(*public_input.layout);
Expand All @@ -139,6 +140,7 @@ fn hash_data_init(
public_input: @PublicInput,
_n_verifier_friendly_commitment_layers: felt252
) {
hash_data.append(*public_input.log_n_steps);
hash_data.append(*public_input.range_check_min);
hash_data.append(*public_input.range_check_max);
hash_data.append(*public_input.layout);
Expand Down Expand Up @@ -220,8 +222,7 @@ mod tests {
let public_input = get();
let hash = get_public_input_hash(@public_input, 0);
assert(
hash == 0x1c3097c2a1665c78d69edc47ff35a3f3c9c0678e3daaa74d2b68331a5757a37,
'Hash invalid'
hash == 0xaf91f2c71f4a594b1575d258ce82464475c82d8fb244142d0db450491c1b52, 'Hash invalid'
)
}
}
4 changes: 2 additions & 2 deletions src/stark/stark_commit.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn stark_commit(
unsent_commitment: @StarkUnsentCommitment,
config: @StarkConfig,
stark_domains: @StarkDomains,
contract_address_1: ContractAddress,
contract_address: ContractAddress,
) -> StarkCommitment {
// Read the commitment of the 'traces' component.
let traces_commitment = traces_commit(ref channel, *unsent_commitment.traces, *config.traces,);
Expand Down Expand Up @@ -73,7 +73,7 @@ fn stark_commit(
interaction_after_composition,
*stark_domains.trace_domain_size,
*stark_domains.trace_generator,
contract_address_1,
contract_address,
);

// Generate interaction values after OODS.
Expand Down

0 comments on commit 957a20d

Please sign in to comment.