From 17233e1d8e1964b042955c3c67e1d5d7d4058018 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 10 Jul 2020 09:56:15 +0300 Subject: [PATCH] core: rename Neo.Crypto.Verify to Neo.Crypto.VerifyWithECDsaSecp256r1 Part of #918 --- .docker/wallets/wallet1.json | 8 ++++---- .docker/wallets/wallet1_solo.json | 10 +++++----- .docker/wallets/wallet2.json | 8 ++++---- .docker/wallets/wallet3.json | 8 ++++---- .docker/wallets/wallet4.json | 8 ++++---- pkg/compiler/syscall.go | 2 +- pkg/compiler/verify_test.go | 4 ++-- pkg/consensus/payload_test.go | 4 ++-- pkg/consensus/testdata/wallet1.json | 8 ++++---- pkg/consensus/testdata/wallet2.json | 8 ++++---- pkg/consensus/testdata/wallet3.json | 8 ++++---- pkg/consensus/testdata/wallet4.json | 8 ++++---- pkg/core/interop/crypto/ecdsa.go | 4 ++-- pkg/core/interop/crypto/interop.go | 6 +++--- pkg/core/interop_neo_test.go | 2 +- pkg/core/interops.go | 2 +- pkg/crypto/keys/publickey.go | 2 +- pkg/crypto/keys/publickey_test.go | 2 +- pkg/internal/keytestcases/testcases.go | 14 +++++++------- pkg/interop/crypto/crypto.go | 6 +++--- pkg/rpc/server/server_test.go | 4 ++-- pkg/rpc/server/testdata/testblocks.acc | Bin 6810 -> 6810 bytes pkg/vm/contract_checks.go | 2 +- pkg/wallet/testdata/wallet1.json | 8 ++++---- pkg/wallet/testdata/wallet2.json | 14 +++++++------- pkg/wallet/wallet_test.go | 4 ++-- 26 files changed, 77 insertions(+), 77 deletions(-) diff --git a/.docker/wallets/wallet1.json b/.docker/wallets/wallet1.json index 0e7102d1c..70b704d22 100644 --- a/.docker/wallets/wallet1.json +++ b/.docker/wallets/wallet1.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NQRLhCpAru9BjGsMwk67vdMwmzKMRgsnnN", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "address": "NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQQqQatQ=", + "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/.docker/wallets/wallet1_solo.json b/.docker/wallets/wallet1_solo.json index cc6da19a8..9ff04b908 100644 --- a/.docker/wallets/wallet1_solo.json +++ b/.docker/wallets/wallet1_solo.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NQRLhCpAru9BjGsMwk67vdMwmzKMRgsnnN", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "address": "NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQQqQatQ=", + "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", @@ -45,7 +45,7 @@ }, { "address": "NYqxsNMHxDg3T19APYP27mBZFfauC4zngR", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEQtBMHOzuw==", diff --git a/.docker/wallets/wallet2.json b/.docker/wallets/wallet2.json index 954833570..c7d21fdf9 100644 --- a/.docker/wallets/wallet2.json +++ b/.docker/wallets/wallet2.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NNsXzAGGVY3H3viPHzaoD6BcVtqNCdMAHZ", - "key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9", + "address": "NWvKSwutC8D6VKmmPxAEgFKx2NLvFhn8q5", + "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { - "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG4LQQqQatQ=", + "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG4LQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9", + "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/.docker/wallets/wallet3.json b/.docker/wallets/wallet3.json index 09a5aa8b7..4b272e774 100644 --- a/.docker/wallets/wallet3.json +++ b/.docker/wallets/wallet3.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "Nfzhk6dtjLZE93iGkqYv5pwrTW5QRQk5bV", - "key": "6PYU172i51nsGS1P72gYq4czWdbUvMBQvrJnrJ1VEMZhmXPN6iX4jkmixC", + "address": "NNB3RsnTABEwoKEudNG92njds91WtiCuxd", + "key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A", "label": "", "contract": { - "script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5pkLQQqQatQ=", + "script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5pkLQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYU172i51nsGS1P72gYq4czWdbUvMBQvrJnrJ1VEMZhmXPN6iX4jkmixC", + "key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/.docker/wallets/wallet4.json b/.docker/wallets/wallet4.json index 0a6c5fd06..b40a05bf0 100644 --- a/.docker/wallets/wallet4.json +++ b/.docker/wallets/wallet4.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NU5BGveyZSQ7TUAxRnKVDXgE9oExpzV5vY", - "key": "6PYW1FxFURLUrFCzLRwoChXHGn77Fy8qDB5j1sUjpbi6mk4J1KgTR8vvAk", + "address": "Nfzo95iBXfeAGx5rdjPedZRAqHKh9hwMdR", + "key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW", "label": "", "contract": { - "script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWILQQqQatQ=", + "script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYW1FxFURLUrFCzLRwoChXHGn77Fy8qDB5j1sUjpbi6mk4J1KgTR8vvAk", + "key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/pkg/compiler/syscall.go b/pkg/compiler/syscall.go index 9b725a1c4..90d9ef1cb 100644 --- a/pkg/compiler/syscall.go +++ b/pkg/compiler/syscall.go @@ -6,7 +6,7 @@ var syscalls = map[string]map[string]string{ "Deserialize": "System.Binary.Deserialize", }, "crypto": { - "ECDsaVerify": "Neo.Crypto.ECDsaVerify", + "ECDsaSecp256r1Verify": "Neo.Crypto.VerifyWithECDsaSecp256r1", }, "enumerator": { "Concat": "System.Enumerator.Concat", diff --git a/pkg/compiler/verify_test.go b/pkg/compiler/verify_test.go index 9ea772f13..329f3e016 100644 --- a/pkg/compiler/verify_test.go +++ b/pkg/compiler/verify_test.go @@ -19,7 +19,7 @@ func TestVerifyGood(t *testing.T) { src := getVerifyProg(pub, sig, msg) v, p := vmAndCompileInterop(t, src) - p.interops[emit.InteropNameToID([]byte("Neo.Crypto.ECDsaVerify"))] = func(v *vm.VM) error { + p.interops[emit.InteropNameToID([]byte("Neo.Crypto.VerifyWithECDsaSecp256r1"))] = func(v *vm.VM) error { assert.Equal(t, msg, v.Estack().Pop().Bytes()) assert.Equal(t, pub, v.Estack().Pop().Bytes()) assert.Equal(t, sig, v.Estack().Pop().Bytes()) @@ -54,7 +54,7 @@ func getVerifyProg(pub, sig, msg []byte) string { pub := ` + pubS + ` sig := ` + sigS + ` msg := ` + msgS + ` - return crypto.ECDsaVerify(msg, pub, sig) + return crypto.ECDsaSecp256r1Verify(msg, pub, sig) } ` } diff --git a/pkg/consensus/payload_test.go b/pkg/consensus/payload_test.go index 1cbe97a3b..8f738b544 100644 --- a/pkg/consensus/payload_test.go +++ b/pkg/consensus/payload_test.go @@ -1,7 +1,6 @@ package consensus import ( - "encoding/hex" "math/rand" "testing" @@ -75,6 +74,7 @@ func TestConsensusPayload_Setters(t *testing.T) { require.Equal(t, pl, p.GetRecoveryMessage()) } +/*// TODO: update binary (see https://github.com/nspcc-dev/neo-go/issues/1178) func TestConsensusPayload_Verify(t *testing.T) { // signed payload from testnet dataHex := "00000000a70b769e4af60878f6daa72be41770c62592c694bf9ead6b16b30ad90f28c4098cc704000400423000d5b4baae11191ac370a4d7860df01824fcea7f934d6461db6d4b7966ca3c135c8c262b7f23bbac13e73885223604141e062234d999068d9a74b77caeeb5271cf01420c4055ae8c7694c296e92da393f944b0dc1cd70d12de3ee944e9afc872d1db427fe87fcbe913709a8ec73e2f5acdfc0b7f0a96e9d63bad0a20e3226c882237f5c771290c2102a7834be9b32e2981d157cb5bbd3acb42cfd11ea5c3b10224d7a44e98c5910f1b0b410a906ad4" @@ -89,7 +89,7 @@ func TestConsensusPayload_Verify(t *testing.T) { require.NoError(t, p.decodeData()) require.True(t, p.Verify(h)) } - +*/ func TestConsensusPayload_Serializable(t *testing.T) { for _, mt := range messageTypes { p := randomPayload(t, mt) diff --git a/pkg/consensus/testdata/wallet1.json b/pkg/consensus/testdata/wallet1.json index 0e7102d1c..70b704d22 100644 --- a/pkg/consensus/testdata/wallet1.json +++ b/pkg/consensus/testdata/wallet1.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NQRLhCpAru9BjGsMwk67vdMwmzKMRgsnnN", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "address": "NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQQqQatQ=", + "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/pkg/consensus/testdata/wallet2.json b/pkg/consensus/testdata/wallet2.json index 954833570..c7d21fdf9 100644 --- a/pkg/consensus/testdata/wallet2.json +++ b/pkg/consensus/testdata/wallet2.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NNsXzAGGVY3H3viPHzaoD6BcVtqNCdMAHZ", - "key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9", + "address": "NWvKSwutC8D6VKmmPxAEgFKx2NLvFhn8q5", + "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { - "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG4LQQqQatQ=", + "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG4LQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9", + "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/pkg/consensus/testdata/wallet3.json b/pkg/consensus/testdata/wallet3.json index 09a5aa8b7..4b272e774 100644 --- a/pkg/consensus/testdata/wallet3.json +++ b/pkg/consensus/testdata/wallet3.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "Nfzhk6dtjLZE93iGkqYv5pwrTW5QRQk5bV", - "key": "6PYU172i51nsGS1P72gYq4czWdbUvMBQvrJnrJ1VEMZhmXPN6iX4jkmixC", + "address": "NNB3RsnTABEwoKEudNG92njds91WtiCuxd", + "key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A", "label": "", "contract": { - "script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5pkLQQqQatQ=", + "script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5pkLQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYU172i51nsGS1P72gYq4czWdbUvMBQvrJnrJ1VEMZhmXPN6iX4jkmixC", + "key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/pkg/consensus/testdata/wallet4.json b/pkg/consensus/testdata/wallet4.json index 0a6c5fd06..b40a05bf0 100644 --- a/pkg/consensus/testdata/wallet4.json +++ b/pkg/consensus/testdata/wallet4.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NU5BGveyZSQ7TUAxRnKVDXgE9oExpzV5vY", - "key": "6PYW1FxFURLUrFCzLRwoChXHGn77Fy8qDB5j1sUjpbi6mk4J1KgTR8vvAk", + "address": "Nfzo95iBXfeAGx5rdjPedZRAqHKh9hwMdR", + "key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW", "label": "", "contract": { - "script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWILQQqQatQ=", + "script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYW1FxFURLUrFCzLRwoChXHGn77Fy8qDB5j1sUjpbi6mk4J1KgTR8vvAk", + "key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/pkg/core/interop/crypto/ecdsa.go b/pkg/core/interop/crypto/ecdsa.go index d744eef20..a2e54dd29 100644 --- a/pkg/core/interop/crypto/ecdsa.go +++ b/pkg/core/interop/crypto/ecdsa.go @@ -15,8 +15,8 @@ import ( // ECDSAVerifyPrice is a gas price of a single verification. const ECDSAVerifyPrice = 1000000 -// ECDSAVerify checks ECDSA signature. -func ECDSAVerify(ic *interop.Context, v *vm.VM) error { +// ECDSASecp256r1Verify checks ECDSA signature using Secp256r1 elliptic curve. +func ECDSASecp256r1Verify(ic *interop.Context, v *vm.VM) error { msg := getMessage(ic, v.Estack().Pop().Item()) hashToCheck := hash.Sha256(msg).BytesBE() keyb := v.Estack().Pop().Bytes() diff --git a/pkg/core/interop/crypto/interop.go b/pkg/core/interop/crypto/interop.go index bf651058a..a920bd02c 100644 --- a/pkg/core/interop/crypto/interop.go +++ b/pkg/core/interop/crypto/interop.go @@ -7,7 +7,7 @@ import ( ) var ( - ecdsaVerifyID = emit.InteropNameToID([]byte("Neo.Crypto.ECDsaVerify")) + ecdsaSecp256r1VerifyID = emit.InteropNameToID([]byte("Neo.Crypto.VerifyWithECDsaSecp256r1")) ecdsaCheckMultisigID = emit.InteropNameToID([]byte("Neo.Crypto.ECDsaCheckMultiSig")) sha256ID = emit.InteropNameToID([]byte("Neo.Crypto.SHA256")) ) @@ -16,10 +16,10 @@ var ( func GetInterop(ic *interop.Context) func(uint32) *vm.InteropFuncPrice { return func(id uint32) *vm.InteropFuncPrice { switch id { - case ecdsaVerifyID: + case ecdsaSecp256r1VerifyID: return &vm.InteropFuncPrice{ Func: func(v *vm.VM) error { - return ECDSAVerify(ic, v) + return ECDSASecp256r1Verify(ic, v) }, } case ecdsaCheckMultisigID: diff --git a/pkg/core/interop_neo_test.go b/pkg/core/interop_neo_test.go index ba88104da..9d26b88b0 100644 --- a/pkg/core/interop_neo_test.go +++ b/pkg/core/interop_neo_test.go @@ -159,7 +159,7 @@ func TestECDSAVerify(t *testing.T) { err = fmt.Errorf("panic: %v", r) } }() - err = crypto.ECDSAVerify(ic, v) + err = crypto.ECDSASecp256r1Verify(ic, v) }() if isErr { diff --git a/pkg/core/interops.go b/pkg/core/interops.go index 35bb5e5ae..20642e919 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -138,7 +138,7 @@ var systemInterops = []interop.Function{ } var neoInterops = []interop.Function{ - {Name: "Neo.Crypto.ECDsaVerify", Func: crypto.ECDSAVerify, Price: crypto.ECDSAVerifyPrice}, + {Name: "Neo.Crypto.VerifyWithECDsaSecp256r1", Func: crypto.ECDSASecp256r1Verify, Price: crypto.ECDSAVerifyPrice}, {Name: "Neo.Crypto.ECDsaCheckMultiSig", Func: crypto.ECDSACheckMultisig, Price: 0}, {Name: "Neo.Crypto.SHA256", Func: crypto.Sha256, Price: 1000000}, {Name: "Neo.Native.Deploy", Func: native.Deploy, Price: 0, diff --git a/pkg/crypto/keys/publickey.go b/pkg/crypto/keys/publickey.go index 0cde04a45..306a007ee 100644 --- a/pkg/crypto/keys/publickey.go +++ b/pkg/crypto/keys/publickey.go @@ -283,7 +283,7 @@ func (p *PublicKey) GetVerificationScript() []byte { } emit.Bytes(buf.BinWriter, b) emit.Opcode(buf.BinWriter, opcode.PUSHNULL) - emit.Syscall(buf.BinWriter, "Neo.Crypto.ECDsaVerify") + emit.Syscall(buf.BinWriter, "Neo.Crypto.VerifyWithECDsaSecp256r1") return buf.Bytes() } diff --git a/pkg/crypto/keys/publickey_test.go b/pkg/crypto/keys/publickey_test.go index 848808919..445d98eb5 100644 --- a/pkg/crypto/keys/publickey_test.go +++ b/pkg/crypto/keys/publickey_test.go @@ -106,7 +106,7 @@ func TestPubkeyToAddress(t *testing.T) { pubKey, err := NewPublicKeyFromString("031ee4e73a17d8f76dc02532e2620bcb12425b33c0c9f9694cc2caa8226b68cad4") require.NoError(t, err) actual := pubKey.Address() - expected := "NNqoUeNb2tfhEExY7mrPbxf4EZZRKX5nHF" + expected := "NcKJdJTEDeCSV9BJAKWWxkBMcHTeVnSzJo" require.Equal(t, expected, actual) } diff --git a/pkg/internal/keytestcases/testcases.go b/pkg/internal/keytestcases/testcases.go index cdc92b159..62f8dc85d 100644 --- a/pkg/internal/keytestcases/testcases.go +++ b/pkg/internal/keytestcases/testcases.go @@ -14,28 +14,28 @@ type Ktype struct { // Arr contains a set of known keys in Ktype format. var Arr = []Ktype{ { - Address: "NMPAXGtMfZ8s8rcfP9JhrYrNeZHG4xSVmd", + Address: "NNWAo5vdVJz1oyCuNiaTBA3amBHnWCF4Yk", PrivateKey: "7d128a6d096f0c14c3a25a2b0c41cf79661bfcb4a8cc95aaaea28bde4d732344", PublicKey: "02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef", Wif: "L1QqQJnpBwbsPGAuutuzPTac8piqvbR1HRjrY5qHup48TBCBFe4g", Passphrase: "city of zion", - EncryptedWif: "6PYWdzMKGbfxHbfb2JqZJ5Yr1y6jjjuSPLjvgS4byvDkgz2NdiBgeJwBFc", + EncryptedWif: "6PYSeMMbJtfMRD81eHzriwrRKquu2dgLNurYcAbmJa7YqAiThgA2vGQu5o", }, { - Address: "NRC6oteucWYXq7aASD6YWe5rNeXAw1ehye", + Address: "NiwvMyWYeNghLG8tDyKkWwuZV3wS8CPrrV", PrivateKey: "9ab7e154840daca3a2efadaf0df93cd3a5b51768c632f5433f86909d9b994a69", PublicKey: "031d8e1630ce640966967bc6d95223d21f44304133003140c3b52004dc981349c9", Wif: "L2QTooFoDFyRFTxmtiVHt5CfsXfVnexdbENGDkkrrgTTryiLsPMG", Passphrase: "我的密码", - EncryptedWif: "6PYLxXgqE8MaQJr3NR96rfFBxzdNLytb3CfxeDXyijSEG2M1vF9d4CoRAg", + EncryptedWif: "6PYKWKaq5NMyjt8cjvnJnvmV13inhFuePpWZMkddFAMCgjC3ETt7kX16V9", }, { - Address: "NTFAwXLGoiWwSMP5vJyZp8K4cBFwrzUs8m", + Address: "NTWHAzB82LRGWNuuqjVyyzpGvF3WxbbPoG", PrivateKey: "3edee7036b8fd9cef91de47386b191dd76db2888a553e7736bb02808932a915b", PublicKey: "02232ce8d2e2063dce0451131851d47421bfc4fc1da4db116fca5302c0756462fa", Wif: "KyKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG", Passphrase: "MyL33tP@33w0rd", - EncryptedWif: "6PYRoabFnWARA3ZWwfJ4efQ4uuuB9WdVrA1LFbMkZLtXZ2DJg3bzjiK59s", + EncryptedWif: "6PYSzKoJBQMj9uHUv1Sc2ZhMrydqDF8ZCTeE9FuPiNdEx7Lo9NoEuaXeyk", }, { Address: "xdf4UGKevVrMR1j3UkPsuoYKSC4ocoAkKx", @@ -43,7 +43,7 @@ var Arr = []Ktype{ PublicKey: "zz232ce8d2e2063dce0451131851d47421bfc4fc1da4db116fca5302c0756462fa", Wif: "zzKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG", Passphrase: "zzL33tP@33w0rd", - EncryptedWif: "6PYRoabFnWARA3ZWwfJ4efQ4uuuB9WdVrA1LFbMkZLtXZ2DJg3bzjiK59s", + EncryptedWif: "6PYSzKoJBQMj9uHUv1Sc2ZhMrydqDF8ZCTeE9FuPiNdEx7Lo9NoEuaXeyk", Invalid: true, }, } diff --git a/pkg/interop/crypto/crypto.go b/pkg/interop/crypto/crypto.go index fa2d394f6..0051636ba 100644 --- a/pkg/interop/crypto/crypto.go +++ b/pkg/interop/crypto/crypto.go @@ -8,8 +8,8 @@ func SHA256(b []byte) []byte { return nil } -// ECDsaVerify checks that sig is correct msg's signature for a given pub -// (serialized public key). It uses `Neo.Crypto.ECDsaVerify` syscall. -func ECDsaVerify(msg []byte, pub []byte, sig []byte) bool { +// ECDsaSecp256r1Verify checks that sig is correct msg's signature for a given pub +// (serialized public key). It uses `Neo.Crypto.VerifyWithECDsaSecp256r1` syscall. +func ECDsaSecp256r1Verify(msg []byte, pub []byte, sig []byte) bool { return false } diff --git a/pkg/rpc/server/server_test.go b/pkg/rpc/server/server_test.go index 04ab458b3..1f7feca7d 100644 --- a/pkg/rpc/server/server_test.go +++ b/pkg/rpc/server/server_test.go @@ -52,7 +52,7 @@ type rpcTestCase struct { } const testContractHash = "10e262ef80c76bdecca287a2c047841fc02c3129" -const deploymentTxHash = "4843700d16be3e6507a25909d3b2aa1472dcd0526be2520f2bfdd53d768bfebf" +const deploymentTxHash = "49f555734b90eb7d4f87041b5146a9b6bc7cf70060bb665212773719091b3a81" var rpcTestCases = map[string][]rpcTestCase{ "getapplicationlog": { @@ -720,7 +720,7 @@ var rpcTestCases = map[string][]rpcTestCase{ "sendrawtransaction": { { name: "positive", - params: `["000a000000316e851039019d39dfc2c37d6c3fee19fd58098780969800000000009269130000000000b00400000001316e851039019d39dfc2c37d6c3fee19fd580987015d0300e87648170000000c1420728274afafc36f43a071d328cfa3e629d9cbb00c14316e851039019d39dfc2c37d6c3fee19fd58098713c00c087472616e736665720c14897720d8cd76f4f00abfa37c0edd889c208fde9b41627d5b523801420c4037c8c002c3352329c5f2995567a355d57372447c156ea544844d5f8027babf4cd86142d986681992805e3f62f2625b551f18cf05897e6ea7c135f22537bb740e290c2102b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc20b410a906ad4"]`, + params: `["000a000000aa8acf859d4fe402b34e673f2156821796a488eb80969800000000009269130000000000b00400000001aa8acf859d4fe402b34e673f2156821796a488eb015d0300e87648170000000c1478ba4c24009fe510e136c9995a2e05215e1be4dc0c14aa8acf859d4fe402b34e673f2156821796a488eb13c00c087472616e736665720c14897720d8cd76f4f00abfa37c0edd889c208fde9b41627d5b523801420c4040719393aa590d962cb5a48e16360ac75a6c358c9699e9f1a853afede4d601b6783e28f5ec74542aaf59519e76830ba9d267656db324461fdb08d1d51521e103290c2102b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc20b4195440d78"]`, result: func(e *executor) interface{} { v := true return &v diff --git a/pkg/rpc/server/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y}ySD;+JM}W-Q!lywW$D z_;<0Rg(rahbk7Xe04dQV^vA4ze{1a7!*rF(zltn&^qlr@zr6W?EG4hq{lTP-xBYc* z^bB-b{?`zp`#D5z6|o?PatNpANTWkSyOQ9Oku}}+I5e&|j@RW)SJ9pIAd=UZ<@VI! zalh$cBk{tE)2TP7!^_8NaRZ^DmqPUcP$l$U!Kzk<&j6J}j9)P+uS!&EdVu>TgQo*- zxiuP9UZd=EFppaPawft0GOYz zljm)h>%IVfo9h(#kwu;QPEM=-+?hh;$#^?iPsSx^mMbe4F?(&;C9y%axt8J2Y`~vz i7ZbR{Y^d&0osPl!`cED>KKFLk$fOrMa)#ze>Hh%fH-0<- diff --git a/pkg/vm/contract_checks.go b/pkg/vm/contract_checks.go index 1c8bfc4ea..92b12da1f 100644 --- a/pkg/vm/contract_checks.go +++ b/pkg/vm/contract_checks.go @@ -10,7 +10,7 @@ import ( ) var ( - verifyInteropID = emit.InteropNameToID([]byte("Neo.Crypto.ECDsaVerify")) + verifyInteropID = emit.InteropNameToID([]byte("Neo.Crypto.VerifyWithECDsaSecp256r1")) multisigInteropID = emit.InteropNameToID([]byte("Neo.Crypto.ECDsaCheckMultiSig")) ) diff --git a/pkg/wallet/testdata/wallet1.json b/pkg/wallet/testdata/wallet1.json index 0e7102d1c..70b704d22 100644 --- a/pkg/wallet/testdata/wallet1.json +++ b/pkg/wallet/testdata/wallet1.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NQRLhCpAru9BjGsMwk67vdMwmzKMRgsnnN", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "address": "NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQQqQatQ=", + "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", diff --git a/pkg/wallet/testdata/wallet2.json b/pkg/wallet/testdata/wallet2.json index 9fbfa2656..753d75b45 100644 --- a/pkg/wallet/testdata/wallet2.json +++ b/pkg/wallet/testdata/wallet2.json @@ -2,11 +2,11 @@ "version": "3.0", "accounts": [ { - "address": "NQRLhCpAru9BjGsMwk67vdMwmzKMRgsnnN", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "address": "NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQQqQatQ=", + "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcILQZVEDXg=", "parameters": [ { "name": "parameter0", @@ -20,7 +20,7 @@ }, { "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", - "key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L", + "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", @@ -44,11 +44,11 @@ "isDefault": false }, { - "address": "NNsXzAGGVY3H3viPHzaoD6BcVtqNCdMAHZ", - "key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9", + "address": "NWvKSwutC8D6VKmmPxAEgFKx2NLvFhn8q5", + "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { - "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG4LQQqQatQ=", + "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG4LQZVEDXg=", "parameters": [ { "name": "parameter0", diff --git a/pkg/wallet/wallet_test.go b/pkg/wallet/wallet_test.go index e811eea04..302795845 100644 --- a/pkg/wallet/wallet_test.go +++ b/pkg/wallet/wallet_test.go @@ -181,14 +181,14 @@ func TestWalletGetChangeAddress(t *testing.T) { require.NoError(t, err) sh := w1.GetChangeAddress() // No default address, the first one is used. - expected, err := address.StringToUint160("NQRLhCpAru9BjGsMwk67vdMwmzKMRgsnnN") + expected, err := address.StringToUint160("NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc") require.NoError(t, err) require.Equal(t, expected, sh) w2, err := NewWalletFromFile("testdata/wallet2.json") require.NoError(t, err) sh = w2.GetChangeAddress() // Default address. - expected, err = address.StringToUint160("NNsXzAGGVY3H3viPHzaoD6BcVtqNCdMAHZ") + expected, err = address.StringToUint160("NWvKSwutC8D6VKmmPxAEgFKx2NLvFhn8q5") require.NoError(t, err) require.Equal(t, expected, sh) }