diff --git a/Cargo.lock b/Cargo.lock index 187ee77..31d5b14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -865,8 +865,8 @@ name = "keyfork" version = "0.1.0" dependencies = [ "clap", - "keyfork-entropy", "keyfork-mnemonic-util", + "keyfork-plumbing", "smex", "thiserror", ] @@ -910,13 +910,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "keyfork-entropy" -version = "0.1.0" -dependencies = [ - "smex", -] - [[package]] name = "keyfork-frame" version = "0.1.0" @@ -928,14 +921,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "keyfork-mnemonic-from-seed" -version = "0.1.0" -dependencies = [ - "keyfork-mnemonic-util", - "smex", -] - [[package]] name = "keyfork-mnemonic-util" version = "0.1.0" @@ -946,6 +931,14 @@ dependencies = [ "sha2", ] +[[package]] +name = "keyfork-plumbing" +version = "0.1.0" +dependencies = [ + "keyfork-mnemonic-util", + "smex", +] + [[package]] name = "keyfork-slip10-test-data" version = "0.1.0" @@ -1666,9 +1659,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", diff --git a/Cargo.toml b/Cargo.toml index 1afe7a9..5f07474 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,10 +6,9 @@ members = [ "keyfork-derive-util", "keyfork-derive-key", "keyfork-derive-openpgp", - "keyfork-entropy", "keyfork-frame", - "keyfork-mnemonic-from-seed", "keyfork-mnemonic-util", + "keyfork-plumbing", "keyfork-slip10-test-data", "keyforkd", "keyforkd-client", diff --git a/keyfork-mnemonic-from-seed/Cargo.lock b/keyfork-mnemonic-from-seed/Cargo.lock deleted file mode 100644 index 4b8b2a8..0000000 --- a/keyfork-mnemonic-from-seed/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "keyfork-mnemonic-generate" -version = "0.1.0" diff --git a/keyfork-mnemonic-from-seed/Cargo.toml b/keyfork-mnemonic-from-seed/Cargo.toml deleted file mode 100644 index 839ca3d..0000000 --- a/keyfork-mnemonic-from-seed/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "keyfork-mnemonic-from-seed" -version = "0.1.0" -description = "A tool to format BIP-0039 mnemonics from hex data." -license = "GPL-3.0" -repository = "https://git.distrust.co/public/keyfork" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -keyfork-mnemonic-util = { version = "0.1.0", path = "../keyfork-mnemonic-util", registry = "distrust" } -smex = { version = "0.1.0", path = "../smex" } diff --git a/keyfork-mnemonic-from-seed/README.md b/keyfork-mnemonic-from-seed/README.md deleted file mode 100644 index 4fd72fa..0000000 --- a/keyfork-mnemonic-from-seed/README.md +++ /dev/null @@ -1,5 +0,0 @@ -This program is designed to generate a 12- or 24-word mnemonic using system -entropy on an offline, post-5.4-kernel Linux system. For testing purposes, the -command may be run in an insecure environment using `SHOOT_SELF_IN_FOOT=1`. The -program may be passed a seed size as the first and only argument, and only -supports seed sizes of 128 bits or 256 bits, for 12 and 24 word mnemonics. diff --git a/keyfork-entropy/Cargo.toml b/keyfork-plumbing/Cargo.toml similarity index 65% rename from keyfork-entropy/Cargo.toml rename to keyfork-plumbing/Cargo.toml index 480bad2..c6d59bb 100644 --- a/keyfork-entropy/Cargo.toml +++ b/keyfork-plumbing/Cargo.toml @@ -1,9 +1,10 @@ [package] -name = "keyfork-entropy" +name = "keyfork-plumbing" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +keyfork-mnemonic-util = { version = "0.1.0", path = "../keyfork-mnemonic-util" } smex = { version = "0.1.0", path = "../smex" } diff --git a/keyfork-entropy/src/main.rs b/keyfork-plumbing/src/bin/keyfork-entropy.rs similarity index 81% rename from keyfork-entropy/src/main.rs rename to keyfork-plumbing/src/bin/keyfork-entropy.rs index 61075b0..d913d4c 100644 --- a/keyfork-entropy/src/main.rs +++ b/keyfork-plumbing/src/bin/keyfork-entropy.rs @@ -13,8 +13,8 @@ fn main() -> Result<(), Box> { "Maximum supported bit size is 256, got: {bit_size}" ); - keyfork_entropy::ensure_safe(); - let entropy = keyfork_entropy::generate_entropy_of_size(bit_size / 8)?; + keyfork_plumbing::ensure_safe(); + let entropy = keyfork_plumbing::generate_entropy_of_size(bit_size / 8)?; println!("{}", smex::encode(&entropy)); Ok(()) diff --git a/keyfork-mnemonic-from-seed/src/main.rs b/keyfork-plumbing/src/bin/keyfork-mnemonic-from-seed.rs similarity index 100% rename from keyfork-mnemonic-from-seed/src/main.rs rename to keyfork-plumbing/src/bin/keyfork-mnemonic-from-seed.rs diff --git a/keyfork-entropy/src/lib.rs b/keyfork-plumbing/src/lib.rs similarity index 100% rename from keyfork-entropy/src/lib.rs rename to keyfork-plumbing/src/lib.rs diff --git a/keyfork/Cargo.toml b/keyfork/Cargo.toml index 11c0516..fd4731f 100644 --- a/keyfork/Cargo.toml +++ b/keyfork/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -keyfork-entropy = { version = "0.1.0", path = "../keyfork-entropy" } keyfork-mnemonic-util = { version = "0.1.0", path = "../keyfork-mnemonic-util" } clap = { version = "4.4.2", features = ["derive", "env"] } thiserror = "1.0.48" smex = { version = "0.1.0", path = "../smex" } +keyfork-plumbing = { version = "0.1.0", path = "../keyfork-plumbing" } diff --git a/keyfork/src/cli/mnemonic.rs b/keyfork/src/cli/mnemonic.rs index b68ee70..2fa9b88 100644 --- a/keyfork/src/cli/mnemonic.rs +++ b/keyfork/src/cli/mnemonic.rs @@ -89,8 +89,8 @@ impl MnemonicSeedSource { }; let seed = match self { MnemonicSeedSource::System => { - keyfork_entropy::ensure_safe(); - keyfork_entropy::generate_entropy_of_size(size / 8)? + keyfork_plumbing::ensure_safe(); + keyfork_plumbing::generate_entropy_of_size(size / 8)? } MnemonicSeedSource::Playing => todo!(), MnemonicSeedSource::Tarot => todo!(),