From 67f9783e6a0fa5613a031e05549b92adbee57399 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 22 Jan 2015 00:35:00 +0100 Subject: Moved `obscuren` secp256k1-go --- crypto/crypto_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto/crypto_test.go') diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 41c05a242..349bc31ae 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/ethutil" - "github.com/obscuren/secp256k1-go" ) // These tests are sanity checks. -- cgit v1.2.3 From d4cc2d3503ce7497ef0cb39456a332b25e0999b9 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 22 Jan 2015 18:12:05 +0100 Subject: Pad private key when signing & length check for hashes in sign --- crypto/crypto_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'crypto/crypto_test.go') diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 349bc31ae..441733f93 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -52,7 +52,7 @@ func BenchmarkSha3(b *testing.B) { } func Test0Key(t *testing.T) { - + t.Skip() key := ethutil.Hex2Bytes("1111111111111111111111111111111111111111111111111111111111111111") p, err := secp256k1.GeneratePubKey(key) @@ -60,3 +60,15 @@ func Test0Key(t *testing.T) { fmt.Printf("%x\n", p) fmt.Printf("%v %x\n", err, addr) } + +func TestInvalidSign(t *testing.T) { + _, err := Sign(make([]byte, 1), nil) + if err == nil { + t.Errorf("expected sign with hash 1 byte to error") + } + + _, err = Sign(make([]byte, 33), nil) + if err == nil { + t.Errorf("expected sign with hash 33 byte to error") + } +} -- cgit v1.2.3