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 @@ -71,7 +71,7 @@ impl Mul<&EdwardsScalar> for &MontgomeryXpoint {
71
71
fn mul ( self , scalar : & EdwardsScalar ) -> ProjectiveMontgomeryXpoint {
72
72
// Algorithm 8 of Costello-Smith 2017
73
73
let affine_u = FieldElement :: from_bytes ( & self . 0 ) ;
74
- let mut x0 = ProjectiveMontgomeryXpoint :: identity ( ) ;
74
+ let mut x0 = ProjectiveMontgomeryXpoint :: IDENTITY ;
75
75
let mut x1 = ProjectiveMontgomeryXpoint {
76
76
U : affine_u,
77
77
W : FieldElement :: ONE ,
@@ -222,12 +222,10 @@ fn differential_add_and_double(
222
222
223
223
impl ProjectiveMontgomeryXpoint {
224
224
/// The identity element of the group: the point at infinity.
225
- pub fn identity ( ) -> ProjectiveMontgomeryXpoint {
226
- ProjectiveMontgomeryXpoint {
227
- U : FieldElement :: ONE ,
228
- W : FieldElement :: ZERO ,
229
- }
230
- }
225
+ pub const IDENTITY : Self = Self {
226
+ U : FieldElement :: ONE ,
227
+ W : FieldElement :: ZERO ,
228
+ } ;
231
229
232
230
/// Compute the Y-coordinate
233
231
// See https://www.rfc-editor.org/rfc/rfc7748#section-1.
You can’t perform that action at this time.
0 commit comments