Skip to content

Commit

Permalink
Cairo v0.12.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
liorgold2 committed Aug 21, 2023
1 parent d6863bd commit 27a157d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/starkware/cairo/common/secp256r1/field.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ func verify_zero{range_check_ptr}(val: UnreducedBigInt3) {
ids.q = q % PRIME
%}

// 164 + 255.99 - 2 * 86 = 247.99, so we can require `q` to be in the range [-2**164, 2**164)
// as long as the most significant limb of `val` is in the range (-2**247.99, 2**247.99).
// Assuming the absolute values of the limbs are bounded by 2**247.99, the absolute value
// of q = (val.d2 * BASE**2 + val.d1 * BASE + val.d0) / secp256r1, is bounded by
// 2**247.995 * (2 ** 86)**2 / 2**255.995 = 2**164.
assert_165_bit(q + 2 ** 164);

tempvar r1 = (val.d0 + q * SECP_REM0) / BASE;
Expand Down
2 changes: 1 addition & 1 deletion src/starkware/cairo/lang/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.2a0
0.12.2
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ def calculate_state_diff_commitment(
"""
Calculates the commitment on the given state diff.
We assume that the state diff is well formed. For example:
* In the storage_diff, for a given contract there will be no contradicting storage entries.
* In the declared_classes, any class hash points to a single compiled class hash.
We assume that state_diff represents a valid state_diff. For example:
* In storage_diff, any storage entry key points to a single storage entry value.
* In declared_classes, any class hash points to a single compiled class hash.
We do not assume the state diff to be sorted. The function sorts the state diff before computing
the hash.
Expand Down

0 comments on commit 27a157d

Please sign in to comment.