Skip to content
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

[crypto] apply nextgen_crypto x25519 across Libra #464

Merged
merged 1 commit into from Aug 7, 2019

Conversation

@kchalkias
Copy link
Contributor

commented Aug 7, 2019

Motivation

Convert usages of legacy_crypto::X25519PrivateKey to nextgen_crypto::x25519.
The purpose of this task is to use the nextgen_crypto API (i.e. make the network identity key an x25519 key using the new crypto API) and convert the corresponding network code (which makes a few uses of it).

Have you read the Contributing Guidelines on pull requests?

YES

Test Plan

existing

@kchalkias kchalkias self-assigned this Aug 7, 2019
@kchalkias kchalkias force-pushed the kchalkias:kostas-use-X25519 branch 3 times, most recently from bc9080f to 344a640 Aug 7, 2019
@kchalkias kchalkias force-pushed the kchalkias:kostas-use-X25519 branch from 344a640 to 49eb9ed Aug 7, 2019
@kchalkias kchalkias requested review from huitseeker and gedigi Aug 7, 2019
Copy link
Contributor

left a comment

This LGTM at first glance, need to run a few tests before green tick in a few h.

@@ -11,9 +11,13 @@ use std::{
string::ToString,
};

use crypto::x25519::{self, X25519PrivateKey, X25519PublicKey};

This comment has been minimized.

Copy link
@huitseeker

huitseeker Aug 7, 2019

Contributor

😍

/// Those transitory traits are meant to help with the progressive
/// migration of the code base to the nextgen_crypto module and will
/// disappear after.
pub mod compat {

This comment has been minimized.

Copy link
@huitseeker

huitseeker Aug 7, 2019

Contributor

Yes, this probably hints at a restructuring of the Uniform trait and the KeyPair structure as they stand in the traits.rs and test_utils.rs files respectively.

Ultimately, I think we could eliminate the KeyPair and have an additional method generate_keypair implemented for any Uniform + PrivateKey that uses Uniform::generate_for_testing and &PrivateKey's Into<PublicKey>.

@huitseeker huitseeker added the breaking label Aug 7, 2019
Copy link
Contributor

left a comment

Passing my brutal checks!

@kchalkias kchalkias merged commit bee937c into libra:master Aug 7, 2019
1 check passed
1 check passed
commit-workflow Workflow: commit-workflow
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.