Group trait experiment
#49
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an initial experiment on how to completely transition away from providing any specific implementation of
Groupin thevoprfcrate, but rely on traits fromelliptic-curveexclusively.Which is impossible at the moment, but this is a first step into the right direction. Missing steps would be:
Voprftrait toelliptic-curveand implement it forNistP256andNistP384.RistrettoPointin curve25519, see curve25519: ed25519, x25519 and ristretto255 RustCrypto/elliptic-curves#497. Unlikely to happen soon, so we are just re-exporting a type to fill that gap, to avoid having to wait for Rust specialization.It introduces two types:
Voprftrait, which extracts theSUITE_IDfromGroup. It also binds theSUITE_IDto a corresponding hash, which wasn't done before.Ristretto255, which implementsGroup, as it is unlikely thatcurve25519-dalekwill implement the traits we need anytime soon.Other changes:
Group.Group::zeroize()and used trait bound instead.HashMarkeras a trait bound toH.Voprfas a trait bound toG.SUITE_IDtou16because it can't be bigger anyway.See discussions in facebook/opaque-ke#254 and facebook/opaque-ke#250.
Builds on top of #48.