diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2021-08-21 07:35:13 +0000 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2021-08-21 07:35:13 +0000 |
| commit | f608cce748d80d46f49ba25999e4334fd959b070 (patch) | |
| tree | 9fc73440b321933cfd6e6ead10ee18d93bc99c89 /src/hdk.rs | |
| parent | c05487949a5cb9808945b5bdd174e14fdd7e51ea (diff) | |
Refactor into lib+bin and start adding e2e tests
Diffstat (limited to 'src/hdk.rs')
| -rw-r--r-- | src/hdk.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -17,6 +17,10 @@ const HARDENED: u32 = 0x8000_0000; /// Creates a new extended private key from a seed. pub fn derive(seed: impl AsRef<[u8]>, path: &Path) -> Result<PrivateKey> { + derive_slice(seed.as_ref(), path) +} + +fn derive_slice(seed: &[u8], path: &Path) -> Result<PrivateKey> { let mut extended_key = { let mut hmac = Hmac::<Sha512>::new_from_slice(b"Bitcoin seed")?; hmac.update(seed.as_ref()); |
