diff --git a/pkg/core/interop_neo.go b/pkg/core/interop_neo.go index d2c3e2d79..418f943a6 100644 --- a/pkg/core/interop_neo.go +++ b/pkg/core/interop_neo.go @@ -626,7 +626,7 @@ func (ic *interopContext) eccRecover(curve elliptic.Curve, v *vm.VM) error { v.Estack().PushVal([]byte{}) return nil } - v.Estack().PushVal(pKey.Bytes()[1:]) + v.Estack().PushVal(pKey.UncompressedBytes()[1:]) return nil } diff --git a/pkg/core/interop_neo_test.go b/pkg/core/interop_neo_test.go index 86c648b63..d03a864f5 100644 --- a/pkg/core/interop_neo_test.go +++ b/pkg/core/interop_neo_test.go @@ -474,7 +474,7 @@ func TestSecp256k1Recover(t *testing.T) { X: privateKey.PubKey().X, Y: privateKey.PubKey().Y, } - expected := pubKey.Bytes()[1:] + expected := pubKey.UncompressedBytes()[1:] // We don't know which of two recovered keys suites, so let's try both. putOnStackGetResult := func(isEven bool) []byte { @@ -505,7 +505,7 @@ func TestSecp256r1Recover(t *testing.T) { messageHash := hash.Sha256(message).BytesBE() signature := privateKey.Sign(message) require.True(t, privateKey.PublicKey().Verify(signature, messageHash)) - expected := privateKey.PublicKey().Bytes()[1:] + expected := privateKey.PublicKey().UncompressedBytes()[1:] // We don't know which of two recovered keys suites, so let's try both. putOnStackGetResult := func(isEven bool) []byte {