-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
2,108 additions
and
462 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
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
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,26 @@ | ||
// Represents a big integer defined by: | ||
// d0 + BASE * d1 + BASE**2 * d2. | ||
// Note that the limbs (d_i) are NOT restricted to the range [0, BASE) and in particular they | ||
// can be negative. | ||
// In most cases this is used to represent a Secp256k1 or Secp256r1 field element. | ||
struct UnreducedBigInt3 { | ||
d0: felt, | ||
d1: felt, | ||
d2: felt, | ||
} | ||
|
||
// Same as UnreducedBigInt3, except that d0, d1 and d2 satisfy the bounds of | ||
// nondet_bigint3 or are the difference of two values satisfying those bounds. | ||
// In most cases this is used to represent a Secp256k1 or Secp256r1 field element. | ||
struct BigInt3 { | ||
d0: felt, | ||
d1: felt, | ||
d2: felt, | ||
} | ||
|
||
// Same as BigInt3, except the bounds on d0, d1 and d2 are twice as large. | ||
struct SumBigInt3 { | ||
d0: felt, | ||
d1: felt, | ||
d2: felt, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from starkware.cairo.common.cairo_secp.bigint3 import BigInt3 | ||
|
||
// Represents a point on the secp256k1 elliptic curve. | ||
// The zero point is represented as a point with x = 0 (there is no point on the curve with a zero | ||
// x value). | ||
// x and y satisfy the bounds of nondet_bigint3 for the relevant curve. | ||
struct EcPoint { | ||
x: BigInt3, | ||
y: BigInt3, | ||
} |
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
Oops, something went wrong.