Commit bad52b35 authored by Adam Langley's avatar Adam Langley Committed by Russ Cox

crypto/elliptic: call IsOnCurve via the interface.

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/12506Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent a502fb21
...@@ -320,7 +320,7 @@ func Unmarshal(curve Curve, data []byte) (x, y *big.Int) { ...@@ -320,7 +320,7 @@ func Unmarshal(curve Curve, data []byte) (x, y *big.Int) {
} }
x = new(big.Int).SetBytes(data[1 : 1+byteLen]) x = new(big.Int).SetBytes(data[1 : 1+byteLen])
y = new(big.Int).SetBytes(data[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 x, y = nil, nil
} }
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment