Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Reverse bytes in Ed25519 keys. #224

Merged
merged 2 commits into from
Apr 10, 2019
Merged

Reverse bytes in Ed25519 keys. #224

merged 2 commits into from
Apr 10, 2019

Conversation

maraino
Copy link
Contributor

@maraino maraino commented Apr 5, 2019

Golang golang.org/x/crypto/ed25519 package uses 64 bytes to store
the public and private parts of the key, the first 32 bytes correspond
to the private part and the last 32 to the public part. See:
https://github.com/golang/crypto/blob/master/ed25519/ed25519.go#L90

go-jose implementation reverses the bytes causing that the JSON version
of the private key has the private part in the 'x' property and the
public in the 'd', and it should be the other way around, see:
https://tools.ietf.org/html/rfc8037#appendix-A.1

Golang golang.org/x/crypto/ed25519 package uses 64 bytes to store
the public and private parts of the key, the first 32 bytes correspond
to the private part, and the last 32 to the public part. See:

https://github.com/golang/crypto/blob/master/ed25519/ed25519.go#L90

go-jose implementation reverses the bytes causing that the JSON version
of the private key has the private part in the 'x' property and the
public in the 'd', and it should be the other way arround, see:

https://tools.ietf.org/html/rfc8037#appendix-A.1
maraino added a commit to smallstep/certificates that referenced this pull request Apr 5, 2019
This is a dependency for smallstep/cli#105, it will be solved once
square/go-jose#224 gets merged
maraino added a commit to smallstep/cli that referenced this pull request Apr 5, 2019
This is a dependency for #105, it will be solved once
square/go-jose#224 gets merged
@csstaub
Copy link
Collaborator

csstaub commented Apr 10, 2019

Wow, that's a really good catch, thanks @maraino.

@csstaub csstaub merged commit fd0b35a into square:v2 Apr 10, 2019
@maraino
Copy link
Contributor Author

maraino commented Apr 10, 2019

Thanks @csstaub, can you tag a new release?

@csstaub
Copy link
Collaborator

csstaub commented Apr 10, 2019

@maraino Already on it!

@csstaub
Copy link
Collaborator

csstaub commented Apr 10, 2019

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

Successfully merging this pull request may close these issues.

2 participants