diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2021-05-01 07:27:02 +0000 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2021-05-01 07:27:02 +0000 |
| commit | 15bf27f027458458a84eff658a491c73feb39611 (patch) | |
| tree | 2eaa6453cd803e2a2c8525d78e44975a10d533fa /src | |
| parent | cfcaeeacf91e5250e3d211e5d196b9475e503cc4 (diff) | |
Update to latest hmac and kdf
Diffstat (limited to 'src')
| -rw-r--r-- | src/hdk.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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]); |
