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 @@ -58,7 +58,7 @@ impl PartialEq for MontgomeryXpoint {
58
58
impl Eq for MontgomeryXpoint { }
59
59
60
60
/// A Projective point in Montgomery form
61
- #[ derive( Copy , Clone , Debug ) ]
61
+ #[ derive( Copy , Clone , Debug , Eq ) ]
62
62
pub struct ProjectiveMontgomeryXpoint {
63
63
U : FieldElement ,
64
64
W : FieldElement ,
@@ -136,6 +136,12 @@ impl MontgomeryXpoint {
136
136
}
137
137
}
138
138
139
+ impl ConstantTimeEq for ProjectiveMontgomeryXpoint {
140
+ fn ct_eq ( & self , other : & Self ) -> Choice {
141
+ self . U . ct_eq ( & other. U ) & self . W . ct_eq ( & other. W )
142
+ }
143
+ }
144
+
139
145
impl ConditionallySelectable for ProjectiveMontgomeryXpoint {
140
146
fn conditional_select (
141
147
a : & ProjectiveMontgomeryXpoint ,
@@ -149,6 +155,12 @@ impl ConditionallySelectable for ProjectiveMontgomeryXpoint {
149
155
}
150
156
}
151
157
158
+ impl PartialEq for ProjectiveMontgomeryXpoint {
159
+ fn eq ( & self , other : & Self ) -> bool {
160
+ self . ct_eq ( other) . into ( )
161
+ }
162
+ }
163
+
152
164
fn differential_add_and_double (
153
165
P : & mut ProjectiveMontgomeryXpoint ,
154
166
Q : & mut ProjectiveMontgomeryXpoint ,
You can’t perform that action at this time.
0 commit comments