File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
ed448-goldilocks/src/montgomery Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ impl Mul<&EdwardsScalar> for &MontgomeryXpoint {
75
75
fn mul ( self , scalar : & EdwardsScalar ) -> ProjectiveMontgomeryXpoint {
76
76
// Algorithm 8 of Costello-Smith 2017
77
77
let affine_u = FieldElement :: from_bytes ( & self . 0 ) ;
78
- let mut x0 = ProjectiveMontgomeryXpoint :: identity ( ) ;
78
+ let mut x0 = ProjectiveMontgomeryXpoint :: IDENTITY ;
79
79
let mut x1 = ProjectiveMontgomeryXpoint {
80
80
U : affine_u,
81
81
W : FieldElement :: ONE ,
@@ -226,12 +226,10 @@ fn differential_add_and_double(
226
226
227
227
impl ProjectiveMontgomeryXpoint {
228
228
/// The identity element of the group: the point at infinity.
229
- pub fn identity ( ) -> ProjectiveMontgomeryXpoint {
230
- ProjectiveMontgomeryXpoint {
231
- U : FieldElement :: ONE ,
232
- W : FieldElement :: ZERO ,
233
- }
234
- }
229
+ pub const IDENTITY : Self = Self {
230
+ U : FieldElement :: ONE ,
231
+ W : FieldElement :: ZERO ,
232
+ } ;
235
233
236
234
/// Compute the Y-coordinate
237
235
// See https://www.rfc-editor.org/rfc/rfc7748#section-1.
You can’t perform that action at this time.
0 commit comments