From 8fa52f22a772df9551c5a1f7a2755b4be1163e2b Mon Sep 17 00:00:00 2001 From: Federica Date: Mon, 25 Mar 2024 11:04:29 -0300 Subject: [PATCH] Update program + add changelog entry --- CHANGELOG.md | 2 ++ cairo_programs/secp.cairo | 12 ++++++------ cairo_programs/secp_integration_tests.cairo | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e320723e7..cfa56b1389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ #### Upcoming Changes +* feat: Bump cairo_lang to 0.13.1 in testing env [#1687](https://github.com/lambdaclass/cairo-vm/pull/1687) + * feat(BREAKING): Use return type info from sierra when serializing return values in cairo1-run crate [#1665](https://github.com/lambdaclass/cairo-vm/pull/1665) * Removed public function `serialize_output`. * Add field `serialize_output` to `Cairo1RunConfig`. diff --git a/cairo_programs/secp.cairo b/cairo_programs/secp.cairo index 747d8c7421..c7e9018eb0 100644 --- a/cairo_programs/secp.cairo +++ b/cairo_programs/secp.cairo @@ -1,6 +1,6 @@ %builtins range_check -from starkware.cairo.common.cairo_secp.bigint import nondet_bigint3, BigInt3, bigint_to_uint256 - +from starkware.cairo.common.cairo_secp.bigint3 import BigInt3, SumBigInt3 +from starkware.cairo.common.cairo_secp.bigint import nondet_bigint3, bigint_to_uint256 from starkware.cairo.common.cairo_secp.field import verify_zero, UnreducedBigInt3, reduce, is_zero func main{range_check_ptr: felt}() { @@ -43,17 +43,17 @@ func main{range_check_ptr: felt}() { ); // is_zero - let (u) = is_zero(BigInt3(0, 0, 0)); + let (u) = is_zero(SumBigInt3(0, 0, 0)); assert u = 1; let (v) = is_zero( - BigInt3(232113757366008801543585, 232113757366008801543585, 232113757366008801543585) + SumBigInt3(232113757366008801543585, 232113757366008801543585, 232113757366008801543585) ); assert v = 0; - let (w) = is_zero(BigInt3(-10, -10, -10)); + let (w) = is_zero(SumBigInt3(-10, -10, -10)); assert w = 0; - let (z) = is_zero(BigInt3(1833312543, 67523423, 8790312)); + let (z) = is_zero(SumBigInt3(1833312543, 67523423, 8790312)); assert z = 0; return (); diff --git a/cairo_programs/secp_integration_tests.cairo b/cairo_programs/secp_integration_tests.cairo index 7eeaae615b..45ec410248 100644 --- a/cairo_programs/secp_integration_tests.cairo +++ b/cairo_programs/secp_integration_tests.cairo @@ -1,12 +1,12 @@ %builtins range_check from starkware.cairo.common.cairo_secp.bigint import ( - BigInt3, bigint_mul, nondet_bigint3, bigint_to_uint256, uint256_to_bigint, ) +from starkware.cairo.common.cairo_secp.bigint3 import BigInt3, SumBigInt3 from starkware.cairo.common.cairo_secp.signature import ( get_generator_point, validate_signature_entry, @@ -86,7 +86,7 @@ func test_operations{range_check_ptr}(point: EcPoint) { let (zero_uint, _) = uint256_add(slope_uint, neg_slope); let (zero) = uint256_to_bigint(zero_uint); - let (is_z) = is_zero(zero); + let (is_z) = is_zero(SumBigInt3(d0=zero.d0, d1=zero.d1, d2=zero.d2)); assert is_z = 1; let (pow2, scaled) = ec_mul_inner(point, 0, 0);