diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2017-02-18 16:24:12 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-02-18 16:24:12 +0800 |
commit | 9b0af513867fad4aeb3516e4711dd0ea4f5bc90c (patch) | |
tree | b37d808d57873c6aec550431534e26602dfd0475 /whisper/whisperv2/message_test.go | |
parent | bf21549faa7de6e2b920855468b14856c6f503c4 (diff) | |
download | go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.gz go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.bz2 go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.lz go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.xz go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.zst go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.zip |
crypto: add btcec fallback for sign/recover without cgo (#3680)
* vendor: add github.com/btcsuite/btcd/btcec
* crypto: add btcec fallback for sign/recover without cgo
This commit adds a non-cgo fallback implementation of secp256k1
operations.
* crypto, core/vm: remove wrappers for sha256, ripemd160
Diffstat (limited to 'whisper/whisperv2/message_test.go')
-rw-r--r-- | whisper/whisperv2/message_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/whisper/whisperv2/message_test.go b/whisper/whisperv2/message_test.go index d3b307d2a..c760ac54c 100644 --- a/whisper/whisperv2/message_test.go +++ b/whisper/whisperv2/message_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/secp256k1" ) // Tests whether a message can be wrapped without any identity or encryption. @@ -73,8 +72,8 @@ func TestMessageCleartextSignRecover(t *testing.T) { if pubKey == nil { t.Fatalf("failed to recover public key") } - p1 := elliptic.Marshal(secp256k1.S256(), key.PublicKey.X, key.PublicKey.Y) - p2 := elliptic.Marshal(secp256k1.S256(), pubKey.X, pubKey.Y) + p1 := elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y) + p2 := elliptic.Marshal(crypto.S256(), pubKey.X, pubKey.Y) if !bytes.Equal(p1, p2) { t.Fatalf("public key mismatch: have 0x%x, want 0x%x", p2, p1) } @@ -151,8 +150,8 @@ func TestMessageFullCrypto(t *testing.T) { if pubKey == nil { t.Fatalf("failed to recover public key") } - p1 := elliptic.Marshal(secp256k1.S256(), fromKey.PublicKey.X, fromKey.PublicKey.Y) - p2 := elliptic.Marshal(secp256k1.S256(), pubKey.X, pubKey.Y) + p1 := elliptic.Marshal(crypto.S256(), fromKey.PublicKey.X, fromKey.PublicKey.Y) + p2 := elliptic.Marshal(crypto.S256(), pubKey.X, pubKey.Y) if !bytes.Equal(p1, p2) { t.Fatalf("public key mismatch: have 0x%x, want 0x%x", p2, p1) } |