summaryrefslogtreecommitdiff
path: root/libgo/go/crypto/elliptic/elliptic_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/elliptic/elliptic_test.go')
-rw-r--r--libgo/go/crypto/elliptic/elliptic_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/libgo/go/crypto/elliptic/elliptic_test.go b/libgo/go/crypto/elliptic/elliptic_test.go
index c23af754f78..1e3407ee0e7 100644
--- a/libgo/go/crypto/elliptic/elliptic_test.go
+++ b/libgo/go/crypto/elliptic/elliptic_test.go
@@ -6,6 +6,7 @@ package elliptic
import (
"crypto/rand"
+ "encoding/hex"
"fmt"
"math/big"
"testing"
@@ -350,3 +351,13 @@ func TestMarshal(t *testing.T) {
return
}
}
+
+func TestP224Overflow(t *testing.T) {
+ // This tests for a specific bug in the P224 implementation.
+ p224 := P224()
+ pointData, _ := hex.DecodeString("049B535B45FB0A2072398A6831834624C7E32CCFD5A4B933BCEAF77F1DD945E08BBE5178F5EDF5E733388F196D2A631D2E075BB16CBFEEA15B")
+ x, y := Unmarshal(p224, pointData)
+ if !p224.IsOnCurve(x, y) {
+ t.Error("P224 failed to validate a correct point")
+ }
+}