diff --git a/crypto/ecdsa/signer.go b/crypto/ecdsa/signer.go index 4962b9d..adba59b 100644 --- a/crypto/ecdsa/signer.go +++ b/crypto/ecdsa/signer.go @@ -31,7 +31,16 @@ func (x Signer) Sign(data []byte) ([]byte, error) { return nil, err } - return elliptic.Marshal(elliptic.P256(), r, s), nil + params := elliptic.P256().Params() + curveOrderByteSize := params.P.BitLen() / 8 + + buf := make([]byte, 1+curveOrderByteSize*2) + buf[0] = 4 + + _ = r.FillBytes(buf[1 : 1+curveOrderByteSize]) + _ = s.FillBytes(buf[1+curveOrderByteSize:]) + + return buf, nil } // Public initializes PublicKey and returns it as neofscrypto.PublicKey. diff --git a/go.mod b/go.mod index 5b296ff..db7dbe5 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/mr-tron/base58 v1.2.0 github.com/nspcc-dev/hrw v1.0.9 github.com/nspcc-dev/neo-go v0.99.1 - github.com/nspcc-dev/neofs-api-go/v2 v2.13.1 + github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419 github.com/nspcc-dev/neofs-contract v0.15.3 github.com/nspcc-dev/tzhash v1.6.1 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index ee2223a..4fc9621 100644 Binary files a/go.sum and b/go.sum differ