Skip to content

Commit 9af01d1

Browse files
Merge pull request #227 from iqlusioninc/hkd32/mnemonics
hkd32: Add built-in bip39::Mnemonic support
2 parents 9515c52 + d062aab commit 9af01d1

File tree

5 files changed

+203
-14
lines changed

5 files changed

+203
-14
lines changed

Cargo.lock

Lines changed: 113 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ This repository contains the following crates:
4040
|-------------------|----------------------------|-------------|
4141
| [canonical-path] | ![][canonical-path-crate] | Canonical filesystem path support |
4242
| [gaunt] | ![][gaunt-crate] | Minimalist HTTP library |
43+
| [hkd32] | ![][hkd32-crate] | HMAC-based Hierarchical Key Derivation |
4344
| [secrecy] | ![][secrecy-crate] | Simple secret-keeping library |
4445
| [subtle-encoding] | ![][subtle-encoding-crate] | Hex, Bech32, and Base64 in constant-time(ish) |
4546
| [tai64] | ![][tai64-crate] | TAI64(N) timestamp format |
@@ -85,6 +86,8 @@ without any additional terms or conditions.
8586
[canonical-path-crate]: https://img.shields.io/crates/v/canonical-path.svg
8687
[gaunt]: https://github.com/iqlusioninc/crates/tree/develop/gaunt
8788
[gaunt-crate]: https://img.shields.io/crates/v/gaunt.svg
89+
[hkd32]: https://github.com/iqlusioninc/crates/tree/develop/hkd32
90+
[hkd32-crate]: https://img.shields.io/crates/v/hkd32.svg
8891
[secrecy]: https://github.com/iqlusioninc/crates/tree/develop/secrecy
8992
[secrecy-crate]: https://img.shields.io/crates/v/secrecy.svg
9093
[subtle-encoding]: https://github.com/iqlusioninc/crates/tree/develop/subtle-encoding

hkd32/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ travis-ci = { repository = "iqlusioninc/crates", branch = "develop" }
2323
getrandom = { version = "0.1", optional = true }
2424
hmac = { version = "0.7", default-features = false }
2525
sha2 = { version = "0.8", default-features = false }
26+
tiny-bip39 = { version = "0.6", default-features = false, optional = true }
2627

2728
[dependencies.zeroize]
2829
version = "0.9"
@@ -33,3 +34,7 @@ features = ["zeroize_derive"]
3334
[features]
3435
default = ["alloc", "getrandom"]
3536
alloc = []
37+
mnemonic = ["tiny-bip39"]
38+
39+
[package.metadata.docs.rs]
40+
all-features = true

hkd32/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ symmetric key derivation construction inspired by
1414
[BIP-0032: Hierarchical Deterministic Wallets][bip32].
1515

1616
It can be used to deterministically derive a hierarchy of symmetric keys
17-
from initial keying material through repeated applications of the
17+
from initial keying material (or when the `mnemonic` feature is enabled,
18+
through a 24-word [BIP39] passphrase) by repeatedly applying the
1819
Hash-based Message Authentication Code (HMAC).
1920

2021
This construction is specialized for deriving 32-byte (256-bit) keys from
@@ -63,3 +64,4 @@ without any additional terms or conditions.
6364
[//]: # (general links)
6465

6566
[bip32]: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
67+
[bip39]: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki

0 commit comments

Comments
 (0)