-
Notifications
You must be signed in to change notification settings - Fork 708
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
impl Clone and PartialEq for keypair types #859
Comments
👍 this would be great for rcgen as well: rustls/rcgen#17 Optimally, all KeyPair structs would get Clone and PartialEq (maybe Eq even) |
Possibly related prior discussion: #727 |
I'm still on the fence regarding Regarding PartialEq, maybe it is fine to implement I think that we're better off waiting to do this until after the big refactoring of the KeyPair types is merged; I've started working on it for RSA and I hope to have it merged soon. |
ring::signature::Ed25519KeyPair
is used in ruma-signatures in a type that I'd like to implementClone
andPartialEq
. I'm wondering if there's a specific reasonEd25519KeyPair
doesn't implement these traits, or if it was just never needed before.I can work around this by keeping the public and private keys and just creating a new
Ed25519KeyPair
in a manualClone
impl, and comparing the public and private keys in a manual implementation ofPartialEq
, but I'm not sure if 1) there is some security implication to this 2) there is any sort of random state held inEd25519KeyPair
that would make two values not equal even if they were generated from the same key pair.If it's in fact okay to implement these traits in ring, I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered: