aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-23 21:29:01 +0800
committerobscuren <geffobscura@gmail.com>2015-01-23 21:29:01 +0800
commit7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c (patch)
treea6d55756ec833b3651e5805726813a7ef5af3399 /crypto/crypto_test.go
parent215780ab562b940bfc653c16bf84f812ef062821 (diff)
parentd792e95c214c8352e6b23b798101e90844eaa7a3 (diff)
downloaddexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.tar
dexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.tar.gz
dexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.tar.bz2
dexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.tar.lz
dexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.tar.xz
dexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.tar.zst
dexon-7a894e37388fccef1fa7945bb20b7cf8f0c1ce3c.zip
Merge branch 'develop' into jsonrpc
Diffstat (limited to 'crypto/crypto_test.go')
-rw-r--r--crypto/crypto_test.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go
index 41c05a242..441733f93 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.
@@ -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")
+ }
+}