diff options
Diffstat (limited to 'crypto/crypto_test.go')
-rw-r--r-- | crypto/crypto_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index b4c441e5f..835035462 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -40,6 +40,15 @@ func TestKeccak256Hash(t *testing.T) { checkhash(t, "Sha3-256-array", func(in []byte) []byte { h := Keccak256Hash(in); return h[:] }, msg, exp) } +func TestToECDSAErrors(t *testing.T) { + if _, err := HexToECDSA("0000000000000000000000000000000000000000000000000000000000000000"); err == nil { + t.Fatal("HexToECDSA should've returned error") + } + if _, err := HexToECDSA("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); err == nil { + t.Fatal("HexToECDSA should've returned error") + } +} + func BenchmarkSha3(b *testing.B) { a := []byte("hello world") for i := 0; i < b.N; i++ { |