Skip to content

Commit

Permalink
rust: Update ed25519-dalek and associated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjgilbert committed Feb 17, 2020
1 parent afc5248 commit 0b62984
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 60 deletions.
60 changes: 17 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions keymanager-api-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ serde_bytes = "~0.10"
rustc-hex = "2.0.1"
failure = "0.1.5"
lazy_static = "1.3.0"
x25519-dalek = "0.5.1"
rand = "0.6.5"
x25519-dalek = "0.6.0"
rand = "0.7.3"
2 changes: 1 addition & 1 deletion keymanager-api-common/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub struct ContractKey {
impl ContractKey {
/// Generate a new random key (for testing).
pub fn generate_mock() -> Self {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};
let sk = x25519_dalek::StaticSecret::new(&mut rng);
let pk = x25519_dalek::PublicKey::from(&sk);

Expand Down
4 changes: 2 additions & 2 deletions keymanager-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ failure = "0.1.5"
lazy_static = "1.3.0"
lru = "0.1.17"
io-context = "0.2.0"
rand = "0.6.5"
rand = "0.7.3"
sgx-isa = { version = "0.3.0", features = ["sgxstd"] }
sp800-185 = "0.2.0"
tiny-keccak = "1.4.2"
x25519-dalek = "0.5.1"
x25519-dalek = "0.6.0"
zeroize = "0.6"
4 changes: 2 additions & 2 deletions keymanager-lib/src/kdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ impl Kdf {
}

fn save_master_secret(master_secret: &MasterSecret) {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

// Encrypt the master secret.
let mut nonce = [0u8; NONCE_SIZE];
Expand All @@ -425,7 +425,7 @@ impl Kdf {
}

fn generate_master_secret() -> MasterSecret {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

// TODO: Support static keying for debugging.
let mut master_secret = [0u8; 32];
Expand Down
4 changes: 2 additions & 2 deletions keymanager-runtime/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ serde_bytes = "~0.10"
rustc-hex = "2.0.1"
failure = "0.1.5"
lazy_static = "1.3.0"
x25519-dalek = "0.5.1"
rand = "0.6.5"
x25519-dalek = "0.6.0"
rand = "0.7.3"
6 changes: 3 additions & 3 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ pem-iterator = "0.2.0"
chrono = "0.4.6"
base64 = "0.10.1"
rustc-hex = "2.0.1"
rand = "0.6.5"
rand = "0.7.3"
futures = "0.1.25"
tokio-current-thread = "0.1.5"
tokio-executor = "0.1.6"
io-context = "0.2.0"
x25519-dalek = "0.5.1"
ed25519-dalek = "1.0.0-pre.1"
x25519-dalek = "0.6.0"
ed25519-dalek = "1.0.0-pre.3"
deoxysii = { git = "https://github.com/oasislabs/deoxysii-rust" }
tiny-keccak = "1.4.2"
sp800-185 = "0.2.0"
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/common/crypto/mrae/deoxysii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn derive_symmetric_key(public: &[u8; 32], private: &[u8; 32]) -> [u8; KEY_SIZE]
/// Generates a public/private key pair suitable for use with
/// `derive_symmetric_key`, `box_seal`, and `box_open`.
pub fn generate_key_pair() -> ([u8; 32], [u8; 32]) {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

let sk = x25519_dalek::StaticSecret::new(&mut rng);
let pk = x25519_dalek::PublicKey::from(&sk);
Expand Down Expand Up @@ -115,7 +115,7 @@ mod tests {

#[bench]
fn bench_mrae_box_seal_4096(b: &mut Bencher) {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

// Set up the keys.
let (_a_pub, a_priv) = generate_key_pair(); // Alice
Expand Down Expand Up @@ -143,7 +143,7 @@ mod tests {

#[bench]
fn bench_mrae_box_open_4096(b: &mut Bencher) {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

// Set up the keys.
let (a_pub, a_priv) = generate_key_pair(); // Alice
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/common/crypto/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct PrivateKey(pub ed25519_dalek::Keypair);
impl PrivateKey {
/// Generates a new private key pair.
pub fn generate() -> Self {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

PrivateKey(ed25519_dalek::Keypair::generate(&mut rng))
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/common/sgx/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::common::{
///
/// The `context` field is a domain separation tag.
pub fn seal(key_policy: Keypolicy, context: &[u8], data: &[u8]) -> Vec<u8> {
let mut rng = OsRng::new().unwrap();
let mut rng = OsRng {};

// Encrypt the raw policy.
let mut nonce = [0u8; NONCE_SIZE];
Expand Down

0 comments on commit 0b62984

Please sign in to comment.