Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private key sign bug #592

Closed
mesment opened this issue Jan 13, 2020 · 4 comments
Closed

private key sign bug #592

mesment opened this issue Jan 13, 2020 · 4 comments

Comments

@mesment
Copy link

mesment commented Jan 13, 2020

PrivateKey.Sign method in keys package
assignment mismatch: rfc6979.SignECDSA returns 2 values but asign to 3 variables

signbug20200113112201

signbug20200113112806
signbug20200113112112

@roman-khimov
Copy link
Member

What is the version (git commit) you're trying to build? And what is the rfc6979 package you're trying to use? It certainly works here as of 565c194 with rfc6979 v0.1.0 from https://github.com/nspcc-dev/rfc6979 that has three variables returned from this function:

vendor/github.com/nspcc-dev/rfc6979/ecdsa.go:func SignECDSA(priv *ecdsa.PrivateKey, hash []byte, alg func() hash.Hash) (r, s *big.Int, err error) {

@roman-khimov
Copy link
Member

Maybe something is wrong with your go modules setup, because we have rfc6979 v0.1.0 used at the moment to build neo-go, even though I do see now that more recent versions of rfc6979 don't have error returned from SignECDSA. Not sure it's worth upgrading for us, the changes there are cosmetic.

@mesment
Copy link
Author

mesment commented Jan 13, 2020

Thanks for your reply
We are using govendor as dependency management tool
github.com/nspcc-dev/neo-go commit 565c194
github.com/nspcc-dev/rfc6979 commit 24b8ce9606a001

@roman-khimov
Copy link
Member

We use Go modules and expect you to use Go 1.12+, but anyway we'll move to v0.2.0 of rfc6979 (https://github.com/nspcc-dev/rfc6979/releases/tag/v0.2.0) as it allows us to simplify error handling in our own code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants