aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2021-05-01 07:27:02 +0000
committerNicholas Rodrigues Lordello <[email protected]>2021-05-01 07:27:02 +0000
commit15bf27f027458458a84eff658a491c73feb39611 (patch)
tree2eaa6453cd803e2a2c8525d78e44975a10d533fa
parentcfcaeeacf91e5250e3d211e5d196b9475e503cc4 (diff)
Update to latest hmac and kdf
-rw-r--r--Cargo.lock16
-rw-r--r--Cargo.toml4
-rw-r--r--src/hdk.rs4
3 files changed, 12 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d3447fd..11ff41e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -83,9 +83,9 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
[[package]]
name = "crypto-mac"
-version = "0.10.0"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6"
+checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e"
dependencies = [
"generic-array",
"subtle",
@@ -165,9 +165,9 @@ checksum = "5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8"
[[package]]
name = "hmac"
-version = "0.10.1"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15"
+checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
dependencies = [
"crypto-mac",
"digest",
@@ -199,9 +199,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "pbkdf2"
-version = "0.7.5"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf916dd32dd26297907890d99dc2740e33f6bd9073965af4ccff2967962f5508"
+checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa"
dependencies = [
"crypto-mac",
]
@@ -391,9 +391,9 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]]
name = "unicode-xid"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "vec_map"
diff --git a/Cargo.toml b/Cargo.toml
index 0e6357b..9cfdc49 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,8 +9,8 @@ license = "GPL-3.0-or-later"
anyhow = "1"
ethnum = "1"
hex = "0.4"
-hmac = { version = "0.10", features = ["std"] }
-pbkdf2 = { version = "0.7", default-features = false }
+hmac = { version = "0.11", features = ["std"] }
+pbkdf2 = { version = "0.8", default-features = false }
secp256k1 = { version = "0.20", features = ["recovery"] }
sha2 = "0.9"
sha3 = "0.9"
diff --git a/src/hdk.rs b/src/hdk.rs
index 864d7b8..ee01360 100644
--- a/src/hdk.rs
+++ b/src/hdk.rs
@@ -18,7 +18,7 @@ const HARDENED: u32 = 0x80000000;
/// Creates a new extended private key from a seed.
pub fn derive(seed: impl AsRef<[u8]>, path: &Path) -> Result<PrivateKey> {
let mut extended_key = {
- let mut hmac = Hmac::<Sha512>::new_varkey(b"Bitcoin seed")?;
+ let mut hmac = Hmac::<Sha512>::new_from_slice(b"Bitcoin seed")?;
hmac.update(seed.as_ref());
hmac.finalize().into_bytes()
};
@@ -27,7 +27,7 @@ pub fn derive(seed: impl AsRef<[u8]>, path: &Path) -> Result<PrivateKey> {
for (i, component) in path.components().enumerate() {
let (secret, chain_code) = extended_key.split_at(32);
- let mut hmac: Hmac<Sha512> = Hmac::<Sha512>::new_varkey(chain_code)?;
+ let mut hmac: Hmac<Sha512> = Hmac::<Sha512>::new_from_slice(chain_code)?;
let value = match component {
Component::Hardened(value) => {
hmac.update(&[0]);