From c0166576d68a3747082d19f493f9c11250697adf Mon Sep 17 00:00:00 2001 From: malatrax Date: Thu, 20 Jun 2024 12:13:56 +0200 Subject: [PATCH] fix: update local import path --- conformance/cairo_0/compute_doubling_slope_v2.cairo | 2 +- conformance/cairo_0/ec_double_assign_new_x_v3.cairo | 4 ++-- conformance/cairo_0/fast_ec_add_v2.cairo | 3 +-- conformance/cairo_0/field_arithmetic.cairo | 4 ++-- conformance/cairo_0/fq.cairo | 2 +- conformance/cairo_0/fq_test.cairo | 2 +- conformance/cairo_0/packed_sha256_test.cairo | 2 +- conformance/cairo_0/sha256.cairo | 2 +- conformance/cairo_0/sha256_test.cairo | 2 +- conformance/cairo_0/uint384_extension.cairo | 10 +++++----- conformance/cairo_0/uint384_extension_test.cairo | 2 +- conformance/cairo_0/uint384_test.cairo | 2 +- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/conformance/cairo_0/compute_doubling_slope_v2.cairo b/conformance/cairo_0/compute_doubling_slope_v2.cairo index 39bb530..041fffd 100644 --- a/conformance/cairo_0/compute_doubling_slope_v2.cairo +++ b/conformance/cairo_0/compute_doubling_slope_v2.cairo @@ -4,7 +4,7 @@ from starkware.cairo.common.cairo_secp.bigint import ( nondet_bigint3, ) -from cairo_programs.compute_slope_v2 import verify_zero +from conformance.cairo_0.compute_slope_v2 import verify_zero const BASE = 2 ** 86; const SECP_REM = 19; diff --git a/conformance/cairo_0/ec_double_assign_new_x_v3.cairo b/conformance/cairo_0/ec_double_assign_new_x_v3.cairo index 7474dd7..da47210 100644 --- a/conformance/cairo_0/ec_double_assign_new_x_v3.cairo +++ b/conformance/cairo_0/ec_double_assign_new_x_v3.cairo @@ -1,6 +1,6 @@ from starkware.cairo.common.cairo_secp.bigint import BigInt3, nondet_bigint3, UnreducedBigInt3 -from cairo_programs.compute_slope_v2 import verify_zero, unreduced_mul -from cairo_programs.compute_doubling_slope_v2 import compute_doubling_slope, EcPoint, unreduced_sqr +from conformance.cairo_0.compute_slope_v2 import verify_zero, unreduced_mul +from conformance.cairo_0.compute_doubling_slope_v2 import compute_doubling_slope, EcPoint, unreduced_sqr // Computes the addition of a given point to itself. // diff --git a/conformance/cairo_0/fast_ec_add_v2.cairo b/conformance/cairo_0/fast_ec_add_v2.cairo index d67dc70..136db5a 100644 --- a/conformance/cairo_0/fast_ec_add_v2.cairo +++ b/conformance/cairo_0/fast_ec_add_v2.cairo @@ -1,10 +1,9 @@ - from starkware.cairo.common.cairo_secp.bigint import BigInt3, nondet_bigint3, UnreducedBigInt3 from starkware.cairo.common.cairo_secp.field import ( is_zero, unreduced_sqr, ) -from cairo_programs.compute_slope_v2 import compute_slope, EcPoint, verify_zero, unreduced_mul +from conformance.cairo_0.compute_slope_v2 import compute_slope, EcPoint, verify_zero, unreduced_mul // Computes the addition of two given points. // // Arguments: diff --git a/conformance/cairo_0/field_arithmetic.cairo b/conformance/cairo_0/field_arithmetic.cairo index a3c18c8..bcccf43 100644 --- a/conformance/cairo_0/field_arithmetic.cairo +++ b/conformance/cairo_0/field_arithmetic.cairo @@ -8,8 +8,8 @@ from starkware.cairo.common.math_cmp import is_le from starkware.cairo.common.pow import pow from starkware.cairo.common.registers import get_ap, get_fp_and_pc from starkware.cairo.common.uint256 import Uint256 -from cairo_programs.uint384 import u384, Uint384, Uint384_expand, SHIFT, HALF_SHIFT -from cairo_programs.uint384_extension import u384_ext, Uint768 +from conformance.cairo_0.uint384 import u384, Uint384, Uint384_expand, SHIFT, HALF_SHIFT +from conformance.cairo_0.uint384_extension import u384_ext, Uint768 // Functions for operating elements in a finite field F_p (i.e. modulo a prime p), with p of at most 384 bits namespace field_arithmetic { diff --git a/conformance/cairo_0/fq.cairo b/conformance/cairo_0/fq.cairo index 01eac26..e743a73 100644 --- a/conformance/cairo_0/fq.cairo +++ b/conformance/cairo_0/fq.cairo @@ -10,7 +10,7 @@ from starkware.cairo.common.cairo_secp.bigint import ( nondet_bigint3, ) -from cairo_programs.uint384_extension import Uint384, Uint768, u384 +from conformance.cairo_0.uint384_extension import Uint384, Uint768, u384 // src: https://github.com/rdubois-crypto/garaga/blob/48a5b1d7d530baba2338698ffebf988ed3d19e6d/src/curve.cairo const P0 = 60193888514187762220203335; diff --git a/conformance/cairo_0/fq_test.cairo b/conformance/cairo_0/fq_test.cairo index 4a82fc5..5c2e74d 100644 --- a/conformance/cairo_0/fq_test.cairo +++ b/conformance/cairo_0/fq_test.cairo @@ -1,6 +1,6 @@ %builtins range_check -from cairo_programs.fq import fq, Uint256, Uint512 +from conformance.cairo_0.fq import fq, Uint256, Uint512 func test_add{range_check_ptr}() { let a = Uint256(346, 0); diff --git a/conformance/cairo_0/packed_sha256_test.cairo b/conformance/cairo_0/packed_sha256_test.cairo index b6316e4..01eeaa2 100644 --- a/conformance/cairo_0/packed_sha256_test.cairo +++ b/conformance/cairo_0/packed_sha256_test.cairo @@ -1,6 +1,6 @@ %builtins range_check bitwise from starkware.cairo.common.alloc import alloc -from cairo_programs.packed_sha256 import ( +from conformance.cairo_0.packed_sha256 import ( BLOCK_SIZE, compute_message_schedule, sha2_compress, diff --git a/conformance/cairo_0/sha256.cairo b/conformance/cairo_0/sha256.cairo index 9a46d49..11779d1 100644 --- a/conformance/cairo_0/sha256.cairo +++ b/conformance/cairo_0/sha256.cairo @@ -7,7 +7,7 @@ from starkware.cairo.common.memcpy import memcpy from starkware.cairo.common.memset import memset from starkware.cairo.common.pow import pow -from cairo_programs.packed_sha256 import ( +from conformance.cairo_0.packed_sha256 import ( BLOCK_SIZE, compute_message_schedule, sha2_compress, diff --git a/conformance/cairo_0/sha256_test.cairo b/conformance/cairo_0/sha256_test.cairo index c6cb247..6b48abc 100644 --- a/conformance/cairo_0/sha256_test.cairo +++ b/conformance/cairo_0/sha256_test.cairo @@ -5,7 +5,7 @@ from starkware.cairo.common.registers import get_label_location from starkware.cairo.common.invoke import invoke from starkware.cairo.common.alloc import alloc -from cairo_programs.sha256 import sha256, finalize_sha256 +from conformance.cairo_0.sha256 import sha256, finalize_sha256 // Taken from https://github.com/cartridge-gg/cairo-sha256/blob/8d2ae515ab5cc9fc530c2dcf3ed1172bd181136e/tests/test_sha256.cairo func test_sha256_hello_world{bitwise_ptr: BitwiseBuiltin*, range_check_ptr}() { diff --git a/conformance/cairo_0/uint384_extension.cairo b/conformance/cairo_0/uint384_extension.cairo index ad9c4da..e5dcf1c 100644 --- a/conformance/cairo_0/uint384_extension.cairo +++ b/conformance/cairo_0/uint384_extension.cairo @@ -6,7 +6,7 @@ from starkware.cairo.common.math_cmp import is_le from starkware.cairo.common.pow import pow from starkware.cairo.common.registers import get_ap, get_fp_and_pc // Import uint384 files -from cairo_programs.uint384 import u384, Uint384, Uint384_expand, ALL_ONES +from conformance.cairo_0.uint384 import u384, Uint384, Uint384_expand, ALL_ONES // Functions for operating 384-bit integers with 768-bit integers // Represents an integer in the range [0, 2^768). @@ -118,13 +118,13 @@ namespace u384_ext { a = [] for _ in range(length): a.append( num & ((1 << num_bits_shift) - 1) ) - num = num >> num_bits_shift + num = num >> num_bits_shift return tuple(a) def pack(z, num_bits_shift: int) -> int: limbs = (z.b01, z.b23, z.b45) return sum(limb << (num_bits_shift * i) for i, limb in enumerate(limbs)) - + def pack_extended(z, num_bits_shift: int) -> int: limbs = (z.d0, z.d1, z.d2, z.d3, z.d4, z.d5) return sum(limb << (num_bits_shift * i) for i, limb in enumerate(limbs)) @@ -229,13 +229,13 @@ namespace u384_ext { a = [] for _ in range(length): a.append( num & ((1 << num_bits_shift) - 1) ) - num = num >> num_bits_shift + num = num >> num_bits_shift return tuple(a) def pack(z, num_bits_shift: int) -> int: limbs = (z.d0, z.d1, z.d2) return sum(limb << (num_bits_shift * i) for i, limb in enumerate(limbs)) - + def pack_extended(z, num_bits_shift: int) -> int: limbs = (z.d0, z.d1, z.d2, z.d3, z.d4, z.d5) return sum(limb << (num_bits_shift * i) for i, limb in enumerate(limbs)) diff --git a/conformance/cairo_0/uint384_extension_test.cairo b/conformance/cairo_0/uint384_extension_test.cairo index f7898d4..71f51a3 100644 --- a/conformance/cairo_0/uint384_extension_test.cairo +++ b/conformance/cairo_0/uint384_extension_test.cairo @@ -1,6 +1,6 @@ %builtins range_check -from cairo_programs.uint384_extension import u384_ext, Uint768, Uint384 +from conformance.cairo_0.uint384_extension import u384_ext, Uint768, Uint384 func test_uint384_extension_operations{range_check_ptr}() { // Test unsigned_div_rem_uint768_by_uint384 diff --git a/conformance/cairo_0/uint384_test.cairo b/conformance/cairo_0/uint384_test.cairo index c87d940..c81a59c 100644 --- a/conformance/cairo_0/uint384_test.cairo +++ b/conformance/cairo_0/uint384_test.cairo @@ -1,6 +1,6 @@ %builtins range_check -from cairo_programs.uint384 import u384, Uint384, Uint384_expand +from conformance.cairo_0.uint384 import u384, Uint384, Uint384_expand func test_uint384_operations{range_check_ptr}() { // Test unsigned_div_rem