-
Notifications
You must be signed in to change notification settings - Fork 47
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
KeGroup
trait implementation
#254
Comments
Hmm, interesting! So if I am understanding correctly, the main benefit for doing this would be that the consumer of the library doesn't need to provide definitions for our current custom traits One worry that I have is that we are coupling closely to how I also don't expect that most consumers of this library will really need to worry about providing their own definitions of |
I was actually more concerned about us having to provide implementations. This way we are up-streaming the whole implementation, they probably have better testing and hopefully less errors. Certainly there are more eyes and users on elliptic-curve then on opaque-ke.
I'm not really worried about these libraries changing, they still follow the same RFCs and specs we follow. If you mean their API, I believe we should still use the same wrappers we currently have, just internally, so the code really shouldn't change much.
I agree, I was more hoping to upstream our work then users work. But it's definitely nice to be able to just get all kinds of implementations for free: P-256 and P-384 and hopefully in the future P-521 and decaf448. See RustCrypto/elliptic-curves#495 for upstream hash to curve and RustCrypto/elliptic-curves#489 for P-384 arithmetic implementation that will be available soon. |
Another thought: being able to just depend on traits means we won't need to expose any features anymore either, I think that's a nice bonus. |
I did some rework based on our discussion here: facebook/voprf#49. |
Currently
KeGroup
is implemented on what represents the public key of a curve, theRistrettoPoint
for ristretto255,ProjectivePoint
for P-256 andMontgomaryPoint
for X25519. When I switched to higher-level implementation for #250 I realized that we potentially don't even need a custom trait anymore.elliptic_curve::PublicKey
requires a type that implementsCurve
andProjectiveArithmetic
for example.We can't actually use those because the current ristretto255 implementation we use doesn't implement any of these traits. So instead I'm proposing the following:
KeGroup
to not be implemented on the public key, but on a trait that is supposed to implementCurve
andProjectiveArithmetic
. We introduce two associated types for a public and secret key.KeGroup
for anything that satisfies the right trait, because we lack specialization to also provide a custom implementation forRistrettoPoint
, but we can provide a simple template as an example.This idea can also be implemented for voprf.
This is a proposal, I am planning to do the implementation as soon as this is approved.
The text was updated successfully, but these errors were encountered: