Skip to content

Commit

Permalink
fix secp
Browse files Browse the repository at this point in the history
  • Loading branch information
StringNick committed Jun 14, 2024
1 parent 25e05a7 commit 86044a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ jobs:
with:
zig-version: master

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.9'

# NOTE: we do it in one step because GitHub cleans the PATH between steps
- name: Install dependencies and compile project
run: |
source scripts/install/install-ubuntu.sh
make check
- name: Build
run: make build

Expand Down
12 changes: 6 additions & 6 deletions cairo_programs/secp.cairo
Original file line number Diff line number Diff line change
@@ -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}() {
Expand Down Expand Up @@ -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 ();
Expand Down

0 comments on commit 86044a8

Please sign in to comment.