Skip to content

Commit

Permalink
core: rename Neo.Crypto.Verify to Neo.Crypto.VerifyWithECDsaSecp256r1
Browse files Browse the repository at this point in the history
Part of #918
  • Loading branch information
AnnaShaleva committed Jul 13, 2020
1 parent d1b92f1 commit f3458b5
Show file tree
Hide file tree
Showing 27 changed files with 78 additions and 78 deletions.
8 changes: 4 additions & 4 deletions .docker/wallets/wallet1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L",
"key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
10 changes: 5 additions & 5 deletions .docker/wallets/wallet1_solo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L",
"key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand All @@ -45,7 +45,7 @@
},
{
"address": "NYqxsNMHxDg3T19APYP27mBZFfauC4zngR",
"key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L",
"key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux",
"label": "",
"contract": {
"script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEQtBMHOzuw==",
Expand Down
8 changes: 4 additions & 4 deletions .docker/wallets/wallet2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9",
"key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
8 changes: 4 additions & 4 deletions .docker/wallets/wallet3.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYU172i51nsGS1P72gYq4czWdbUvMBQvrJnrJ1VEMZhmXPN6iX4jkmixC",
"key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
8 changes: 4 additions & 4 deletions .docker/wallets/wallet4.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYW1FxFURLUrFCzLRwoChXHGn77Fy8qDB5j1sUjpbi6mk4J1KgTR8vvAk",
"key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
2 changes: 1 addition & 1 deletion pkg/compiler/syscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions pkg/compiler/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
}
`
}
4 changes: 2 additions & 2 deletions pkg/consensus/payload_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package consensus

import (
"encoding/hex"
"math/rand"
"testing"

Expand Down Expand Up @@ -75,6 +74,7 @@ func TestConsensusPayload_Setters(t *testing.T) {
require.Equal(t, pl, p.GetRecoveryMessage())
}

/*// TODO: update binary
func TestConsensusPayload_Verify(t *testing.T) {
// signed payload from testnet
dataHex := "00000000a70b769e4af60878f6daa72be41770c62592c694bf9ead6b16b30ad90f28c4098cc704000400423000d5b4baae11191ac370a4d7860df01824fcea7f934d6461db6d4b7966ca3c135c8c262b7f23bbac13e73885223604141e062234d999068d9a74b77caeeb5271cf01420c4055ae8c7694c296e92da393f944b0dc1cd70d12de3ee944e9afc872d1db427fe87fcbe913709a8ec73e2f5acdfc0b7f0a96e9d63bad0a20e3226c882237f5c771290c2102a7834be9b32e2981d157cb5bbd3acb42cfd11ea5c3b10224d7a44e98c5910f1b0b410a906ad4"
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions pkg/consensus/testdata/wallet1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYSxdYbqJQKJcE7L8SUummK4X95aK14KA9obhw3fw6SX3rMRofPzpnr8L",
"key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
8 changes: 4 additions & 4 deletions pkg/consensus/testdata/wallet2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYVQUTQLzdhtdnNLSBkse2DGG5gpPFuNGjaBZxYuJ4XsQrtVNy1E9k7R9",
"key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
8 changes: 4 additions & 4 deletions pkg/consensus/testdata/wallet3.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYU172i51nsGS1P72gYq4czWdbUvMBQvrJnrJ1VEMZhmXPN6iX4jkmixC",
"key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
8 changes: 4 additions & 4 deletions pkg/consensus/testdata/wallet4.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -20,7 +20,7 @@
},
{
"address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2",
"key": "6PYW1FxFURLUrFCzLRwoChXHGn77Fy8qDB5j1sUjpbi6mk4J1KgTR8vvAk",
"key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW",
"label": "",
"contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==",
Expand Down
4 changes: 2 additions & 2 deletions pkg/core/interop/crypto/ecdsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions pkg/core/interop/crypto/interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/interop_neo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/interops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
)

// ecdsaVerifyInteropPrice returns the price of Neo.Crypto.ECDsaVerify
// ecdsaVerifyInteropPrice returns the price of Neo.Crypto.VerifyWithECDsaSecp256r1
// syscall to calculate NetworkFee for transaction
const ecdsaVerifyInteropPrice = 100000

Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/keys/publickey.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,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()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/keys/publickey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/internal/keytestcases/testcases.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@ 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",
PrivateKey: "zzdee7036b8fd9cef91de47386b191dd76db2888a553e7736bb02808932a915b",
PublicKey: "zz232ce8d2e2063dce0451131851d47421bfc4fc1da4db116fca5302c0756462fa",
Wif: "zzKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG",
Passphrase: "zzL33tP@33w0rd",
EncryptedWif: "6PYRoabFnWARA3ZWwfJ4efQ4uuuB9WdVrA1LFbMkZLtXZ2DJg3bzjiK59s",
EncryptedWif: "6PYSzKoJBQMj9uHUv1Sc2ZhMrydqDF8ZCTeE9FuPiNdEx7Lo9NoEuaXeyk",
Invalid: true,
},
}
Loading

0 comments on commit f3458b5

Please sign in to comment.