Skip to content

Commit eef0650

Browse files
field: fix Invert comment (#48)
[Curve25519: new Diffie-Hellman speed records](https://cr.yp.to/ecdh/curve25519-20060209.pdf) states that inverting an element is "a straightforward sequence of 254 squarings and 11 multiplications" which can also be verified by counting the number of [Element.Square] calls.
1 parent 62e99b0 commit eef0650

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

field/fe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (v *Element) Negate(a *Element) *Element {
119119
// If z == 0, Invert returns v = 0.
120120
func (v *Element) Invert(z *Element) *Element {
121121
// Inversion is implemented as exponentiation with exponent p − 2. It uses the
122-
// same sequence of 255 squarings and 11 multiplications as [Curve25519].
122+
// same sequence of 254 squarings and 11 multiplications as [Curve25519].
123123
var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t Element
124124

125125
z2.Square(z) // 2

0 commit comments

Comments
 (0)