-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ec hints * Implement hints * Add the hints to the processor * Test pack86 function * Test hint * Delete debug info, Test ec negative op * Second hint test * Test embedded hint * Change to Camel case * Implement slope hints * Fix format * Delete github conflict string * Tests hints * Tests hints slopes * Rename misleading name function * Fix function name * Fix error in function call * Delete debug info * Delete unused import * Secp hints * Secpr21 * Add it to the hint processor * Hints secp * bigint3 nondet * Zero verify * Merge main * Add hint to hint processor * Add double assign hint * Debug info * Remove integration test * Prints * Add unit tests * Test verify with unit test * Debug unit test * Test verify zero with debug * Non det big 3 test * Modify test to use ids manager * debug info * Fix broken test * Move file from hints_utils and rename * Delete debug * Move integration test to cairo_run_test.go * Return error of IdsData.Insert * Change to camel case * Add Integration test --------- Co-authored-by: Milton <[email protected]> Co-authored-by: mmsc2 <[email protected]> Co-authored-by: Mariano A. Nicolini <[email protected]> Co-authored-by: juan.mv <[email protected]> Co-authored-by: Pedro Fontana <[email protected]>
- Loading branch information
1 parent
6d9bbf0
commit 51db1d4
Showing
7 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ func main{range_check_ptr: felt, bitwise_ptr: BitwiseBuiltin*}() { | |
|
||
return (); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
%builtins range_check | ||
from starkware.cairo.common.cairo_secp.bigint import BigInt3, nondet_bigint3 | ||
struct EcPoint { | ||
x: BigInt3, | ||
y: BigInt3, | ||
} | ||
|
||
func ec_double{range_check_ptr}(point: EcPoint, slope: BigInt3) -> (res: BigInt3) { | ||
%{ | ||
from starkware.cairo.common.cairo_secp.secp_utils import pack | ||
SECP_P = 2**255-19 | ||
slope = pack(ids.slope, PRIME) | ||
x = pack(ids.point.x, PRIME) | ||
y = pack(ids.point.y, PRIME) | ||
value = new_x = (pow(slope, 2, SECP_P) - 2 * x) % SECP_P | ||
%} | ||
|
||
let (new_x: BigInt3) = nondet_bigint3(); | ||
return (res=new_x); | ||
} | ||
|
||
func main{range_check_ptr}() { | ||
let p = EcPoint(BigInt3(1,2,3), BigInt3(4,5,6)); | ||
let s = BigInt3(7,8,9); | ||
let (res) = ec_double(p, s); | ||
assert res.d0 = 21935; | ||
assert res.d1 = 12420; | ||
assert res.d2 = 184; | ||
return (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters