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 ,
@@ -238,12 +238,10 @@ fn differential_add_and_double(
238
238
239
239
impl ProjectiveMontgomeryXpoint {
240
240
/// The identity element of the group: the point at infinity.
241
- pub fn identity ( ) -> ProjectiveMontgomeryXpoint {
242
- ProjectiveMontgomeryXpoint {
243
- U : FieldElement :: ONE ,
244
- W : FieldElement :: ZERO ,
245
- }
246
- }
241
+ pub const IDENTITY : Self = Self {
242
+ U : FieldElement :: ONE ,
243
+ W : FieldElement :: ZERO ,
244
+ } ;
247
245
248
246
/// Convert the point to affine form
249
247
pub fn to_affine ( & self ) -> MontgomeryXpoint {
You can’t perform that action at this time.
0 commit comments