This repository has been archived by the owner on Jul 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
helpers: provide helpers to generate keys #31
Comments
odeke-em
added a commit
to orijtech/ed25519
that referenced
this issue
Sep 7, 2017
MakePublicKey takes in a privateKey and mutates it setting the first 32 bytes to those original 32 bytes used to generate the publicKey. This wasn't made clear in the comments and required digging into the actual implementation when I was advocating for tendermint/go-crypto#31. I noticed that in crypto https://github.com/tendermint/go-crypto/blob/1bc8de4caa844f8b64c120e65b047898f22b7f3e/priv_key.go#L99-L114 there was an unexplained call to ed25519.MakePublicKey nor were there any comments to explain that.
odeke-em
added a commit
that referenced
this issue
Sep 7, 2017
Fixes #31 Add a helper to be able to generate Ed25519 keys directly from our crypto package, and with these helpers we give more context to a previously undocumented and hanging code statement in which while generating a private key we invoked ed25519.MakePublicKey, which is correct but seemed hanging. With this change, the helpers are: ```go func GenEd25519KeyPair() (priv PrivKeyEd25519, pub PubKeyEd25519) func GenEd25519KeyPairFromSecret(secret []byte) (priv PrivKeyEd25519, pub PubKeyEd25519) ``` which are invoked by: - GenPrivKeyEd25519() - GenPrivKeyEd25519FromSecret(secret []byte) respectively and now with the pairings give more comfort knowing that each private key for completion must be generated with its public key, but we'll chose to discard the public key.
What about That's what I do, and your logic would do under the hood. Not too much work, no? |
Thanks @ethanfrey, and my apologies for the late reply, I was off from here since the weekend, but am back. As per your recommendation and exhibit above, I've opened #35 in which we can provide a high level view of docs for go-crypto to easily transfer such knowledge to other developers and provide some more documentation. I'll close this issue in favor of the mentioned one. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Am currently writing code to test out the bug fix for tendermint/tendermint#514 in which we have a dishonest peer requesting a non-existent block height from a reactor and that requires a whole lot of setup.
I currently see that we have helpers for PrivKeyEd25519
go-crypto/priv_key.go
Lines 99 to 114 in 1bc8de4
However, trying to generate the public key using our package is quite a bit of work, IMHO we should make it simple to generate a public Ed25519 key that conforms to our package and not just to the Go crypto library. I suspect some other developers might need this in the future.
The text was updated successfully, but these errors were encountered: