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 2308d95 commit 61b5e50Copy full SHA for 61b5e50
ed448-goldilocks/src/montgomery/x.rs
@@ -252,6 +252,20 @@ impl ProjectiveMontgomeryXpoint {
252
v
253
}
254
255
+ /// Double this point
256
+ // https://eprint.iacr.org/2020/1338.pdf (2.2)
257
+ pub fn double(&self) -> Self {
258
+ let v1 = (self.U + self.W).square();
259
+ let v2 = (self.U - self.W).square();
260
+ let U = v1 * v2;
261
+ let v3 = v1 - v2;
262
+ let v4 = FieldElement::A_PLUS_TWO_OVER_FOUR * v3;
263
+ let v5 = v2 + v4;
264
+ let W = v3 * v5;
265
+
266
+ Self { U, W }
267
+ }
268
269
/// Convert the point to affine form
270
pub fn to_affine(&self) -> MontgomeryXpoint {
271
let x = self.U * self.W.invert();
0 commit comments