1
1
use starknet_types_core:: curve:: AffinePoint ;
2
2
use starknet_types_core:: felt:: Felt ;
3
3
4
+ /// EC order of the STARK curve for ECDSA. Equals to
5
+ /// `0x0800000000000010ffffffffffffffffb781126dcae7b2321e66a241adc64d2f`.
4
6
pub const EC_ORDER : Felt = Felt :: from_raw ( [
5
7
369010039416812937 ,
6
8
9 ,
7
9
1143265896874747514 ,
8
10
8939893405601011193 ,
9
11
] ) ;
10
12
13
+ /// The alpha parameter of the STARK curve. Equals to
14
+ /// `0x0000000000000000000000000000000000000000000000000000000000000001`.
15
+ ///
16
+ /// The alpha parameter is used in the curve definition as:
17
+ ///
18
+ /// ```markdown
19
+ /// y^2 = x^3 + alpha * x + beta
20
+ /// ```
11
21
pub const ALPHA : Felt = Felt :: from_raw ( [
12
22
576460752303422960 ,
13
23
18446744073709551615 ,
14
24
18446744073709551615 ,
15
25
18446744073709551585 ,
16
26
] ) ;
17
27
28
+ /// The beta parameter of the STARK curve. Equals to
29
+ /// `0x06f21413efbe40de150e596d72f7a8c5609ad26c15c915c1f4cdfcb99cee9e89`.
30
+ ///
31
+ /// The beta parameter is used in the curve definition as:
32
+ ///
33
+ /// ```markdown
34
+ /// y^2 = x^3 + alpha * x + beta
35
+ /// ```
18
36
pub const BETA : Felt = Felt :: from_raw ( [
19
37
88155977965380735 ,
20
38
12360725113329547591 ,
21
39
7432612994240712710 ,
22
40
3863487492851900874 ,
23
41
] ) ;
24
42
43
+ /// Generator point of the STARK curve.
44
+ ///
45
+ /// Coordinates:
46
+ ///
47
+ /// - x: `0x01ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca`
48
+ /// - y: `0x005668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f`
25
49
pub const GENERATOR : AffinePoint = AffinePoint :: new_unchecked (
26
50
Felt :: from_raw ( [
27
51
232005955912912577 ,
@@ -37,6 +61,12 @@ pub const GENERATOR: AffinePoint = AffinePoint::new_unchecked(
37
61
] ) ,
38
62
) ;
39
63
64
+ /// Shift point of the STARK curve.
65
+ ///
66
+ /// Coordinates:
67
+ ///
68
+ /// - x: `0x049ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804`
69
+ /// - y: `0x03ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a`
40
70
pub const SHIFT_POINT : AffinePoint = AffinePoint :: new_unchecked (
41
71
Felt :: from_raw ( [
42
72
316327189671755572 ,
@@ -52,6 +82,12 @@ pub const SHIFT_POINT: AffinePoint = AffinePoint::new_unchecked(
52
82
] ) ,
53
83
) ;
54
84
85
+ /// The P0 constant of the STARK curve.
86
+ ///
87
+ /// Coordinates:
88
+ ///
89
+ /// - x: `0x0234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b`
90
+ /// - y: `0x03b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615`
55
91
pub const PEDERSEN_P0 : AffinePoint = AffinePoint :: new_unchecked (
56
92
Felt :: from_raw ( [
57
93
241691544791834578 ,
@@ -67,6 +103,12 @@ pub const PEDERSEN_P0: AffinePoint = AffinePoint::new_unchecked(
67
103
] ) ,
68
104
) ;
69
105
106
+ /// The P1 constant of the STARK curve.
107
+ ///
108
+ /// Coordinates:
109
+ ///
110
+ /// - x: `0x04fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378`
111
+ /// - y: `0x03fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d`
70
112
pub const PEDERSEN_P1 : AffinePoint = AffinePoint :: new_unchecked (
71
113
Felt :: from_raw ( [
72
114
253000153565733272 ,
@@ -82,6 +124,12 @@ pub const PEDERSEN_P1: AffinePoint = AffinePoint::new_unchecked(
82
124
] ) ,
83
125
) ;
84
126
127
+ /// The P2 constant of the STARK curve.
128
+ ///
129
+ /// Coordinates:
130
+ ///
131
+ /// - x: `0x04ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997`
132
+ /// - y: `0x0040301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c`
85
133
pub const PEDERSEN_P2 : AffinePoint = AffinePoint :: new_unchecked (
86
134
Felt :: from_raw ( [
87
135
338510149841406402 ,
@@ -97,6 +145,12 @@ pub const PEDERSEN_P2: AffinePoint = AffinePoint::new_unchecked(
97
145
] ) ,
98
146
) ;
99
147
148
+ /// The P3 constant of the STARK curve.
149
+ ///
150
+ /// Coordinates:
151
+ ///
152
+ /// - x: `0x054302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202`
153
+ /// - y: `0x01b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426`
100
154
pub const PEDERSEN_P3 : AffinePoint = AffinePoint :: new_unchecked (
101
155
Felt :: from_raw ( [
102
156
425493972656615276 ,
0 commit comments