Skip to content

Commit

Permalink
Update fastcrypto & mysten-infra (MystenLabs#5150)
Browse files Browse the repository at this point in the history
Update fast crypto to the version previously called 1.0.0 & update mysten-infra dep
  • Loading branch information
benr-ml authored Oct 12, 2022
1 parent 6db678a commit 665d3e9
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 23 deletions.
160 changes: 153 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ move-ir-types = { git = "https://github.com/move-language/move", rev = "7c8552e0
move-prover = { git = "https://github.com/move-language/move", rev = "7c8552e0001c0c041c929e050c2d2959935485f1" }
move-prover-boogie-backend = { git = "https://github.com/move-language/move", rev = "7c8552e0001c0c041c929e050c2d2959935485f1" }

fastcrypto = { version = "0.1.2"}
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "4b7a06fe393003013489990dc2f4d3d2ebb32539" }

# Use the same workspace-hack across crates.
workspace-hack = { path = "crates/workspace-hack" }
4 changes: 2 additions & 2 deletions crates/sui-types/src/signature_seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//! A secret seed value, useful for deterministic private key and SuiAddress generation.
use fastcrypto::{hkdf::hkdf_generate_from_ikm, traits::KeyPair as KeypairTraits};
use fastcrypto::{hmac::hkdf_generate_from_ikm, traits::KeyPair as KeypairTraits};
use rand::{CryptoRng, RngCore};
use sha3::Sha3_256;
use zeroize::{Zeroize, ZeroizeOnDrop};
Expand Down Expand Up @@ -236,7 +236,7 @@ impl SignatureSeed {
id: &[u8],
domain: Option<&[u8]>,
) -> Result<K, SuiError> {
hkdf_generate_from_ikm::<Sha3_256, K>(&self.0, id, domain)
hkdf_generate_from_ikm::<Sha3_256, K>(&self.0, id, domain.unwrap_or(&[]))
.map_err(|_| SuiError::HkdfError("Deterministic keypair derivation failed".to_string()))
}
}
Expand Down
Loading

0 comments on commit 665d3e9

Please sign in to comment.