aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-12-02 20:19:33 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-12-02 20:19:33 +0800
commit888e7bc765acc6bfe0b8afc4ecd9830394b0a026 (patch)
tree5a27f4efd453c776f35ace6ae08c28c11417f9d5 /whisper
parent8db9d44ca9fb6baf406256cae491c475de2f4989 (diff)
parentc8ad64f33cd04fc10ac6681260ea06e464908c91 (diff)
downloaddexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.tar
dexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.tar.gz
dexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.tar.bz2
dexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.tar.lz
dexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.tar.xz
dexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.tar.zst
dexon-888e7bc765acc6bfe0b8afc4ecd9830394b0a026.zip
Merge pull request #1862 from Gustav-Simonsson/libsecp256k1_ecdh
crypto, crypto/secp256k1: use libsecp256k1 for scalar multiplication
Diffstat (limited to 'whisper')
-rw-r--r--whisper/message_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/whisper/message_test.go b/whisper/message_test.go
index 6ff95efff..d70da40a4 100644
--- a/whisper/message_test.go
+++ b/whisper/message_test.go
@@ -23,6 +23,7 @@ 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.
@@ -72,8 +73,8 @@ func TestMessageCleartextSignRecover(t *testing.T) {
if pubKey == nil {
t.Fatalf("failed to recover public key")
}
- p1 := elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y)
- p2 := elliptic.Marshal(crypto.S256(), pubKey.X, pubKey.Y)
+ p1 := elliptic.Marshal(secp256k1.S256(), key.PublicKey.X, key.PublicKey.Y)
+ p2 := elliptic.Marshal(secp256k1.S256(), pubKey.X, pubKey.Y)
if !bytes.Equal(p1, p2) {
t.Fatalf("public key mismatch: have 0x%x, want 0x%x", p2, p1)
}
@@ -150,8 +151,8 @@ func TestMessageFullCrypto(t *testing.T) {
if pubKey == nil {
t.Fatalf("failed to recover public key")
}
- p1 := elliptic.Marshal(crypto.S256(), fromKey.PublicKey.X, fromKey.PublicKey.Y)
- p2 := elliptic.Marshal(crypto.S256(), pubKey.X, pubKey.Y)
+ p1 := elliptic.Marshal(secp256k1.S256(), fromKey.PublicKey.X, fromKey.PublicKey.Y)
+ p2 := elliptic.Marshal(secp256k1.S256(), pubKey.X, pubKey.Y)
if !bytes.Equal(p1, p2) {
t.Fatalf("public key mismatch: have 0x%x, want 0x%x", p2, p1)
}