aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/elliptic/p224.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/elliptic/p224.go')
-rw-r--r--src/crypto/elliptic/p224.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/crypto/elliptic/p224.go b/src/crypto/elliptic/p224.go
index 8c76021464..ff5c834452 100644
--- a/src/crypto/elliptic/p224.go
+++ b/src/crypto/elliptic/p224.go
@@ -48,6 +48,11 @@ func (curve p224Curve) Params() *CurveParams {
}
func (curve p224Curve) IsOnCurve(bigX, bigY *big.Int) bool {
+ if bigX.Sign() < 0 || bigX.Cmp(curve.P) >= 0 ||
+ bigY.Sign() < 0 || bigY.Cmp(curve.P) >= 0 {
+ return false
+ }
+
var x, y p224FieldElement
p224FromBig(&x, bigX)
p224FromBig(&y, bigY)