]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/elliptic: call IsOnCurve via the interface.
authorAdam Langley <agl@golang.org>
Wed, 22 Jul 2015 16:31:29 +0000 (09:31 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 22 Jul 2015 17:37:36 +0000 (17:37 +0000)
https://go-review.googlesource.com/#/c/2421/ contains an unfortunate
slip where IsOnCurve is called on the CurveParams rather than the curve.
This doesn't really matter, but it's a pain for people doing tricks with
crypto/elliptic and means that 1.5 would be a regression for them
without this change.

See https://groups.google.com/forum/#!topic/golang-dev/i8OPUTYctOk

Change-Id: Ifa5f25f9a95d7484cb53d4883cfd78dc58a0f9a7
Reviewed-on: https://go-review.googlesource.com/12506
Reviewed-by: Russ Cox <rsc@golang.org>
src/crypto/elliptic/elliptic.go

index f3b84e1eac8d1b527c312ceac0fc6056fda2fe2d..e6b59c5f436b9d24a8a61e093bd2adcc079e72ba 100644 (file)
@@ -320,7 +320,7 @@ func Unmarshal(curve Curve, data []byte) (x, y *big.Int) {
        }
        x = new(big.Int).SetBytes(data[1 : 1+byteLen])
        y = new(big.Int).SetBytes(data[1+byteLen:])
-       if !curve.Params().IsOnCurve(x, y) {
+       if !curve.IsOnCurve(x, y) {
                x, y = nil, nil
        }
        return