Skip to content

Commit

Permalink
fix: update local import path
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalatrax committed Jun 20, 2024
1 parent f6d07d6 commit c016657
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion conformance/cairo_0/compute_doubling_slope_v2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions conformance/cairo_0/ec_double_assign_new_x_v3.cairo
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down
3 changes: 1 addition & 2 deletions conformance/cairo_0/fast_ec_add_v2.cairo
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions conformance/cairo_0/field_arithmetic.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/fq.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/fq_test.cairo
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/packed_sha256_test.cairo
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/sha256.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/sha256_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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}() {
Expand Down
10 changes: 5 additions & 5 deletions conformance/cairo_0/uint384_extension.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/uint384_extension_test.cairo
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion conformance/cairo_0/uint384_test.cairo
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c016657

Please sign in to comment.