-
Notifications
You must be signed in to change notification settings - Fork 46
Replace [vrf
] crate with pure Rust impl for use in WASM assembly
#153
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ECVRF-ED25519-SHA512-TAI](https://tools.ietf.org/html/draft-irtf-cfrg-vrf-04) This VRF implementation will eventually phase out the current one as it has fewer dependencies and is smaller in overall binary size. Ported from [Diem Crypto](https://github.com/diem/diem/blob/502936fbd59e35276e2cf455532b143796d68a16/crypto/nextgen_crypto/src/vrf/ecvrf.rs) repository
Nice!! |
kevinlewi
approved these changes
Feb 25, 2022
Blocked on #155 fixing the error in the MySQL tests infra |
…enabled/disabled via features
…nabled by-default
eozturk1
reviewed
Mar 3, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work bringing in the EC VRF implementation @slawlor! :)
This was
linked to
issues
Mar 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
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 PR replaces the [
vrf
] crate which depends on OpenSSL with a more pure-Rust implementation. This is necessary toDue to an error with the MAC version of clippy crashing, I am unable to verify clippy warnings so they may be flagged in this PR.
Additionally there are changes related to the way dependencies are handled in the core AKD crate. We're moving more towards conditional compilation with
Cargo.toml
enabled features rather than having all dependencies required all the time.For example, from the updated docs
The akd crate supports multiple compilation features
serde: Will enable serde serialization support on all public structs used in storage & transmission operations. This is helpful in the event you wish to directly serialize the structures to transmit between library <-> storage layer or library <-> clients. If you’re also utilizing VRFs (see (2.) below) it will additionally enable the serde feature in the ed25519-dalek crate.
vrf (on by-default): Will enable support of verifiable random function (VRF) usage within the library. See [ecvrf.rs] for documentation about the VRF functionality being utilized within AKD. This functionality is added protection so auditors don’t see user identifiers directly and applies a level of user-randomness (think hashing) in the node labels such that clients cannot trivially generate node labels themselves for given identifiers, however they can verify that a label is valid for a given identitifier. Transitively will add dependencies on crates [curve25519-dalek] and [ed25519-dalek]. You can disable the VRF functionality by adding the no-default-features flags to your cargo dependencies.
public-tests: Will expose some internal sanity testing functionality, which is often helpful so you don’t have to write all your own unit test cases when implementing a storage layer yourself. This helps guarantee the sanity of a given storage implementation. Should be used only in unit testing scenarios by altering your Cargo.toml as such