We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ProjectiveMontgomeryXpoint::double()
1 parent 8ae8a2f commit fa1b45dCopy full SHA for fa1b45d
ed448-goldilocks/src/montgomery/x.rs
@@ -255,6 +255,20 @@ impl ProjectiveMontgomeryXpoint {
255
v
256
}
257
258
+ /// Double this point
259
+ // https://eprint.iacr.org/2020/1338.pdf (2.2)
260
+ pub fn double(&self) -> Self {
261
+ let v1 = (self.U + self.W).square();
262
+ let v2 = (self.U - self.W).square();
263
+ let U = v1 * v2;
264
+ let v3 = v1 - v2;
265
+ let v4 = FieldElement::A_PLUS_TWO_OVER_FOUR * v3;
266
+ let v5 = v2 + v4;
267
+ let W = v3 * v5;
268
+
269
+ Self { U, W }
270
+ }
271
272
/// Convert the point to affine form
273
pub fn to_affine(&self) -> MontgomeryXpoint {
274
let x = self.U * self.W.invert();
0 commit comments