Commit 8f69b5c7 authored by obscuren's avatar obscuren

Added invalid sec key test

parent d2a4bc4d
...@@ -3,9 +3,10 @@ package secp256k1 ...@@ -3,9 +3,10 @@ package secp256k1
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/crypto/randentropy"
"log" "log"
"testing" "testing"
"github.com/ethereum/go-ethereum/crypto/randentropy"
) )
const TESTS = 10000 // how many tests const TESTS = 10000 // how many tests
...@@ -227,3 +228,11 @@ func Test_Secp256_06b(t *testing.T) { ...@@ -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) 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)
}
}
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