File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
ed448-goldilocks/src/montgomery Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ impl PartialEq for MontgomeryXpoint {
62
62
impl Eq for MontgomeryXpoint { }
63
63
64
64
/// A Projective point in Montgomery form
65
- #[ derive( Copy , Clone , Debug ) ]
65
+ #[ derive( Copy , Clone , Debug , Eq ) ]
66
66
pub struct ProjectiveMontgomeryXpoint {
67
67
U : FieldElement ,
68
68
W : FieldElement ,
@@ -140,6 +140,12 @@ impl MontgomeryXpoint {
140
140
}
141
141
}
142
142
143
+ impl ConstantTimeEq for ProjectiveMontgomeryXpoint {
144
+ fn ct_eq ( & self , other : & Self ) -> Choice {
145
+ ( self . U * other. W ) . ct_eq ( & ( other. U * self . W ) )
146
+ }
147
+ }
148
+
143
149
impl ConditionallySelectable for ProjectiveMontgomeryXpoint {
144
150
fn conditional_select (
145
151
a : & ProjectiveMontgomeryXpoint ,
@@ -153,6 +159,12 @@ impl ConditionallySelectable for ProjectiveMontgomeryXpoint {
153
159
}
154
160
}
155
161
162
+ impl PartialEq for ProjectiveMontgomeryXpoint {
163
+ fn eq ( & self , other : & Self ) -> bool {
164
+ self . ct_eq ( other) . into ( )
165
+ }
166
+ }
167
+
156
168
fn differential_add_and_double (
157
169
P : & mut ProjectiveMontgomeryXpoint ,
158
170
Q : & mut ProjectiveMontgomeryXpoint ,
You can’t perform that action at this time.
0 commit comments