diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-16 20:19:57 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-16 20:19:57 +0800 |
commit | 8f69b5c7a221e51e41985e82ef0a22ddc6444b5f (patch) | |
tree | bec33f8bdb940e1e474e4f40846f8f072384f1a8 /crypto/secp256k1 | |
parent | d2a4bc4d7389f4b442a19fc03d0d664c19f931e2 (diff) | |
download | go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.tar go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.tar.gz go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.tar.bz2 go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.tar.lz go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.tar.xz go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.tar.zst go-tangerine-8f69b5c7a221e51e41985e82ef0a22ddc6444b5f.zip |
Added invalid sec key test
Diffstat (limited to 'crypto/secp256k1')
-rw-r--r-- | crypto/secp256k1/secp256_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/secp256k1/secp256_test.go b/crypto/secp256k1/secp256_test.go index 5e657cd72..3599fde38 100644 --- a/crypto/secp256k1/secp256_test.go +++ b/crypto/secp256k1/secp256_test.go @@ -3,9 +3,10 @@ package secp256k1 import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/crypto/randentropy" "log" "testing" + + "github.com/ethereum/go-ethereum/crypto/randentropy" ) const TESTS = 10000 // how many tests @@ -227,3 +228,11 @@ func Test_Secp256_06b(t *testing.T) { fmt.Printf("ERROR: Accepted signature for %v of %v random messages\n", fail_count, TESTS) } } + +func TestInvalidKey(t *testing.T) { + p1 := make([]byte, 32) + err := VerifySeckeyValidity(p1) + if err == nil { + t.Errorf("pvk %x varify sec key should have returned error", p1) + } +} |