aboutsummaryrefslogtreecommitdiff
path: root/src/hdk.rs
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 /src/hdk.rs
parentcfcaeeacf91e5250e3d211e5d196b9475e503cc4 (diff)
Update to latest hmac and kdf
Diffstat (limited to 'src/hdk.rs')
-rw-r--r--src/hdk.rs4
1 files changed, 2 insertions, 2 deletions
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]);