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