-
Notifications
You must be signed in to change notification settings - Fork 141
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
Make ed25519 and ed448 usable for Golang interfaces #109
Comments
@armfazh I can implement this.. but I want to know if you think it is a good idea ;) |
The |
Yeah, the |
@claucece do you want to proceed with the changes needed? |
@armfazh I can make a PR changing the API to work with the PrivateKey type... let me know if it is ok, as it can still work with the KeyPair type.. |
please go forward with that PR. However, I see some trade-offs regarding compatibility. Let me know your feedback. On the one hand, I would like that circl be a drop-in replacement of stdlib. This implies that the functions On the other hand, having a keypair type allows us to add different flavors for signing e.g. |
So, mmm.. I did a little bit of research around this. On most libraries I checked, there is two interfaces exposed:
Often times, What we can do is either:
For compatibility, I'll say that going with option 1 is the best, until the golang issue is actually resolved (after that, something like option 2 will work). It seems like they are still debating around the best way to approach the issue... |
let's focus then on SignPure and SignPh following your first recommendation. |
Perfect! I'll prepare a PR for both curves ;) |
* Implement signing capabilities with prehashed messages for 25519 * Implement verification capabilities with prehashed messages for 25519 * Add tests for prehashed signing and verifying for ed25519 * Make linter happy * Add rfc8032 test * Make linter happy again * Remove newline * Separate signPure and signPh functions * PoC: implement ed25519ctx. Needs refactoring * Finish verification for ed25519 * Fix lint * Fix comments and check correctly for context * Fix spelling * Remove functions * Solve issues from review * Fix tests * Remove verify function * Add note * Hash message on the inside * Add context to the main Sign function * Add missing example * Implement multipurpose verify function * Fix lint * Extract dom define function * Solve comments from review * Change ed25519 API * Fix lint * Fix final comment from review * Fix comments from review
Hi!
Thanks so much for all the work on this!
So, the implementation for ed25519 and ed448 expose a certain API that is quite similar to the way golang handles it in its libraries (ecdsa, rsa, and ed25519). However, when I tried to use it for the crypto signer interface, it panics due to:
I was wondering if we could create a method
func (priv *PrivateKey) Public() crypto.PublicKey
(in similar fashion as https://golang.org/pkg/crypto/ecdsa/#PrivateKey.Public and https://golang.org/pkg/crypto/ed25519/#PrivateKey.Public) so the APIs can be used for other interfaces as the crypto signer...The text was updated successfully, but these errors were encountered: