├── .github └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md └── crates ├── bip39-lexical-data ├── Cargo.toml ├── README.md ├── build.rs ├── data │ └── bip39_en_wordlist.txt └── src │ └── lib.rs ├── eff-lexical-data ├── Cargo.toml ├── README.md ├── build.rs ├── data │ ├── eff_large_wordlist.txt │ ├── eff_short_wordlist_1.txt │ └── eff_short_wordlist_2_0.txt └── src │ └── lib.rs └── pgen ├── Cargo.toml ├── README.md └── src ├── bip39_algorithm.rs ├── lib.rs └── main.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | RUSTFLAGS: "-Dwarnings" 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Build 19 | run: cargo build --verbose 20 | - name: Run tests 21 | run: cargo test --verbose 22 | clippy_check: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v4 26 | - name: Run Clippy 27 | run: cargo clippy --all-targets --all-features 28 | fmt_check: 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: actions/checkout@v4 32 | - name: Run cargo fmt check 33 | run: cargo fmt --all --check 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | **/*.rs.bk 3 | /.idea/ 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.24.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 19 | 20 | [[package]] 21 | name = "anstyle" 22 | version = "1.0.10" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" 25 | 26 | [[package]] 27 | name = "anyhow" 28 | version = "1.0.93" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" 31 | dependencies = [ 32 | "backtrace", 33 | ] 34 | 35 | [[package]] 36 | name = "backtrace" 37 | version = "0.3.74" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 40 | dependencies = [ 41 | "addr2line", 42 | "cfg-if", 43 | "libc", 44 | "miniz_oxide", 45 | "object", 46 | "rustc-demangle", 47 | "windows-targets", 48 | ] 49 | 50 | [[package]] 51 | name = "bip39-lexical-data" 52 | version = "1.0.0" 53 | 54 | [[package]] 55 | name = "block-buffer" 56 | version = "0.10.4" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 59 | dependencies = [ 60 | "generic-array", 61 | ] 62 | 63 | [[package]] 64 | name = "byteorder" 65 | version = "1.5.0" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 68 | 69 | [[package]] 70 | name = "cfg-if" 71 | version = "1.0.0" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 74 | 75 | [[package]] 76 | name = "clap" 77 | version = "4.5.21" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" 80 | dependencies = [ 81 | "clap_builder", 82 | "clap_derive", 83 | ] 84 | 85 | [[package]] 86 | name = "clap_builder" 87 | version = "4.5.21" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" 90 | dependencies = [ 91 | "anstyle", 92 | "clap_lex", 93 | ] 94 | 95 | [[package]] 96 | name = "clap_derive" 97 | version = "4.5.18" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" 100 | dependencies = [ 101 | "heck", 102 | "proc-macro2", 103 | "quote", 104 | "syn", 105 | ] 106 | 107 | [[package]] 108 | name = "clap_lex" 109 | version = "0.7.3" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" 112 | 113 | [[package]] 114 | name = "cpufeatures" 115 | version = "0.2.16" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" 118 | dependencies = [ 119 | "libc", 120 | ] 121 | 122 | [[package]] 123 | name = "crypto-common" 124 | version = "0.1.6" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 127 | dependencies = [ 128 | "generic-array", 129 | "typenum", 130 | ] 131 | 132 | [[package]] 133 | name = "digest" 134 | version = "0.10.7" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 137 | dependencies = [ 138 | "block-buffer", 139 | "crypto-common", 140 | ] 141 | 142 | [[package]] 143 | name = "eff-lexical-data" 144 | version = "1.0.0" 145 | 146 | [[package]] 147 | name = "generic-array" 148 | version = "0.14.7" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 151 | dependencies = [ 152 | "typenum", 153 | "version_check", 154 | ] 155 | 156 | [[package]] 157 | name = "getrandom" 158 | version = "0.2.15" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 161 | dependencies = [ 162 | "cfg-if", 163 | "libc", 164 | "wasi", 165 | ] 166 | 167 | [[package]] 168 | name = "gimli" 169 | version = "0.31.1" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 172 | 173 | [[package]] 174 | name = "heck" 175 | version = "0.5.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 178 | 179 | [[package]] 180 | name = "libc" 181 | version = "0.2.167" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" 184 | 185 | [[package]] 186 | name = "memchr" 187 | version = "2.7.4" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 190 | 191 | [[package]] 192 | name = "miniz_oxide" 193 | version = "0.8.0" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" 196 | dependencies = [ 197 | "adler2", 198 | ] 199 | 200 | [[package]] 201 | name = "object" 202 | version = "0.36.5" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" 205 | dependencies = [ 206 | "memchr", 207 | ] 208 | 209 | [[package]] 210 | name = "pgen" 211 | version = "3.0.0-alpha.1" 212 | dependencies = [ 213 | "anyhow", 214 | "bip39-lexical-data", 215 | "clap", 216 | "eff-lexical-data", 217 | "rand", 218 | "sha2", 219 | "test-case", 220 | "thiserror", 221 | ] 222 | 223 | [[package]] 224 | name = "ppv-lite86" 225 | version = "0.2.20" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 228 | dependencies = [ 229 | "zerocopy", 230 | ] 231 | 232 | [[package]] 233 | name = "proc-macro2" 234 | version = "1.0.92" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" 237 | dependencies = [ 238 | "unicode-ident", 239 | ] 240 | 241 | [[package]] 242 | name = "quote" 243 | version = "1.0.37" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 246 | dependencies = [ 247 | "proc-macro2", 248 | ] 249 | 250 | [[package]] 251 | name = "rand" 252 | version = "0.8.5" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 255 | dependencies = [ 256 | "libc", 257 | "rand_chacha", 258 | "rand_core", 259 | ] 260 | 261 | [[package]] 262 | name = "rand_chacha" 263 | version = "0.3.1" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 266 | dependencies = [ 267 | "ppv-lite86", 268 | "rand_core", 269 | ] 270 | 271 | [[package]] 272 | name = "rand_core" 273 | version = "0.6.4" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 276 | dependencies = [ 277 | "getrandom", 278 | ] 279 | 280 | [[package]] 281 | name = "rustc-demangle" 282 | version = "0.1.24" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 285 | 286 | [[package]] 287 | name = "sha2" 288 | version = "0.10.8" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 291 | dependencies = [ 292 | "cfg-if", 293 | "cpufeatures", 294 | "digest", 295 | ] 296 | 297 | [[package]] 298 | name = "syn" 299 | version = "2.0.90" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" 302 | dependencies = [ 303 | "proc-macro2", 304 | "quote", 305 | "unicode-ident", 306 | ] 307 | 308 | [[package]] 309 | name = "test-case" 310 | version = "3.3.1" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" 313 | dependencies = [ 314 | "test-case-macros", 315 | ] 316 | 317 | [[package]] 318 | name = "test-case-core" 319 | version = "3.3.1" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" 322 | dependencies = [ 323 | "cfg-if", 324 | "proc-macro2", 325 | "quote", 326 | "syn", 327 | ] 328 | 329 | [[package]] 330 | name = "test-case-macros" 331 | version = "3.3.1" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" 334 | dependencies = [ 335 | "proc-macro2", 336 | "quote", 337 | "syn", 338 | "test-case-core", 339 | ] 340 | 341 | [[package]] 342 | name = "thiserror" 343 | version = "2.0.3" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" 346 | dependencies = [ 347 | "thiserror-impl", 348 | ] 349 | 350 | [[package]] 351 | name = "thiserror-impl" 352 | version = "2.0.3" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" 355 | dependencies = [ 356 | "proc-macro2", 357 | "quote", 358 | "syn", 359 | ] 360 | 361 | [[package]] 362 | name = "typenum" 363 | version = "1.17.0" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 366 | 367 | [[package]] 368 | name = "unicode-ident" 369 | version = "1.0.14" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" 372 | 373 | [[package]] 374 | name = "version_check" 375 | version = "0.9.5" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 378 | 379 | [[package]] 380 | name = "wasi" 381 | version = "0.11.0+wasi-snapshot-preview1" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 384 | 385 | [[package]] 386 | name = "windows-targets" 387 | version = "0.52.6" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 390 | dependencies = [ 391 | "windows_aarch64_gnullvm", 392 | "windows_aarch64_msvc", 393 | "windows_i686_gnu", 394 | "windows_i686_gnullvm", 395 | "windows_i686_msvc", 396 | "windows_x86_64_gnu", 397 | "windows_x86_64_gnullvm", 398 | "windows_x86_64_msvc", 399 | ] 400 | 401 | [[package]] 402 | name = "windows_aarch64_gnullvm" 403 | version = "0.52.6" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 406 | 407 | [[package]] 408 | name = "windows_aarch64_msvc" 409 | version = "0.52.6" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 412 | 413 | [[package]] 414 | name = "windows_i686_gnu" 415 | version = "0.52.6" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 418 | 419 | [[package]] 420 | name = "windows_i686_gnullvm" 421 | version = "0.52.6" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 424 | 425 | [[package]] 426 | name = "windows_i686_msvc" 427 | version = "0.52.6" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 430 | 431 | [[package]] 432 | name = "windows_x86_64_gnu" 433 | version = "0.52.6" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 436 | 437 | [[package]] 438 | name = "windows_x86_64_gnullvm" 439 | version = "0.52.6" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 442 | 443 | [[package]] 444 | name = "windows_x86_64_msvc" 445 | version = "0.52.6" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 448 | 449 | [[package]] 450 | name = "zerocopy" 451 | version = "0.7.35" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 454 | dependencies = [ 455 | "byteorder", 456 | "zerocopy-derive", 457 | ] 458 | 459 | [[package]] 460 | name = "zerocopy-derive" 461 | version = "0.7.35" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 464 | dependencies = [ 465 | "proc-macro2", 466 | "quote", 467 | "syn", 468 | ] 469 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | 4 | members = ["crates/bip39-lexical-data", "crates/eff-lexical-data", "crates/pgen"] 5 | 6 | [workspace.dependencies] 7 | 8 | # workspace deps 9 | bip39-lexical-data = { path = "crates/bip39-lexical-data", version = "1.0.0" } 10 | eff-lexical-data = { path = "crates/eff-lexical-data", version = "1.0.0" } 11 | 12 | # crates.io deps 13 | anyhow = { version = "1.0.93", features = ["backtrace"] } 14 | clap = { version = "4.5.21", default-features = false, features = ["std", "derive", "help", "usage", "error-context"] } 15 | rand = "0.8.5" 16 | sha2 = "0.10.8" 17 | test-case = "3.3.1" 18 | thiserror = "2.0.3" 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, 2019, 2023, 2024 Erik Nordstrøm 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | crates/pgen/README.md -------------------------------------------------------------------------------- /crates/bip39-lexical-data/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bip39-lexical-data" 3 | description = "BIP39 Lexical Data" 4 | license = "ISC" 5 | readme = "README.md" 6 | repository = "https://github.com/ctsrc/Pgen/crates/bip39-lexical-data" 7 | version = "1.0.0" 8 | authors = ["Erik Nordstrøm "] 9 | categories = ["science", "data-structures", "no-std"] 10 | edition = "2021" 11 | 12 | [dependencies] 13 | -------------------------------------------------------------------------------- /crates/bip39-lexical-data/README.md: -------------------------------------------------------------------------------- 1 | # bip39-lexical-data 2 | 3 | Contains lexical data from the following sources: 4 | 5 | * [BIP39][BIP39] 6 | 7 | [BIP39]: https://en.bitcoin.it/wiki/BIP_0039 8 | -------------------------------------------------------------------------------- /crates/bip39-lexical-data/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::fs::File; 3 | use std::io::{BufRead, BufReader, Write}; 4 | use std::path::Path; 5 | 6 | // https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation 7 | 8 | /// Extract words from simple wordlist 9 | fn words_simple(mut f_dest: &File, const_name: &str, fname_src: &str) { 10 | write!(f_dest, "pub const {const_name}: &[&str] = &[").unwrap(); 11 | 12 | let f_src = BufReader::new(File::open(fname_src).unwrap()); 13 | for line in f_src.lines() { 14 | match line { 15 | Ok(line) => { 16 | let word = line.trim(); 17 | write!(f_dest, "\"{word}\",").unwrap(); 18 | } 19 | Err(_e) => panic!("Unable to read line from internal file"), 20 | } 21 | } 22 | 23 | f_dest.write_all(b"];").unwrap(); 24 | } 25 | 26 | fn main() { 27 | let out_dir = env::var("OUT_DIR").unwrap(); 28 | let dest_path = Path::new(&out_dir).join("wordlists.rs"); 29 | let f = File::create(dest_path).unwrap(); 30 | 31 | words_simple(&f, "WL_BIP39", "data/bip39_en_wordlist.txt"); 32 | } 33 | -------------------------------------------------------------------------------- /crates/bip39-lexical-data/data/bip39_en_wordlist.txt: -------------------------------------------------------------------------------- 1 | abandon 2 | ability 3 | able 4 | about 5 | above 6 | absent 7 | absorb 8 | abstract 9 | absurd 10 | abuse 11 | access 12 | accident 13 | account 14 | accuse 15 | achieve 16 | acid 17 | acoustic 18 | acquire 19 | across 20 | act 21 | action 22 | actor 23 | actress 24 | actual 25 | adapt 26 | add 27 | addict 28 | address 29 | adjust 30 | admit 31 | adult 32 | advance 33 | advice 34 | aerobic 35 | affair 36 | afford 37 | afraid 38 | again 39 | age 40 | agent 41 | agree 42 | ahead 43 | aim 44 | air 45 | airport 46 | aisle 47 | alarm 48 | album 49 | alcohol 50 | alert 51 | alien 52 | all 53 | alley 54 | allow 55 | almost 56 | alone 57 | alpha 58 | already 59 | also 60 | alter 61 | always 62 | amateur 63 | amazing 64 | among 65 | amount 66 | amused 67 | analyst 68 | anchor 69 | ancient 70 | anger 71 | angle 72 | angry 73 | animal 74 | ankle 75 | announce 76 | annual 77 | another 78 | answer 79 | antenna 80 | antique 81 | anxiety 82 | any 83 | apart 84 | apology 85 | appear 86 | apple 87 | approve 88 | april 89 | arch 90 | arctic 91 | area 92 | arena 93 | argue 94 | arm 95 | armed 96 | armor 97 | army 98 | around 99 | arrange 100 | arrest 101 | arrive 102 | arrow 103 | art 104 | artefact 105 | artist 106 | artwork 107 | ask 108 | aspect 109 | assault 110 | asset 111 | assist 112 | assume 113 | asthma 114 | athlete 115 | atom 116 | attack 117 | attend 118 | attitude 119 | attract 120 | auction 121 | audit 122 | august 123 | aunt 124 | author 125 | auto 126 | autumn 127 | average 128 | avocado 129 | avoid 130 | awake 131 | aware 132 | away 133 | awesome 134 | awful 135 | awkward 136 | axis 137 | baby 138 | bachelor 139 | bacon 140 | badge 141 | bag 142 | balance 143 | balcony 144 | ball 145 | bamboo 146 | banana 147 | banner 148 | bar 149 | barely 150 | bargain 151 | barrel 152 | base 153 | basic 154 | basket 155 | battle 156 | beach 157 | bean 158 | beauty 159 | because 160 | become 161 | beef 162 | before 163 | begin 164 | behave 165 | behind 166 | believe 167 | below 168 | belt 169 | bench 170 | benefit 171 | best 172 | betray 173 | better 174 | between 175 | beyond 176 | bicycle 177 | bid 178 | bike 179 | bind 180 | biology 181 | bird 182 | birth 183 | bitter 184 | black 185 | blade 186 | blame 187 | blanket 188 | blast 189 | bleak 190 | bless 191 | blind 192 | blood 193 | blossom 194 | blouse 195 | blue 196 | blur 197 | blush 198 | board 199 | boat 200 | body 201 | boil 202 | bomb 203 | bone 204 | bonus 205 | book 206 | boost 207 | border 208 | boring 209 | borrow 210 | boss 211 | bottom 212 | bounce 213 | box 214 | boy 215 | bracket 216 | brain 217 | brand 218 | brass 219 | brave 220 | bread 221 | breeze 222 | brick 223 | bridge 224 | brief 225 | bright 226 | bring 227 | brisk 228 | broccoli 229 | broken 230 | bronze 231 | broom 232 | brother 233 | brown 234 | brush 235 | bubble 236 | buddy 237 | budget 238 | buffalo 239 | build 240 | bulb 241 | bulk 242 | bullet 243 | bundle 244 | bunker 245 | burden 246 | burger 247 | burst 248 | bus 249 | business 250 | busy 251 | butter 252 | buyer 253 | buzz 254 | cabbage 255 | cabin 256 | cable 257 | cactus 258 | cage 259 | cake 260 | call 261 | calm 262 | camera 263 | camp 264 | can 265 | canal 266 | cancel 267 | candy 268 | cannon 269 | canoe 270 | canvas 271 | canyon 272 | capable 273 | capital 274 | captain 275 | car 276 | carbon 277 | card 278 | cargo 279 | carpet 280 | carry 281 | cart 282 | case 283 | cash 284 | casino 285 | castle 286 | casual 287 | cat 288 | catalog 289 | catch 290 | category 291 | cattle 292 | caught 293 | cause 294 | caution 295 | cave 296 | ceiling 297 | celery 298 | cement 299 | census 300 | century 301 | cereal 302 | certain 303 | chair 304 | chalk 305 | champion 306 | change 307 | chaos 308 | chapter 309 | charge 310 | chase 311 | chat 312 | cheap 313 | check 314 | cheese 315 | chef 316 | cherry 317 | chest 318 | chicken 319 | chief 320 | child 321 | chimney 322 | choice 323 | choose 324 | chronic 325 | chuckle 326 | chunk 327 | churn 328 | cigar 329 | cinnamon 330 | circle 331 | citizen 332 | city 333 | civil 334 | claim 335 | clap 336 | clarify 337 | claw 338 | clay 339 | clean 340 | clerk 341 | clever 342 | click 343 | client 344 | cliff 345 | climb 346 | clinic 347 | clip 348 | clock 349 | clog 350 | close 351 | cloth 352 | cloud 353 | clown 354 | club 355 | clump 356 | cluster 357 | clutch 358 | coach 359 | coast 360 | coconut 361 | code 362 | coffee 363 | coil 364 | coin 365 | collect 366 | color 367 | column 368 | combine 369 | come 370 | comfort 371 | comic 372 | common 373 | company 374 | concert 375 | conduct 376 | confirm 377 | congress 378 | connect 379 | consider 380 | control 381 | convince 382 | cook 383 | cool 384 | copper 385 | copy 386 | coral 387 | core 388 | corn 389 | correct 390 | cost 391 | cotton 392 | couch 393 | country 394 | couple 395 | course 396 | cousin 397 | cover 398 | coyote 399 | crack 400 | cradle 401 | craft 402 | cram 403 | crane 404 | crash 405 | crater 406 | crawl 407 | crazy 408 | cream 409 | credit 410 | creek 411 | crew 412 | cricket 413 | crime 414 | crisp 415 | critic 416 | crop 417 | cross 418 | crouch 419 | crowd 420 | crucial 421 | cruel 422 | cruise 423 | crumble 424 | crunch 425 | crush 426 | cry 427 | crystal 428 | cube 429 | culture 430 | cup 431 | cupboard 432 | curious 433 | current 434 | curtain 435 | curve 436 | cushion 437 | custom 438 | cute 439 | cycle 440 | dad 441 | damage 442 | damp 443 | dance 444 | danger 445 | daring 446 | dash 447 | daughter 448 | dawn 449 | day 450 | deal 451 | debate 452 | debris 453 | decade 454 | december 455 | decide 456 | decline 457 | decorate 458 | decrease 459 | deer 460 | defense 461 | define 462 | defy 463 | degree 464 | delay 465 | deliver 466 | demand 467 | demise 468 | denial 469 | dentist 470 | deny 471 | depart 472 | depend 473 | deposit 474 | depth 475 | deputy 476 | derive 477 | describe 478 | desert 479 | design 480 | desk 481 | despair 482 | destroy 483 | detail 484 | detect 485 | develop 486 | device 487 | devote 488 | diagram 489 | dial 490 | diamond 491 | diary 492 | dice 493 | diesel 494 | diet 495 | differ 496 | digital 497 | dignity 498 | dilemma 499 | dinner 500 | dinosaur 501 | direct 502 | dirt 503 | disagree 504 | discover 505 | disease 506 | dish 507 | dismiss 508 | disorder 509 | display 510 | distance 511 | divert 512 | divide 513 | divorce 514 | dizzy 515 | doctor 516 | document 517 | dog 518 | doll 519 | dolphin 520 | domain 521 | donate 522 | donkey 523 | donor 524 | door 525 | dose 526 | double 527 | dove 528 | draft 529 | dragon 530 | drama 531 | drastic 532 | draw 533 | dream 534 | dress 535 | drift 536 | drill 537 | drink 538 | drip 539 | drive 540 | drop 541 | drum 542 | dry 543 | duck 544 | dumb 545 | dune 546 | during 547 | dust 548 | dutch 549 | duty 550 | dwarf 551 | dynamic 552 | eager 553 | eagle 554 | early 555 | earn 556 | earth 557 | easily 558 | east 559 | easy 560 | echo 561 | ecology 562 | economy 563 | edge 564 | edit 565 | educate 566 | effort 567 | egg 568 | eight 569 | either 570 | elbow 571 | elder 572 | electric 573 | elegant 574 | element 575 | elephant 576 | elevator 577 | elite 578 | else 579 | embark 580 | embody 581 | embrace 582 | emerge 583 | emotion 584 | employ 585 | empower 586 | empty 587 | enable 588 | enact 589 | end 590 | endless 591 | endorse 592 | enemy 593 | energy 594 | enforce 595 | engage 596 | engine 597 | enhance 598 | enjoy 599 | enlist 600 | enough 601 | enrich 602 | enroll 603 | ensure 604 | enter 605 | entire 606 | entry 607 | envelope 608 | episode 609 | equal 610 | equip 611 | era 612 | erase 613 | erode 614 | erosion 615 | error 616 | erupt 617 | escape 618 | essay 619 | essence 620 | estate 621 | eternal 622 | ethics 623 | evidence 624 | evil 625 | evoke 626 | evolve 627 | exact 628 | example 629 | excess 630 | exchange 631 | excite 632 | exclude 633 | excuse 634 | execute 635 | exercise 636 | exhaust 637 | exhibit 638 | exile 639 | exist 640 | exit 641 | exotic 642 | expand 643 | expect 644 | expire 645 | explain 646 | expose 647 | express 648 | extend 649 | extra 650 | eye 651 | eyebrow 652 | fabric 653 | face 654 | faculty 655 | fade 656 | faint 657 | faith 658 | fall 659 | false 660 | fame 661 | family 662 | famous 663 | fan 664 | fancy 665 | fantasy 666 | farm 667 | fashion 668 | fat 669 | fatal 670 | father 671 | fatigue 672 | fault 673 | favorite 674 | feature 675 | february 676 | federal 677 | fee 678 | feed 679 | feel 680 | female 681 | fence 682 | festival 683 | fetch 684 | fever 685 | few 686 | fiber 687 | fiction 688 | field 689 | figure 690 | file 691 | film 692 | filter 693 | final 694 | find 695 | fine 696 | finger 697 | finish 698 | fire 699 | firm 700 | first 701 | fiscal 702 | fish 703 | fit 704 | fitness 705 | fix 706 | flag 707 | flame 708 | flash 709 | flat 710 | flavor 711 | flee 712 | flight 713 | flip 714 | float 715 | flock 716 | floor 717 | flower 718 | fluid 719 | flush 720 | fly 721 | foam 722 | focus 723 | fog 724 | foil 725 | fold 726 | follow 727 | food 728 | foot 729 | force 730 | forest 731 | forget 732 | fork 733 | fortune 734 | forum 735 | forward 736 | fossil 737 | foster 738 | found 739 | fox 740 | fragile 741 | frame 742 | frequent 743 | fresh 744 | friend 745 | fringe 746 | frog 747 | front 748 | frost 749 | frown 750 | frozen 751 | fruit 752 | fuel 753 | fun 754 | funny 755 | furnace 756 | fury 757 | future 758 | gadget 759 | gain 760 | galaxy 761 | gallery 762 | game 763 | gap 764 | garage 765 | garbage 766 | garden 767 | garlic 768 | garment 769 | gas 770 | gasp 771 | gate 772 | gather 773 | gauge 774 | gaze 775 | general 776 | genius 777 | genre 778 | gentle 779 | genuine 780 | gesture 781 | ghost 782 | giant 783 | gift 784 | giggle 785 | ginger 786 | giraffe 787 | girl 788 | give 789 | glad 790 | glance 791 | glare 792 | glass 793 | glide 794 | glimpse 795 | globe 796 | gloom 797 | glory 798 | glove 799 | glow 800 | glue 801 | goat 802 | goddess 803 | gold 804 | good 805 | goose 806 | gorilla 807 | gospel 808 | gossip 809 | govern 810 | gown 811 | grab 812 | grace 813 | grain 814 | grant 815 | grape 816 | grass 817 | gravity 818 | great 819 | green 820 | grid 821 | grief 822 | grit 823 | grocery 824 | group 825 | grow 826 | grunt 827 | guard 828 | guess 829 | guide 830 | guilt 831 | guitar 832 | gun 833 | gym 834 | habit 835 | hair 836 | half 837 | hammer 838 | hamster 839 | hand 840 | happy 841 | harbor 842 | hard 843 | harsh 844 | harvest 845 | hat 846 | have 847 | hawk 848 | hazard 849 | head 850 | health 851 | heart 852 | heavy 853 | hedgehog 854 | height 855 | hello 856 | helmet 857 | help 858 | hen 859 | hero 860 | hidden 861 | high 862 | hill 863 | hint 864 | hip 865 | hire 866 | history 867 | hobby 868 | hockey 869 | hold 870 | hole 871 | holiday 872 | hollow 873 | home 874 | honey 875 | hood 876 | hope 877 | horn 878 | horror 879 | horse 880 | hospital 881 | host 882 | hotel 883 | hour 884 | hover 885 | hub 886 | huge 887 | human 888 | humble 889 | humor 890 | hundred 891 | hungry 892 | hunt 893 | hurdle 894 | hurry 895 | hurt 896 | husband 897 | hybrid 898 | ice 899 | icon 900 | idea 901 | identify 902 | idle 903 | ignore 904 | ill 905 | illegal 906 | illness 907 | image 908 | imitate 909 | immense 910 | immune 911 | impact 912 | impose 913 | improve 914 | impulse 915 | inch 916 | include 917 | income 918 | increase 919 | index 920 | indicate 921 | indoor 922 | industry 923 | infant 924 | inflict 925 | inform 926 | inhale 927 | inherit 928 | initial 929 | inject 930 | injury 931 | inmate 932 | inner 933 | innocent 934 | input 935 | inquiry 936 | insane 937 | insect 938 | inside 939 | inspire 940 | install 941 | intact 942 | interest 943 | into 944 | invest 945 | invite 946 | involve 947 | iron 948 | island 949 | isolate 950 | issue 951 | item 952 | ivory 953 | jacket 954 | jaguar 955 | jar 956 | jazz 957 | jealous 958 | jeans 959 | jelly 960 | jewel 961 | job 962 | join 963 | joke 964 | journey 965 | joy 966 | judge 967 | juice 968 | jump 969 | jungle 970 | junior 971 | junk 972 | just 973 | kangaroo 974 | keen 975 | keep 976 | ketchup 977 | key 978 | kick 979 | kid 980 | kidney 981 | kind 982 | kingdom 983 | kiss 984 | kit 985 | kitchen 986 | kite 987 | kitten 988 | kiwi 989 | knee 990 | knife 991 | knock 992 | know 993 | lab 994 | label 995 | labor 996 | ladder 997 | lady 998 | lake 999 | lamp 1000 | language 1001 | laptop 1002 | large 1003 | later 1004 | latin 1005 | laugh 1006 | laundry 1007 | lava 1008 | law 1009 | lawn 1010 | lawsuit 1011 | layer 1012 | lazy 1013 | leader 1014 | leaf 1015 | learn 1016 | leave 1017 | lecture 1018 | left 1019 | leg 1020 | legal 1021 | legend 1022 | leisure 1023 | lemon 1024 | lend 1025 | length 1026 | lens 1027 | leopard 1028 | lesson 1029 | letter 1030 | level 1031 | liar 1032 | liberty 1033 | library 1034 | license 1035 | life 1036 | lift 1037 | light 1038 | like 1039 | limb 1040 | limit 1041 | link 1042 | lion 1043 | liquid 1044 | list 1045 | little 1046 | live 1047 | lizard 1048 | load 1049 | loan 1050 | lobster 1051 | local 1052 | lock 1053 | logic 1054 | lonely 1055 | long 1056 | loop 1057 | lottery 1058 | loud 1059 | lounge 1060 | love 1061 | loyal 1062 | lucky 1063 | luggage 1064 | lumber 1065 | lunar 1066 | lunch 1067 | luxury 1068 | lyrics 1069 | machine 1070 | mad 1071 | magic 1072 | magnet 1073 | maid 1074 | mail 1075 | main 1076 | major 1077 | make 1078 | mammal 1079 | man 1080 | manage 1081 | mandate 1082 | mango 1083 | mansion 1084 | manual 1085 | maple 1086 | marble 1087 | march 1088 | margin 1089 | marine 1090 | market 1091 | marriage 1092 | mask 1093 | mass 1094 | master 1095 | match 1096 | material 1097 | math 1098 | matrix 1099 | matter 1100 | maximum 1101 | maze 1102 | meadow 1103 | mean 1104 | measure 1105 | meat 1106 | mechanic 1107 | medal 1108 | media 1109 | melody 1110 | melt 1111 | member 1112 | memory 1113 | mention 1114 | menu 1115 | mercy 1116 | merge 1117 | merit 1118 | merry 1119 | mesh 1120 | message 1121 | metal 1122 | method 1123 | middle 1124 | midnight 1125 | milk 1126 | million 1127 | mimic 1128 | mind 1129 | minimum 1130 | minor 1131 | minute 1132 | miracle 1133 | mirror 1134 | misery 1135 | miss 1136 | mistake 1137 | mix 1138 | mixed 1139 | mixture 1140 | mobile 1141 | model 1142 | modify 1143 | mom 1144 | moment 1145 | monitor 1146 | monkey 1147 | monster 1148 | month 1149 | moon 1150 | moral 1151 | more 1152 | morning 1153 | mosquito 1154 | mother 1155 | motion 1156 | motor 1157 | mountain 1158 | mouse 1159 | move 1160 | movie 1161 | much 1162 | muffin 1163 | mule 1164 | multiply 1165 | muscle 1166 | museum 1167 | mushroom 1168 | music 1169 | must 1170 | mutual 1171 | myself 1172 | mystery 1173 | myth 1174 | naive 1175 | name 1176 | napkin 1177 | narrow 1178 | nasty 1179 | nation 1180 | nature 1181 | near 1182 | neck 1183 | need 1184 | negative 1185 | neglect 1186 | neither 1187 | nephew 1188 | nerve 1189 | nest 1190 | net 1191 | network 1192 | neutral 1193 | never 1194 | news 1195 | next 1196 | nice 1197 | night 1198 | noble 1199 | noise 1200 | nominee 1201 | noodle 1202 | normal 1203 | north 1204 | nose 1205 | notable 1206 | note 1207 | nothing 1208 | notice 1209 | novel 1210 | now 1211 | nuclear 1212 | number 1213 | nurse 1214 | nut 1215 | oak 1216 | obey 1217 | object 1218 | oblige 1219 | obscure 1220 | observe 1221 | obtain 1222 | obvious 1223 | occur 1224 | ocean 1225 | october 1226 | odor 1227 | off 1228 | offer 1229 | office 1230 | often 1231 | oil 1232 | okay 1233 | old 1234 | olive 1235 | olympic 1236 | omit 1237 | once 1238 | one 1239 | onion 1240 | online 1241 | only 1242 | open 1243 | opera 1244 | opinion 1245 | oppose 1246 | option 1247 | orange 1248 | orbit 1249 | orchard 1250 | order 1251 | ordinary 1252 | organ 1253 | orient 1254 | original 1255 | orphan 1256 | ostrich 1257 | other 1258 | outdoor 1259 | outer 1260 | output 1261 | outside 1262 | oval 1263 | oven 1264 | over 1265 | own 1266 | owner 1267 | oxygen 1268 | oyster 1269 | ozone 1270 | pact 1271 | paddle 1272 | page 1273 | pair 1274 | palace 1275 | palm 1276 | panda 1277 | panel 1278 | panic 1279 | panther 1280 | paper 1281 | parade 1282 | parent 1283 | park 1284 | parrot 1285 | party 1286 | pass 1287 | patch 1288 | path 1289 | patient 1290 | patrol 1291 | pattern 1292 | pause 1293 | pave 1294 | payment 1295 | peace 1296 | peanut 1297 | pear 1298 | peasant 1299 | pelican 1300 | pen 1301 | penalty 1302 | pencil 1303 | people 1304 | pepper 1305 | perfect 1306 | permit 1307 | person 1308 | pet 1309 | phone 1310 | photo 1311 | phrase 1312 | physical 1313 | piano 1314 | picnic 1315 | picture 1316 | piece 1317 | pig 1318 | pigeon 1319 | pill 1320 | pilot 1321 | pink 1322 | pioneer 1323 | pipe 1324 | pistol 1325 | pitch 1326 | pizza 1327 | place 1328 | planet 1329 | plastic 1330 | plate 1331 | play 1332 | please 1333 | pledge 1334 | pluck 1335 | plug 1336 | plunge 1337 | poem 1338 | poet 1339 | point 1340 | polar 1341 | pole 1342 | police 1343 | pond 1344 | pony 1345 | pool 1346 | popular 1347 | portion 1348 | position 1349 | possible 1350 | post 1351 | potato 1352 | pottery 1353 | poverty 1354 | powder 1355 | power 1356 | practice 1357 | praise 1358 | predict 1359 | prefer 1360 | prepare 1361 | present 1362 | pretty 1363 | prevent 1364 | price 1365 | pride 1366 | primary 1367 | print 1368 | priority 1369 | prison 1370 | private 1371 | prize 1372 | problem 1373 | process 1374 | produce 1375 | profit 1376 | program 1377 | project 1378 | promote 1379 | proof 1380 | property 1381 | prosper 1382 | protect 1383 | proud 1384 | provide 1385 | public 1386 | pudding 1387 | pull 1388 | pulp 1389 | pulse 1390 | pumpkin 1391 | punch 1392 | pupil 1393 | puppy 1394 | purchase 1395 | purity 1396 | purpose 1397 | purse 1398 | push 1399 | put 1400 | puzzle 1401 | pyramid 1402 | quality 1403 | quantum 1404 | quarter 1405 | question 1406 | quick 1407 | quit 1408 | quiz 1409 | quote 1410 | rabbit 1411 | raccoon 1412 | race 1413 | rack 1414 | radar 1415 | radio 1416 | rail 1417 | rain 1418 | raise 1419 | rally 1420 | ramp 1421 | ranch 1422 | random 1423 | range 1424 | rapid 1425 | rare 1426 | rate 1427 | rather 1428 | raven 1429 | raw 1430 | razor 1431 | ready 1432 | real 1433 | reason 1434 | rebel 1435 | rebuild 1436 | recall 1437 | receive 1438 | recipe 1439 | record 1440 | recycle 1441 | reduce 1442 | reflect 1443 | reform 1444 | refuse 1445 | region 1446 | regret 1447 | regular 1448 | reject 1449 | relax 1450 | release 1451 | relief 1452 | rely 1453 | remain 1454 | remember 1455 | remind 1456 | remove 1457 | render 1458 | renew 1459 | rent 1460 | reopen 1461 | repair 1462 | repeat 1463 | replace 1464 | report 1465 | require 1466 | rescue 1467 | resemble 1468 | resist 1469 | resource 1470 | response 1471 | result 1472 | retire 1473 | retreat 1474 | return 1475 | reunion 1476 | reveal 1477 | review 1478 | reward 1479 | rhythm 1480 | rib 1481 | ribbon 1482 | rice 1483 | rich 1484 | ride 1485 | ridge 1486 | rifle 1487 | right 1488 | rigid 1489 | ring 1490 | riot 1491 | ripple 1492 | risk 1493 | ritual 1494 | rival 1495 | river 1496 | road 1497 | roast 1498 | robot 1499 | robust 1500 | rocket 1501 | romance 1502 | roof 1503 | rookie 1504 | room 1505 | rose 1506 | rotate 1507 | rough 1508 | round 1509 | route 1510 | royal 1511 | rubber 1512 | rude 1513 | rug 1514 | rule 1515 | run 1516 | runway 1517 | rural 1518 | sad 1519 | saddle 1520 | sadness 1521 | safe 1522 | sail 1523 | salad 1524 | salmon 1525 | salon 1526 | salt 1527 | salute 1528 | same 1529 | sample 1530 | sand 1531 | satisfy 1532 | satoshi 1533 | sauce 1534 | sausage 1535 | save 1536 | say 1537 | scale 1538 | scan 1539 | scare 1540 | scatter 1541 | scene 1542 | scheme 1543 | school 1544 | science 1545 | scissors 1546 | scorpion 1547 | scout 1548 | scrap 1549 | screen 1550 | script 1551 | scrub 1552 | sea 1553 | search 1554 | season 1555 | seat 1556 | second 1557 | secret 1558 | section 1559 | security 1560 | seed 1561 | seek 1562 | segment 1563 | select 1564 | sell 1565 | seminar 1566 | senior 1567 | sense 1568 | sentence 1569 | series 1570 | service 1571 | session 1572 | settle 1573 | setup 1574 | seven 1575 | shadow 1576 | shaft 1577 | shallow 1578 | share 1579 | shed 1580 | shell 1581 | sheriff 1582 | shield 1583 | shift 1584 | shine 1585 | ship 1586 | shiver 1587 | shock 1588 | shoe 1589 | shoot 1590 | shop 1591 | short 1592 | shoulder 1593 | shove 1594 | shrimp 1595 | shrug 1596 | shuffle 1597 | shy 1598 | sibling 1599 | sick 1600 | side 1601 | siege 1602 | sight 1603 | sign 1604 | silent 1605 | silk 1606 | silly 1607 | silver 1608 | similar 1609 | simple 1610 | since 1611 | sing 1612 | siren 1613 | sister 1614 | situate 1615 | six 1616 | size 1617 | skate 1618 | sketch 1619 | ski 1620 | skill 1621 | skin 1622 | skirt 1623 | skull 1624 | slab 1625 | slam 1626 | sleep 1627 | slender 1628 | slice 1629 | slide 1630 | slight 1631 | slim 1632 | slogan 1633 | slot 1634 | slow 1635 | slush 1636 | small 1637 | smart 1638 | smile 1639 | smoke 1640 | smooth 1641 | snack 1642 | snake 1643 | snap 1644 | sniff 1645 | snow 1646 | soap 1647 | soccer 1648 | social 1649 | sock 1650 | soda 1651 | soft 1652 | solar 1653 | soldier 1654 | solid 1655 | solution 1656 | solve 1657 | someone 1658 | song 1659 | soon 1660 | sorry 1661 | sort 1662 | soul 1663 | sound 1664 | soup 1665 | source 1666 | south 1667 | space 1668 | spare 1669 | spatial 1670 | spawn 1671 | speak 1672 | special 1673 | speed 1674 | spell 1675 | spend 1676 | sphere 1677 | spice 1678 | spider 1679 | spike 1680 | spin 1681 | spirit 1682 | split 1683 | spoil 1684 | sponsor 1685 | spoon 1686 | sport 1687 | spot 1688 | spray 1689 | spread 1690 | spring 1691 | spy 1692 | square 1693 | squeeze 1694 | squirrel 1695 | stable 1696 | stadium 1697 | staff 1698 | stage 1699 | stairs 1700 | stamp 1701 | stand 1702 | start 1703 | state 1704 | stay 1705 | steak 1706 | steel 1707 | stem 1708 | step 1709 | stereo 1710 | stick 1711 | still 1712 | sting 1713 | stock 1714 | stomach 1715 | stone 1716 | stool 1717 | story 1718 | stove 1719 | strategy 1720 | street 1721 | strike 1722 | strong 1723 | struggle 1724 | student 1725 | stuff 1726 | stumble 1727 | style 1728 | subject 1729 | submit 1730 | subway 1731 | success 1732 | such 1733 | sudden 1734 | suffer 1735 | sugar 1736 | suggest 1737 | suit 1738 | summer 1739 | sun 1740 | sunny 1741 | sunset 1742 | super 1743 | supply 1744 | supreme 1745 | sure 1746 | surface 1747 | surge 1748 | surprise 1749 | surround 1750 | survey 1751 | suspect 1752 | sustain 1753 | swallow 1754 | swamp 1755 | swap 1756 | swarm 1757 | swear 1758 | sweet 1759 | swift 1760 | swim 1761 | swing 1762 | switch 1763 | sword 1764 | symbol 1765 | symptom 1766 | syrup 1767 | system 1768 | table 1769 | tackle 1770 | tag 1771 | tail 1772 | talent 1773 | talk 1774 | tank 1775 | tape 1776 | target 1777 | task 1778 | taste 1779 | tattoo 1780 | taxi 1781 | teach 1782 | team 1783 | tell 1784 | ten 1785 | tenant 1786 | tennis 1787 | tent 1788 | term 1789 | test 1790 | text 1791 | thank 1792 | that 1793 | theme 1794 | then 1795 | theory 1796 | there 1797 | they 1798 | thing 1799 | this 1800 | thought 1801 | three 1802 | thrive 1803 | throw 1804 | thumb 1805 | thunder 1806 | ticket 1807 | tide 1808 | tiger 1809 | tilt 1810 | timber 1811 | time 1812 | tiny 1813 | tip 1814 | tired 1815 | tissue 1816 | title 1817 | toast 1818 | tobacco 1819 | today 1820 | toddler 1821 | toe 1822 | together 1823 | toilet 1824 | token 1825 | tomato 1826 | tomorrow 1827 | tone 1828 | tongue 1829 | tonight 1830 | tool 1831 | tooth 1832 | top 1833 | topic 1834 | topple 1835 | torch 1836 | tornado 1837 | tortoise 1838 | toss 1839 | total 1840 | tourist 1841 | toward 1842 | tower 1843 | town 1844 | toy 1845 | track 1846 | trade 1847 | traffic 1848 | tragic 1849 | train 1850 | transfer 1851 | trap 1852 | trash 1853 | travel 1854 | tray 1855 | treat 1856 | tree 1857 | trend 1858 | trial 1859 | tribe 1860 | trick 1861 | trigger 1862 | trim 1863 | trip 1864 | trophy 1865 | trouble 1866 | truck 1867 | true 1868 | truly 1869 | trumpet 1870 | trust 1871 | truth 1872 | try 1873 | tube 1874 | tuition 1875 | tumble 1876 | tuna 1877 | tunnel 1878 | turkey 1879 | turn 1880 | turtle 1881 | twelve 1882 | twenty 1883 | twice 1884 | twin 1885 | twist 1886 | two 1887 | type 1888 | typical 1889 | ugly 1890 | umbrella 1891 | unable 1892 | unaware 1893 | uncle 1894 | uncover 1895 | under 1896 | undo 1897 | unfair 1898 | unfold 1899 | unhappy 1900 | uniform 1901 | unique 1902 | unit 1903 | universe 1904 | unknown 1905 | unlock 1906 | until 1907 | unusual 1908 | unveil 1909 | update 1910 | upgrade 1911 | uphold 1912 | upon 1913 | upper 1914 | upset 1915 | urban 1916 | urge 1917 | usage 1918 | use 1919 | used 1920 | useful 1921 | useless 1922 | usual 1923 | utility 1924 | vacant 1925 | vacuum 1926 | vague 1927 | valid 1928 | valley 1929 | valve 1930 | van 1931 | vanish 1932 | vapor 1933 | various 1934 | vast 1935 | vault 1936 | vehicle 1937 | velvet 1938 | vendor 1939 | venture 1940 | venue 1941 | verb 1942 | verify 1943 | version 1944 | very 1945 | vessel 1946 | veteran 1947 | viable 1948 | vibrant 1949 | vicious 1950 | victory 1951 | video 1952 | view 1953 | village 1954 | vintage 1955 | violin 1956 | virtual 1957 | virus 1958 | visa 1959 | visit 1960 | visual 1961 | vital 1962 | vivid 1963 | vocal 1964 | voice 1965 | void 1966 | volcano 1967 | volume 1968 | vote 1969 | voyage 1970 | wage 1971 | wagon 1972 | wait 1973 | walk 1974 | wall 1975 | walnut 1976 | want 1977 | warfare 1978 | warm 1979 | warrior 1980 | wash 1981 | wasp 1982 | waste 1983 | water 1984 | wave 1985 | way 1986 | wealth 1987 | weapon 1988 | wear 1989 | weasel 1990 | weather 1991 | web 1992 | wedding 1993 | weekend 1994 | weird 1995 | welcome 1996 | west 1997 | wet 1998 | whale 1999 | what 2000 | wheat 2001 | wheel 2002 | when 2003 | where 2004 | whip 2005 | whisper 2006 | wide 2007 | width 2008 | wife 2009 | wild 2010 | will 2011 | win 2012 | window 2013 | wine 2014 | wing 2015 | wink 2016 | winner 2017 | winter 2018 | wire 2019 | wisdom 2020 | wise 2021 | wish 2022 | witness 2023 | wolf 2024 | woman 2025 | wonder 2026 | wood 2027 | wool 2028 | word 2029 | work 2030 | world 2031 | worry 2032 | worth 2033 | wrap 2034 | wreck 2035 | wrestle 2036 | wrist 2037 | write 2038 | wrong 2039 | yard 2040 | year 2041 | yellow 2042 | you 2043 | young 2044 | youth 2045 | zebra 2046 | zero 2047 | zone 2048 | zoo 2049 | -------------------------------------------------------------------------------- /crates/bip39-lexical-data/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![forbid(unsafe_code)] 3 | 4 | // https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation 5 | include!(concat!(env!("OUT_DIR"), "/wordlists.rs")); 6 | -------------------------------------------------------------------------------- /crates/eff-lexical-data/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eff-lexical-data" 3 | description = "EFF Lexical Data" 4 | license = "ISC" 5 | readme = "README.md" 6 | repository = "https://github.com/ctsrc/Pgen/crates/eff-lexical-data" 7 | version = "1.0.0" 8 | authors = ["Erik Nordstrøm "] 9 | categories = ["science", "data-structures", "no-std"] 10 | edition = "2021" 11 | 12 | [dependencies] 13 | -------------------------------------------------------------------------------- /crates/eff-lexical-data/README.md: -------------------------------------------------------------------------------- 1 | # eff-lexical-data 2 | 3 | Contains lexical data from the following sources: 4 | 5 | * the [wordlists for random passphrases][EFFWL] made by the EFF 6 | 7 | [EFFWL]: https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases 8 | -------------------------------------------------------------------------------- /crates/eff-lexical-data/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::fs::File; 3 | use std::io::{BufRead, BufReader, Write}; 4 | use std::path::Path; 5 | 6 | // https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation 7 | 8 | /// Extract words from the EFF wordlists 9 | fn words_eff(mut f_dest: &File, const_name: &str, fname_src: &str) { 10 | write!(f_dest, "pub const {const_name}: &[&str] = &[").unwrap(); 11 | 12 | let f_src = BufReader::new(File::open(fname_src).unwrap()); 13 | for line in f_src.lines() { 14 | match line { 15 | Ok(line) => { 16 | let word = line.split('\t').nth(1).unwrap(); 17 | write!(f_dest, "\"{word}\",").unwrap(); 18 | } 19 | Err(_e) => panic!("Unable to read line from internal file"), 20 | } 21 | } 22 | 23 | f_dest.write_all(b"];").unwrap(); 24 | } 25 | 26 | fn main() { 27 | let out_dir = env::var("OUT_DIR").unwrap(); 28 | let dest_path = Path::new(&out_dir).join("wordlists.rs"); 29 | let f = File::create(dest_path).unwrap(); 30 | 31 | words_eff(&f, "WL_AUTOCOMPLETE", "data/eff_short_wordlist_2_0.txt"); 32 | words_eff(&f, "WL_LONG", "data/eff_large_wordlist.txt"); 33 | words_eff(&f, "WL_SHORT", "data/eff_short_wordlist_1.txt"); 34 | } 35 | -------------------------------------------------------------------------------- /crates/eff-lexical-data/data/eff_short_wordlist_1.txt: -------------------------------------------------------------------------------- 1 | 1111 acid 2 | 1112 acorn 3 | 1113 acre 4 | 1114 acts 5 | 1115 afar 6 | 1116 affix 7 | 1121 aged 8 | 1122 agent 9 | 1123 agile 10 | 1124 aging 11 | 1125 agony 12 | 1126 ahead 13 | 1131 aide 14 | 1132 aids 15 | 1133 aim 16 | 1134 ajar 17 | 1135 alarm 18 | 1136 alias 19 | 1141 alibi 20 | 1142 alien 21 | 1143 alike 22 | 1144 alive 23 | 1145 aloe 24 | 1146 aloft 25 | 1151 aloha 26 | 1152 alone 27 | 1153 amend 28 | 1154 amino 29 | 1155 ample 30 | 1156 amuse 31 | 1161 angel 32 | 1162 anger 33 | 1163 angle 34 | 1164 ankle 35 | 1165 apple 36 | 1166 april 37 | 1211 apron 38 | 1212 aqua 39 | 1213 area 40 | 1214 arena 41 | 1215 argue 42 | 1216 arise 43 | 1221 armed 44 | 1222 armor 45 | 1223 army 46 | 1224 aroma 47 | 1225 array 48 | 1226 arson 49 | 1231 art 50 | 1232 ashen 51 | 1233 ashes 52 | 1234 atlas 53 | 1235 atom 54 | 1236 attic 55 | 1241 audio 56 | 1242 avert 57 | 1243 avoid 58 | 1244 awake 59 | 1245 award 60 | 1246 awoke 61 | 1251 axis 62 | 1252 bacon 63 | 1253 badge 64 | 1254 bagel 65 | 1255 baggy 66 | 1256 baked 67 | 1261 baker 68 | 1262 balmy 69 | 1263 banjo 70 | 1264 barge 71 | 1265 barn 72 | 1266 bash 73 | 1311 basil 74 | 1312 bask 75 | 1313 batch 76 | 1314 bath 77 | 1315 baton 78 | 1316 bats 79 | 1321 blade 80 | 1322 blank 81 | 1323 blast 82 | 1324 blaze 83 | 1325 bleak 84 | 1326 blend 85 | 1331 bless 86 | 1332 blimp 87 | 1333 blink 88 | 1334 bloat 89 | 1335 blob 90 | 1336 blog 91 | 1341 blot 92 | 1342 blunt 93 | 1343 blurt 94 | 1344 blush 95 | 1345 boast 96 | 1346 boat 97 | 1351 body 98 | 1352 boil 99 | 1353 bok 100 | 1354 bolt 101 | 1355 boned 102 | 1356 boney 103 | 1361 bonus 104 | 1362 bony 105 | 1363 book 106 | 1364 booth 107 | 1365 boots 108 | 1366 boss 109 | 1411 botch 110 | 1412 both 111 | 1413 boxer 112 | 1414 breed 113 | 1415 bribe 114 | 1416 brick 115 | 1421 bride 116 | 1422 brim 117 | 1423 bring 118 | 1424 brink 119 | 1425 brisk 120 | 1426 broad 121 | 1431 broil 122 | 1432 broke 123 | 1433 brook 124 | 1434 broom 125 | 1435 brush 126 | 1436 buck 127 | 1441 bud 128 | 1442 buggy 129 | 1443 bulge 130 | 1444 bulk 131 | 1445 bully 132 | 1446 bunch 133 | 1451 bunny 134 | 1452 bunt 135 | 1453 bush 136 | 1454 bust 137 | 1455 busy 138 | 1456 buzz 139 | 1461 cable 140 | 1462 cache 141 | 1463 cadet 142 | 1464 cage 143 | 1465 cake 144 | 1466 calm 145 | 1511 cameo 146 | 1512 canal 147 | 1513 candy 148 | 1514 cane 149 | 1515 canon 150 | 1516 cape 151 | 1521 card 152 | 1522 cargo 153 | 1523 carol 154 | 1524 carry 155 | 1525 carve 156 | 1526 case 157 | 1531 cash 158 | 1532 cause 159 | 1533 cedar 160 | 1534 chain 161 | 1535 chair 162 | 1536 chant 163 | 1541 chaos 164 | 1542 charm 165 | 1543 chase 166 | 1544 cheek 167 | 1545 cheer 168 | 1546 chef 169 | 1551 chess 170 | 1552 chest 171 | 1553 chew 172 | 1554 chief 173 | 1555 chili 174 | 1556 chill 175 | 1561 chip 176 | 1562 chomp 177 | 1563 chop 178 | 1564 chow 179 | 1565 chuck 180 | 1566 chump 181 | 1611 chunk 182 | 1612 churn 183 | 1613 chute 184 | 1614 cider 185 | 1615 cinch 186 | 1616 city 187 | 1621 civic 188 | 1622 civil 189 | 1623 clad 190 | 1624 claim 191 | 1625 clamp 192 | 1626 clap 193 | 1631 clash 194 | 1632 clasp 195 | 1633 class 196 | 1634 claw 197 | 1635 clay 198 | 1636 clean 199 | 1641 clear 200 | 1642 cleat 201 | 1643 cleft 202 | 1644 clerk 203 | 1645 click 204 | 1646 cling 205 | 1651 clink 206 | 1652 clip 207 | 1653 cloak 208 | 1654 clock 209 | 1655 clone 210 | 1656 cloth 211 | 1661 cloud 212 | 1662 clump 213 | 1663 coach 214 | 1664 coast 215 | 1665 coat 216 | 1666 cod 217 | 2111 coil 218 | 2112 coke 219 | 2113 cola 220 | 2114 cold 221 | 2115 colt 222 | 2116 coma 223 | 2121 come 224 | 2122 comic 225 | 2123 comma 226 | 2124 cone 227 | 2125 cope 228 | 2126 copy 229 | 2131 coral 230 | 2132 cork 231 | 2133 cost 232 | 2134 cot 233 | 2135 couch 234 | 2136 cough 235 | 2141 cover 236 | 2142 cozy 237 | 2143 craft 238 | 2144 cramp 239 | 2145 crane 240 | 2146 crank 241 | 2151 crate 242 | 2152 crave 243 | 2153 crawl 244 | 2154 crazy 245 | 2155 creme 246 | 2156 crepe 247 | 2161 crept 248 | 2162 crib 249 | 2163 cried 250 | 2164 crisp 251 | 2165 crook 252 | 2166 crop 253 | 2211 cross 254 | 2212 crowd 255 | 2213 crown 256 | 2214 crumb 257 | 2215 crush 258 | 2216 crust 259 | 2221 cub 260 | 2222 cult 261 | 2223 cupid 262 | 2224 cure 263 | 2225 curl 264 | 2226 curry 265 | 2231 curse 266 | 2232 curve 267 | 2233 curvy 268 | 2234 cushy 269 | 2235 cut 270 | 2236 cycle 271 | 2241 dab 272 | 2242 dad 273 | 2243 daily 274 | 2244 dairy 275 | 2245 daisy 276 | 2246 dance 277 | 2251 dandy 278 | 2252 darn 279 | 2253 dart 280 | 2254 dash 281 | 2255 data 282 | 2256 date 283 | 2261 dawn 284 | 2262 deaf 285 | 2263 deal 286 | 2264 dean 287 | 2265 debit 288 | 2266 debt 289 | 2311 debug 290 | 2312 decaf 291 | 2313 decal 292 | 2314 decay 293 | 2315 deck 294 | 2316 decor 295 | 2321 decoy 296 | 2322 deed 297 | 2323 delay 298 | 2324 denim 299 | 2325 dense 300 | 2326 dent 301 | 2331 depth 302 | 2332 derby 303 | 2333 desk 304 | 2334 dial 305 | 2335 diary 306 | 2336 dice 307 | 2341 dig 308 | 2342 dill 309 | 2343 dime 310 | 2344 dimly 311 | 2345 diner 312 | 2346 dingy 313 | 2351 disco 314 | 2352 dish 315 | 2353 disk 316 | 2354 ditch 317 | 2355 ditzy 318 | 2356 dizzy 319 | 2361 dock 320 | 2362 dodge 321 | 2363 doing 322 | 2364 doll 323 | 2365 dome 324 | 2366 donor 325 | 2411 donut 326 | 2412 dose 327 | 2413 dot 328 | 2414 dove 329 | 2415 down 330 | 2416 dowry 331 | 2421 doze 332 | 2422 drab 333 | 2423 drama 334 | 2424 drank 335 | 2425 draw 336 | 2426 dress 337 | 2431 dried 338 | 2432 drift 339 | 2433 drill 340 | 2434 drive 341 | 2435 drone 342 | 2436 droop 343 | 2441 drove 344 | 2442 drown 345 | 2443 drum 346 | 2444 dry 347 | 2445 duck 348 | 2446 duct 349 | 2451 dude 350 | 2452 dug 351 | 2453 duke 352 | 2454 duo 353 | 2455 dusk 354 | 2456 dust 355 | 2461 duty 356 | 2462 dwarf 357 | 2463 dwell 358 | 2464 eagle 359 | 2465 early 360 | 2466 earth 361 | 2511 easel 362 | 2512 east 363 | 2513 eaten 364 | 2514 eats 365 | 2515 ebay 366 | 2516 ebony 367 | 2521 ebook 368 | 2522 echo 369 | 2523 edge 370 | 2524 eel 371 | 2525 eject 372 | 2526 elbow 373 | 2531 elder 374 | 2532 elf 375 | 2533 elk 376 | 2534 elm 377 | 2535 elope 378 | 2536 elude 379 | 2541 elves 380 | 2542 email 381 | 2543 emit 382 | 2544 empty 383 | 2545 emu 384 | 2546 enter 385 | 2551 entry 386 | 2552 envoy 387 | 2553 equal 388 | 2554 erase 389 | 2555 error 390 | 2556 erupt 391 | 2561 essay 392 | 2562 etch 393 | 2563 evade 394 | 2564 even 395 | 2565 evict 396 | 2566 evil 397 | 2611 evoke 398 | 2612 exact 399 | 2613 exit 400 | 2614 fable 401 | 2615 faced 402 | 2616 fact 403 | 2621 fade 404 | 2622 fall 405 | 2623 false 406 | 2624 fancy 407 | 2625 fang 408 | 2626 fax 409 | 2631 feast 410 | 2632 feed 411 | 2633 femur 412 | 2634 fence 413 | 2635 fend 414 | 2636 ferry 415 | 2641 fetal 416 | 2642 fetch 417 | 2643 fever 418 | 2644 fiber 419 | 2645 fifth 420 | 2646 fifty 421 | 2651 film 422 | 2652 filth 423 | 2653 final 424 | 2654 finch 425 | 2655 fit 426 | 2656 five 427 | 2661 flag 428 | 2662 flaky 429 | 2663 flame 430 | 2664 flap 431 | 2665 flask 432 | 2666 fled 433 | 3111 flick 434 | 3112 fling 435 | 3113 flint 436 | 3114 flip 437 | 3115 flirt 438 | 3116 float 439 | 3121 flock 440 | 3122 flop 441 | 3123 floss 442 | 3124 flyer 443 | 3125 foam 444 | 3126 foe 445 | 3131 fog 446 | 3132 foil 447 | 3133 folic 448 | 3134 folk 449 | 3135 food 450 | 3136 fool 451 | 3141 found 452 | 3142 fox 453 | 3143 foyer 454 | 3144 frail 455 | 3145 frame 456 | 3146 fray 457 | 3151 fresh 458 | 3152 fried 459 | 3153 frill 460 | 3154 frisk 461 | 3155 from 462 | 3156 front 463 | 3161 frost 464 | 3162 froth 465 | 3163 frown 466 | 3164 froze 467 | 3165 fruit 468 | 3166 gag 469 | 3211 gains 470 | 3212 gala 471 | 3213 game 472 | 3214 gap 473 | 3215 gas 474 | 3216 gave 475 | 3221 gear 476 | 3222 gecko 477 | 3223 geek 478 | 3224 gem 479 | 3225 genre 480 | 3226 gift 481 | 3231 gig 482 | 3232 gills 483 | 3233 given 484 | 3234 giver 485 | 3235 glad 486 | 3236 glass 487 | 3241 glide 488 | 3242 gloss 489 | 3243 glove 490 | 3244 glow 491 | 3245 glue 492 | 3246 goal 493 | 3251 going 494 | 3252 golf 495 | 3253 gong 496 | 3254 good 497 | 3255 gooey 498 | 3256 goofy 499 | 3261 gore 500 | 3262 gown 501 | 3263 grab 502 | 3264 grain 503 | 3265 grant 504 | 3266 grape 505 | 3311 graph 506 | 3312 grasp 507 | 3313 grass 508 | 3314 grave 509 | 3315 gravy 510 | 3316 gray 511 | 3321 green 512 | 3322 greet 513 | 3323 grew 514 | 3324 grid 515 | 3325 grief 516 | 3326 grill 517 | 3331 grip 518 | 3332 grit 519 | 3333 groom 520 | 3334 grope 521 | 3335 growl 522 | 3336 grub 523 | 3341 grunt 524 | 3342 guide 525 | 3343 gulf 526 | 3344 gulp 527 | 3345 gummy 528 | 3346 guru 529 | 3351 gush 530 | 3352 gut 531 | 3353 guy 532 | 3354 habit 533 | 3355 half 534 | 3356 halo 535 | 3361 halt 536 | 3362 happy 537 | 3363 harm 538 | 3364 hash 539 | 3365 hasty 540 | 3366 hatch 541 | 3411 hate 542 | 3412 haven 543 | 3413 hazel 544 | 3414 hazy 545 | 3415 heap 546 | 3416 heat 547 | 3421 heave 548 | 3422 hedge 549 | 3423 hefty 550 | 3424 help 551 | 3425 herbs 552 | 3426 hers 553 | 3431 hub 554 | 3432 hug 555 | 3433 hula 556 | 3434 hull 557 | 3435 human 558 | 3436 humid 559 | 3441 hump 560 | 3442 hung 561 | 3443 hunk 562 | 3444 hunt 563 | 3445 hurry 564 | 3446 hurt 565 | 3451 hush 566 | 3452 hut 567 | 3453 ice 568 | 3454 icing 569 | 3455 icon 570 | 3456 icy 571 | 3461 igloo 572 | 3462 image 573 | 3463 ion 574 | 3464 iron 575 | 3465 islam 576 | 3466 issue 577 | 3511 item 578 | 3512 ivory 579 | 3513 ivy 580 | 3514 jab 581 | 3515 jam 582 | 3516 jaws 583 | 3521 jazz 584 | 3522 jeep 585 | 3523 jelly 586 | 3524 jet 587 | 3525 jiffy 588 | 3526 job 589 | 3531 jog 590 | 3532 jolly 591 | 3533 jolt 592 | 3534 jot 593 | 3535 joy 594 | 3536 judge 595 | 3541 juice 596 | 3542 juicy 597 | 3543 july 598 | 3544 jumbo 599 | 3545 jump 600 | 3546 junky 601 | 3551 juror 602 | 3552 jury 603 | 3553 keep 604 | 3554 keg 605 | 3555 kept 606 | 3556 kick 607 | 3561 kilt 608 | 3562 king 609 | 3563 kite 610 | 3564 kitty 611 | 3565 kiwi 612 | 3566 knee 613 | 3611 knelt 614 | 3612 koala 615 | 3613 kung 616 | 3614 ladle 617 | 3615 lady 618 | 3616 lair 619 | 3621 lake 620 | 3622 lance 621 | 3623 land 622 | 3624 lapel 623 | 3625 large 624 | 3626 lash 625 | 3631 lasso 626 | 3632 last 627 | 3633 latch 628 | 3634 late 629 | 3635 lazy 630 | 3636 left 631 | 3641 legal 632 | 3642 lemon 633 | 3643 lend 634 | 3644 lens 635 | 3645 lent 636 | 3646 level 637 | 3651 lever 638 | 3652 lid 639 | 3653 life 640 | 3654 lift 641 | 3655 lilac 642 | 3656 lily 643 | 3661 limb 644 | 3662 limes 645 | 3663 line 646 | 3664 lint 647 | 3665 lion 648 | 3666 lip 649 | 4111 list 650 | 4112 lived 651 | 4113 liver 652 | 4114 lunar 653 | 4115 lunch 654 | 4116 lung 655 | 4121 lurch 656 | 4122 lure 657 | 4123 lurk 658 | 4124 lying 659 | 4125 lyric 660 | 4126 mace 661 | 4131 maker 662 | 4132 malt 663 | 4133 mama 664 | 4134 mango 665 | 4135 manor 666 | 4136 many 667 | 4141 map 668 | 4142 march 669 | 4143 mardi 670 | 4144 marry 671 | 4145 mash 672 | 4146 match 673 | 4151 mate 674 | 4152 math 675 | 4153 moan 676 | 4154 mocha 677 | 4155 moist 678 | 4156 mold 679 | 4161 mom 680 | 4162 moody 681 | 4163 mop 682 | 4164 morse 683 | 4165 most 684 | 4166 motor 685 | 4211 motto 686 | 4212 mount 687 | 4213 mouse 688 | 4214 mousy 689 | 4215 mouth 690 | 4216 move 691 | 4221 movie 692 | 4222 mower 693 | 4223 mud 694 | 4224 mug 695 | 4225 mulch 696 | 4226 mule 697 | 4231 mull 698 | 4232 mumbo 699 | 4233 mummy 700 | 4234 mural 701 | 4235 muse 702 | 4236 music 703 | 4241 musky 704 | 4242 mute 705 | 4243 nacho 706 | 4244 nag 707 | 4245 nail 708 | 4246 name 709 | 4251 nanny 710 | 4252 nap 711 | 4253 navy 712 | 4254 near 713 | 4255 neat 714 | 4256 neon 715 | 4261 nerd 716 | 4262 nest 717 | 4263 net 718 | 4264 next 719 | 4265 niece 720 | 4266 ninth 721 | 4311 nutty 722 | 4312 oak 723 | 4313 oasis 724 | 4314 oat 725 | 4315 ocean 726 | 4316 oil 727 | 4321 old 728 | 4322 olive 729 | 4323 omen 730 | 4324 onion 731 | 4325 only 732 | 4326 ooze 733 | 4331 opal 734 | 4332 open 735 | 4333 opera 736 | 4334 opt 737 | 4335 otter 738 | 4336 ouch 739 | 4341 ounce 740 | 4342 outer 741 | 4343 oval 742 | 4344 oven 743 | 4345 owl 744 | 4346 ozone 745 | 4351 pace 746 | 4352 pagan 747 | 4353 pager 748 | 4354 palm 749 | 4355 panda 750 | 4356 panic 751 | 4361 pants 752 | 4362 panty 753 | 4363 paper 754 | 4364 park 755 | 4365 party 756 | 4366 pasta 757 | 4411 patch 758 | 4412 path 759 | 4413 patio 760 | 4414 payer 761 | 4415 pecan 762 | 4416 penny 763 | 4421 pep 764 | 4422 perch 765 | 4423 perky 766 | 4424 perm 767 | 4425 pest 768 | 4426 petal 769 | 4431 petri 770 | 4432 petty 771 | 4433 photo 772 | 4434 plank 773 | 4435 plant 774 | 4436 plaza 775 | 4441 plead 776 | 4442 plot 777 | 4443 plow 778 | 4444 pluck 779 | 4445 plug 780 | 4446 plus 781 | 4451 poach 782 | 4452 pod 783 | 4453 poem 784 | 4454 poet 785 | 4455 pogo 786 | 4456 point 787 | 4461 poise 788 | 4462 poker 789 | 4463 polar 790 | 4464 polio 791 | 4465 polka 792 | 4466 polo 793 | 4511 pond 794 | 4512 pony 795 | 4513 poppy 796 | 4514 pork 797 | 4515 poser 798 | 4516 pouch 799 | 4521 pound 800 | 4522 pout 801 | 4523 power 802 | 4524 prank 803 | 4525 press 804 | 4526 print 805 | 4531 prior 806 | 4532 prism 807 | 4533 prize 808 | 4534 probe 809 | 4535 prong 810 | 4536 proof 811 | 4541 props 812 | 4542 prude 813 | 4543 prune 814 | 4544 pry 815 | 4545 pug 816 | 4546 pull 817 | 4551 pulp 818 | 4552 pulse 819 | 4553 puma 820 | 4554 punch 821 | 4555 punk 822 | 4556 pupil 823 | 4561 puppy 824 | 4562 purr 825 | 4563 purse 826 | 4564 push 827 | 4565 putt 828 | 4566 quack 829 | 4611 quake 830 | 4612 query 831 | 4613 quiet 832 | 4614 quill 833 | 4615 quilt 834 | 4616 quit 835 | 4621 quota 836 | 4622 quote 837 | 4623 rabid 838 | 4624 race 839 | 4625 rack 840 | 4626 radar 841 | 4631 radio 842 | 4632 raft 843 | 4633 rage 844 | 4634 raid 845 | 4635 rail 846 | 4636 rake 847 | 4641 rally 848 | 4642 ramp 849 | 4643 ranch 850 | 4644 range 851 | 4645 rank 852 | 4646 rant 853 | 4651 rash 854 | 4652 raven 855 | 4653 reach 856 | 4654 react 857 | 4655 ream 858 | 4656 rebel 859 | 4661 recap 860 | 4662 relax 861 | 4663 relay 862 | 4664 relic 863 | 4665 remix 864 | 4666 repay 865 | 5111 repel 866 | 5112 reply 867 | 5113 rerun 868 | 5114 reset 869 | 5115 rhyme 870 | 5116 rice 871 | 5121 rich 872 | 5122 ride 873 | 5123 rigid 874 | 5124 rigor 875 | 5125 rinse 876 | 5126 riot 877 | 5131 ripen 878 | 5132 rise 879 | 5133 risk 880 | 5134 ritzy 881 | 5135 rival 882 | 5136 river 883 | 5141 roast 884 | 5142 robe 885 | 5143 robin 886 | 5144 rock 887 | 5145 rogue 888 | 5146 roman 889 | 5151 romp 890 | 5152 rope 891 | 5153 rover 892 | 5154 royal 893 | 5155 ruby 894 | 5156 rug 895 | 5161 ruin 896 | 5162 rule 897 | 5163 runny 898 | 5164 rush 899 | 5165 rust 900 | 5166 rut 901 | 5211 sadly 902 | 5212 sage 903 | 5213 said 904 | 5214 saint 905 | 5215 salad 906 | 5216 salon 907 | 5221 salsa 908 | 5222 salt 909 | 5223 same 910 | 5224 sandy 911 | 5225 santa 912 | 5226 satin 913 | 5231 sauna 914 | 5232 saved 915 | 5233 savor 916 | 5234 sax 917 | 5235 say 918 | 5236 scale 919 | 5241 scam 920 | 5242 scan 921 | 5243 scare 922 | 5244 scarf 923 | 5245 scary 924 | 5246 scoff 925 | 5251 scold 926 | 5252 scoop 927 | 5253 scoot 928 | 5254 scope 929 | 5255 score 930 | 5256 scorn 931 | 5261 scout 932 | 5262 scowl 933 | 5263 scrap 934 | 5264 scrub 935 | 5265 scuba 936 | 5266 scuff 937 | 5311 sect 938 | 5312 sedan 939 | 5313 self 940 | 5314 send 941 | 5315 sepia 942 | 5316 serve 943 | 5321 set 944 | 5322 seven 945 | 5323 shack 946 | 5324 shade 947 | 5325 shady 948 | 5326 shaft 949 | 5331 shaky 950 | 5332 sham 951 | 5333 shape 952 | 5334 share 953 | 5335 sharp 954 | 5336 shed 955 | 5341 sheep 956 | 5342 sheet 957 | 5343 shelf 958 | 5344 shell 959 | 5345 shine 960 | 5346 shiny 961 | 5351 ship 962 | 5352 shirt 963 | 5353 shock 964 | 5354 shop 965 | 5355 shore 966 | 5356 shout 967 | 5361 shove 968 | 5362 shown 969 | 5363 showy 970 | 5364 shred 971 | 5365 shrug 972 | 5366 shun 973 | 5411 shush 974 | 5412 shut 975 | 5413 shy 976 | 5414 sift 977 | 5415 silk 978 | 5416 silly 979 | 5421 silo 980 | 5422 sip 981 | 5423 siren 982 | 5424 sixth 983 | 5425 size 984 | 5426 skate 985 | 5431 skew 986 | 5432 skid 987 | 5433 skier 988 | 5434 skies 989 | 5435 skip 990 | 5436 skirt 991 | 5441 skit 992 | 5442 sky 993 | 5443 slab 994 | 5444 slack 995 | 5445 slain 996 | 5446 slam 997 | 5451 slang 998 | 5452 slash 999 | 5453 slate 1000 | 5454 slaw 1001 | 5455 sled 1002 | 5456 sleek 1003 | 5461 sleep 1004 | 5462 sleet 1005 | 5463 slept 1006 | 5464 slice 1007 | 5465 slick 1008 | 5466 slimy 1009 | 5511 sling 1010 | 5512 slip 1011 | 5513 slit 1012 | 5514 slob 1013 | 5515 slot 1014 | 5516 slug 1015 | 5521 slum 1016 | 5522 slurp 1017 | 5523 slush 1018 | 5524 small 1019 | 5525 smash 1020 | 5526 smell 1021 | 5531 smile 1022 | 5532 smirk 1023 | 5533 smog 1024 | 5534 snack 1025 | 5535 snap 1026 | 5536 snare 1027 | 5541 snarl 1028 | 5542 sneak 1029 | 5543 sneer 1030 | 5544 sniff 1031 | 5545 snore 1032 | 5546 snort 1033 | 5551 snout 1034 | 5552 snowy 1035 | 5553 snub 1036 | 5554 snuff 1037 | 5555 speak 1038 | 5556 speed 1039 | 5561 spend 1040 | 5562 spent 1041 | 5563 spew 1042 | 5564 spied 1043 | 5565 spill 1044 | 5566 spiny 1045 | 5611 spoil 1046 | 5612 spoke 1047 | 5613 spoof 1048 | 5614 spool 1049 | 5615 spoon 1050 | 5616 sport 1051 | 5621 spot 1052 | 5622 spout 1053 | 5623 spray 1054 | 5624 spree 1055 | 5625 spur 1056 | 5626 squad 1057 | 5631 squat 1058 | 5632 squid 1059 | 5633 stack 1060 | 5634 staff 1061 | 5635 stage 1062 | 5636 stain 1063 | 5641 stall 1064 | 5642 stamp 1065 | 5643 stand 1066 | 5644 stank 1067 | 5645 stark 1068 | 5646 start 1069 | 5651 stash 1070 | 5652 state 1071 | 5653 stays 1072 | 5654 steam 1073 | 5655 steep 1074 | 5656 stem 1075 | 5661 step 1076 | 5662 stew 1077 | 5663 stick 1078 | 5664 sting 1079 | 5665 stir 1080 | 5666 stock 1081 | 6111 stole 1082 | 6112 stomp 1083 | 6113 stony 1084 | 6114 stood 1085 | 6115 stool 1086 | 6116 stoop 1087 | 6121 stop 1088 | 6122 storm 1089 | 6123 stout 1090 | 6124 stove 1091 | 6125 straw 1092 | 6126 stray 1093 | 6131 strut 1094 | 6132 stuck 1095 | 6133 stud 1096 | 6134 stuff 1097 | 6135 stump 1098 | 6136 stung 1099 | 6141 stunt 1100 | 6142 suds 1101 | 6143 sugar 1102 | 6144 sulk 1103 | 6145 surf 1104 | 6146 sushi 1105 | 6151 swab 1106 | 6152 swan 1107 | 6153 swarm 1108 | 6154 sway 1109 | 6155 swear 1110 | 6156 sweat 1111 | 6161 sweep 1112 | 6162 swell 1113 | 6163 swept 1114 | 6164 swim 1115 | 6165 swing 1116 | 6166 swipe 1117 | 6211 swirl 1118 | 6212 swoop 1119 | 6213 swore 1120 | 6214 syrup 1121 | 6215 tacky 1122 | 6216 taco 1123 | 6221 tag 1124 | 6222 take 1125 | 6223 tall 1126 | 6224 talon 1127 | 6225 tamer 1128 | 6226 tank 1129 | 6231 taper 1130 | 6232 taps 1131 | 6233 tarot 1132 | 6234 tart 1133 | 6235 task 1134 | 6236 taste 1135 | 6241 tasty 1136 | 6242 taunt 1137 | 6243 thank 1138 | 6244 thaw 1139 | 6245 theft 1140 | 6246 theme 1141 | 6251 thigh 1142 | 6252 thing 1143 | 6253 think 1144 | 6254 thong 1145 | 6255 thorn 1146 | 6256 those 1147 | 6261 throb 1148 | 6262 thud 1149 | 6263 thumb 1150 | 6264 thump 1151 | 6265 thus 1152 | 6266 tiara 1153 | 6311 tidal 1154 | 6312 tidy 1155 | 6313 tiger 1156 | 6314 tile 1157 | 6315 tilt 1158 | 6316 tint 1159 | 6321 tiny 1160 | 6322 trace 1161 | 6323 track 1162 | 6324 trade 1163 | 6325 train 1164 | 6326 trait 1165 | 6331 trap 1166 | 6332 trash 1167 | 6333 tray 1168 | 6334 treat 1169 | 6335 tree 1170 | 6336 trek 1171 | 6341 trend 1172 | 6342 trial 1173 | 6343 tribe 1174 | 6344 trick 1175 | 6345 trio 1176 | 6346 trout 1177 | 6351 truce 1178 | 6352 truck 1179 | 6353 trump 1180 | 6354 trunk 1181 | 6355 try 1182 | 6356 tug 1183 | 6361 tulip 1184 | 6362 tummy 1185 | 6363 turf 1186 | 6364 tusk 1187 | 6365 tutor 1188 | 6366 tutu 1189 | 6411 tux 1190 | 6412 tweak 1191 | 6413 tweet 1192 | 6414 twice 1193 | 6415 twine 1194 | 6416 twins 1195 | 6421 twirl 1196 | 6422 twist 1197 | 6423 uncle 1198 | 6424 uncut 1199 | 6425 undo 1200 | 6426 unify 1201 | 6431 union 1202 | 6432 unit 1203 | 6433 untie 1204 | 6434 upon 1205 | 6435 upper 1206 | 6436 urban 1207 | 6441 used 1208 | 6442 user 1209 | 6443 usher 1210 | 6444 utter 1211 | 6445 value 1212 | 6446 vapor 1213 | 6451 vegan 1214 | 6452 venue 1215 | 6453 verse 1216 | 6454 vest 1217 | 6455 veto 1218 | 6456 vice 1219 | 6461 video 1220 | 6462 view 1221 | 6463 viral 1222 | 6464 virus 1223 | 6465 visa 1224 | 6466 visor 1225 | 6511 vixen 1226 | 6512 vocal 1227 | 6513 voice 1228 | 6514 void 1229 | 6515 volt 1230 | 6516 voter 1231 | 6521 vowel 1232 | 6522 wad 1233 | 6523 wafer 1234 | 6524 wager 1235 | 6525 wages 1236 | 6526 wagon 1237 | 6531 wake 1238 | 6532 walk 1239 | 6533 wand 1240 | 6534 wasp 1241 | 6535 watch 1242 | 6536 water 1243 | 6541 wavy 1244 | 6542 wheat 1245 | 6543 whiff 1246 | 6544 whole 1247 | 6545 whoop 1248 | 6546 wick 1249 | 6551 widen 1250 | 6552 widow 1251 | 6553 width 1252 | 6554 wife 1253 | 6555 wifi 1254 | 6556 wilt 1255 | 6561 wimp 1256 | 6562 wind 1257 | 6563 wing 1258 | 6564 wink 1259 | 6565 wipe 1260 | 6566 wired 1261 | 6611 wiry 1262 | 6612 wise 1263 | 6613 wish 1264 | 6614 wispy 1265 | 6615 wok 1266 | 6616 wolf 1267 | 6621 womb 1268 | 6622 wool 1269 | 6623 woozy 1270 | 6624 word 1271 | 6625 work 1272 | 6626 worry 1273 | 6631 wound 1274 | 6632 woven 1275 | 6633 wrath 1276 | 6634 wreck 1277 | 6635 wrist 1278 | 6636 xerox 1279 | 6641 yahoo 1280 | 6642 yam 1281 | 6643 yard 1282 | 6644 year 1283 | 6645 yeast 1284 | 6646 yelp 1285 | 6651 yield 1286 | 6652 yo-yo 1287 | 6653 yodel 1288 | 6654 yoga 1289 | 6655 yoyo 1290 | 6656 yummy 1291 | 6661 zebra 1292 | 6662 zero 1293 | 6663 zesty 1294 | 6664 zippy 1295 | 6665 zone 1296 | 6666 zoom 1297 | -------------------------------------------------------------------------------- /crates/eff-lexical-data/data/eff_short_wordlist_2_0.txt: -------------------------------------------------------------------------------- 1 | 1111 aardvark 2 | 1112 abandoned 3 | 1113 abbreviate 4 | 1114 abdomen 5 | 1115 abhorrence 6 | 1116 abiding 7 | 1121 abnormal 8 | 1122 abrasion 9 | 1123 absorbing 10 | 1124 abundant 11 | 1125 abyss 12 | 1126 academy 13 | 1131 accountant 14 | 1132 acetone 15 | 1133 achiness 16 | 1134 acid 17 | 1135 acoustics 18 | 1136 acquire 19 | 1141 acrobat 20 | 1142 actress 21 | 1143 acuteness 22 | 1144 aerosol 23 | 1145 aesthetic 24 | 1146 affidavit 25 | 1151 afloat 26 | 1152 afraid 27 | 1153 aftershave 28 | 1154 again 29 | 1155 agency 30 | 1156 aggressor 31 | 1161 aghast 32 | 1162 agitate 33 | 1163 agnostic 34 | 1164 agonizing 35 | 1165 agreeing 36 | 1166 aidless 37 | 1211 aimlessly 38 | 1212 ajar 39 | 1213 alarmclock 40 | 1214 albatross 41 | 1215 alchemy 42 | 1216 alfalfa 43 | 1221 algae 44 | 1222 aliens 45 | 1223 alkaline 46 | 1224 almanac 47 | 1225 alongside 48 | 1226 alphabet 49 | 1231 already 50 | 1232 also 51 | 1233 altitude 52 | 1234 aluminum 53 | 1235 always 54 | 1236 amazingly 55 | 1241 ambulance 56 | 1242 amendment 57 | 1243 amiable 58 | 1244 ammunition 59 | 1245 amnesty 60 | 1246 amoeba 61 | 1251 amplifier 62 | 1252 amuser 63 | 1253 anagram 64 | 1254 anchor 65 | 1255 android 66 | 1256 anesthesia 67 | 1261 angelfish 68 | 1262 animal 69 | 1263 anklet 70 | 1264 announcer 71 | 1265 anonymous 72 | 1266 answer 73 | 1311 antelope 74 | 1312 anxiety 75 | 1313 anyplace 76 | 1314 aorta 77 | 1315 apartment 78 | 1316 apnea 79 | 1321 apostrophe 80 | 1322 apple 81 | 1323 apricot 82 | 1324 aquamarine 83 | 1325 arachnid 84 | 1326 arbitrate 85 | 1331 ardently 86 | 1332 arena 87 | 1333 argument 88 | 1334 aristocrat 89 | 1335 armchair 90 | 1336 aromatic 91 | 1341 arrowhead 92 | 1342 arsonist 93 | 1343 artichoke 94 | 1344 asbestos 95 | 1345 ascend 96 | 1346 aseptic 97 | 1351 ashamed 98 | 1352 asinine 99 | 1353 asleep 100 | 1354 asocial 101 | 1355 asparagus 102 | 1356 astronaut 103 | 1361 asymmetric 104 | 1362 atlas 105 | 1363 atmosphere 106 | 1364 atom 107 | 1365 atrocious 108 | 1366 attic 109 | 1411 atypical 110 | 1412 auctioneer 111 | 1413 auditorium 112 | 1414 augmented 113 | 1415 auspicious 114 | 1416 automobile 115 | 1421 auxiliary 116 | 1422 avalanche 117 | 1423 avenue 118 | 1424 aviator 119 | 1425 avocado 120 | 1426 awareness 121 | 1431 awhile 122 | 1432 awkward 123 | 1433 awning 124 | 1434 awoke 125 | 1435 axially 126 | 1436 azalea 127 | 1441 babbling 128 | 1442 backpack 129 | 1443 badass 130 | 1444 bagpipe 131 | 1445 bakery 132 | 1446 balancing 133 | 1451 bamboo 134 | 1452 banana 135 | 1453 barracuda 136 | 1454 basket 137 | 1455 bathrobe 138 | 1456 bazooka 139 | 1461 blade 140 | 1462 blender 141 | 1463 blimp 142 | 1464 blouse 143 | 1465 blurred 144 | 1466 boatyard 145 | 1511 bobcat 146 | 1512 body 147 | 1513 bogusness 148 | 1514 bohemian 149 | 1515 boiler 150 | 1516 bonnet 151 | 1521 boots 152 | 1522 borough 153 | 1523 bossiness 154 | 1524 bottle 155 | 1525 bouquet 156 | 1526 boxlike 157 | 1531 breath 158 | 1532 briefcase 159 | 1533 broom 160 | 1534 brushes 161 | 1535 bubblegum 162 | 1536 buckle 163 | 1541 buddhist 164 | 1542 buffalo 165 | 1543 bullfrog 166 | 1544 bunny 167 | 1545 busboy 168 | 1546 buzzard 169 | 1551 cabin 170 | 1552 cactus 171 | 1553 cadillac 172 | 1554 cafeteria 173 | 1555 cage 174 | 1556 cahoots 175 | 1561 cajoling 176 | 1562 cakewalk 177 | 1563 calculator 178 | 1564 camera 179 | 1565 canister 180 | 1566 capsule 181 | 1611 carrot 182 | 1612 cashew 183 | 1613 cathedral 184 | 1614 caucasian 185 | 1615 caviar 186 | 1616 ceasefire 187 | 1621 cedar 188 | 1622 celery 189 | 1623 cement 190 | 1624 census 191 | 1625 ceramics 192 | 1626 cesspool 193 | 1631 chalkboard 194 | 1632 cheesecake 195 | 1633 chimney 196 | 1634 chlorine 197 | 1635 chopsticks 198 | 1636 chrome 199 | 1641 chute 200 | 1642 cilantro 201 | 1643 cinnamon 202 | 1644 circle 203 | 1645 cityscape 204 | 1646 civilian 205 | 1651 clay 206 | 1652 clergyman 207 | 1653 clipboard 208 | 1654 clock 209 | 1655 clubhouse 210 | 1656 coathanger 211 | 1661 cobweb 212 | 1662 coconut 213 | 1663 codeword 214 | 1664 coexistent 215 | 1665 coffeecake 216 | 1666 cognitive 217 | 2111 cohabitate 218 | 2112 collarbone 219 | 2113 computer 220 | 2114 confetti 221 | 2115 copier 222 | 2116 cornea 223 | 2121 cosmetics 224 | 2122 cotton 225 | 2123 couch 226 | 2124 coverless 227 | 2125 coyote 228 | 2126 coziness 229 | 2131 crawfish 230 | 2132 crewmember 231 | 2133 crib 232 | 2134 croissant 233 | 2135 crumble 234 | 2136 crystal 235 | 2141 cubical 236 | 2142 cucumber 237 | 2143 cuddly 238 | 2144 cufflink 239 | 2145 cuisine 240 | 2146 culprit 241 | 2151 cup 242 | 2152 curry 243 | 2153 cushion 244 | 2154 cuticle 245 | 2155 cybernetic 246 | 2156 cyclist 247 | 2161 cylinder 248 | 2162 cymbal 249 | 2163 cynicism 250 | 2164 cypress 251 | 2165 cytoplasm 252 | 2166 dachshund 253 | 2211 daffodil 254 | 2212 dagger 255 | 2213 dairy 256 | 2214 dalmatian 257 | 2215 dandelion 258 | 2216 dartboard 259 | 2221 dastardly 260 | 2222 datebook 261 | 2223 daughter 262 | 2224 dawn 263 | 2225 daytime 264 | 2226 dazzler 265 | 2231 dealer 266 | 2232 debris 267 | 2233 decal 268 | 2234 dedicate 269 | 2235 deepness 270 | 2236 defrost 271 | 2241 degree 272 | 2242 dehydrator 273 | 2243 deliverer 274 | 2244 democrat 275 | 2245 dentist 276 | 2246 deodorant 277 | 2251 depot 278 | 2252 deranged 279 | 2253 desktop 280 | 2254 detergent 281 | 2255 device 282 | 2256 dexterity 283 | 2261 diamond 284 | 2262 dibs 285 | 2263 dictionary 286 | 2264 diffuser 287 | 2265 digit 288 | 2266 dilated 289 | 2311 dimple 290 | 2312 dinnerware 291 | 2313 dioxide 292 | 2314 diploma 293 | 2315 directory 294 | 2316 dishcloth 295 | 2321 ditto 296 | 2322 dividers 297 | 2323 dizziness 298 | 2324 doctor 299 | 2325 dodge 300 | 2326 doll 301 | 2331 dominoes 302 | 2332 donut 303 | 2333 doorstep 304 | 2334 dorsal 305 | 2335 double 306 | 2336 downstairs 307 | 2341 dozed 308 | 2342 drainpipe 309 | 2343 dresser 310 | 2344 driftwood 311 | 2345 droppings 312 | 2346 drum 313 | 2351 dryer 314 | 2352 dubiously 315 | 2353 duckling 316 | 2354 duffel 317 | 2355 dugout 318 | 2356 dumpster 319 | 2361 duplex 320 | 2362 durable 321 | 2363 dustpan 322 | 2364 dutiful 323 | 2365 duvet 324 | 2366 dwarfism 325 | 2411 dwelling 326 | 2412 dwindling 327 | 2413 dynamite 328 | 2414 dyslexia 329 | 2415 eagerness 330 | 2416 earlobe 331 | 2421 easel 332 | 2422 eavesdrop 333 | 2423 ebook 334 | 2424 eccentric 335 | 2425 echoless 336 | 2426 eclipse 337 | 2431 ecosystem 338 | 2432 ecstasy 339 | 2433 edged 340 | 2434 editor 341 | 2435 educator 342 | 2436 eelworm 343 | 2441 eerie 344 | 2442 effects 345 | 2443 eggnog 346 | 2444 egomaniac 347 | 2445 ejection 348 | 2446 elastic 349 | 2451 elbow 350 | 2452 elderly 351 | 2453 elephant 352 | 2454 elfishly 353 | 2455 eliminator 354 | 2456 elk 355 | 2461 elliptical 356 | 2462 elongated 357 | 2463 elsewhere 358 | 2464 elusive 359 | 2465 elves 360 | 2466 emancipate 361 | 2511 embroidery 362 | 2512 emcee 363 | 2513 emerald 364 | 2514 emission 365 | 2515 emoticon 366 | 2516 emperor 367 | 2521 emulate 368 | 2522 enactment 369 | 2523 enchilada 370 | 2524 endorphin 371 | 2525 energy 372 | 2526 enforcer 373 | 2531 engine 374 | 2532 enhance 375 | 2533 enigmatic 376 | 2534 enjoyably 377 | 2535 enlarged 378 | 2536 enormous 379 | 2541 enquirer 380 | 2542 enrollment 381 | 2543 ensemble 382 | 2544 entryway 383 | 2545 enunciate 384 | 2546 envoy 385 | 2551 enzyme 386 | 2552 epidemic 387 | 2553 equipment 388 | 2554 erasable 389 | 2555 ergonomic 390 | 2556 erratic 391 | 2561 eruption 392 | 2562 escalator 393 | 2563 eskimo 394 | 2564 esophagus 395 | 2565 espresso 396 | 2566 essay 397 | 2611 estrogen 398 | 2612 etching 399 | 2613 eternal 400 | 2614 ethics 401 | 2615 etiquette 402 | 2616 eucalyptus 403 | 2621 eulogy 404 | 2622 euphemism 405 | 2623 euthanize 406 | 2624 evacuation 407 | 2625 evergreen 408 | 2626 evidence 409 | 2631 evolution 410 | 2632 exam 411 | 2633 excerpt 412 | 2634 exerciser 413 | 2635 exfoliate 414 | 2636 exhale 415 | 2641 exist 416 | 2642 exorcist 417 | 2643 explode 418 | 2644 exquisite 419 | 2645 exterior 420 | 2646 exuberant 421 | 2651 fabric 422 | 2652 factory 423 | 2653 faded 424 | 2654 failsafe 425 | 2655 falcon 426 | 2656 family 427 | 2661 fanfare 428 | 2662 fasten 429 | 2663 faucet 430 | 2664 favorite 431 | 2665 feasibly 432 | 2666 february 433 | 3111 federal 434 | 3112 feedback 435 | 3113 feigned 436 | 3114 feline 437 | 3115 femur 438 | 3116 fence 439 | 3121 ferret 440 | 3122 festival 441 | 3123 fettuccine 442 | 3124 feudalist 443 | 3125 feverish 444 | 3126 fiberglass 445 | 3131 fictitious 446 | 3132 fiddle 447 | 3133 figurine 448 | 3134 fillet 449 | 3135 finalist 450 | 3136 fiscally 451 | 3141 fixture 452 | 3142 flashlight 453 | 3143 fleshiness 454 | 3144 flight 455 | 3145 florist 456 | 3146 flypaper 457 | 3151 foamless 458 | 3152 focus 459 | 3153 foggy 460 | 3154 folksong 461 | 3155 fondue 462 | 3156 footpath 463 | 3161 fossil 464 | 3162 fountain 465 | 3163 fox 466 | 3164 fragment 467 | 3165 freeway 468 | 3166 fridge 469 | 3211 frosting 470 | 3212 fruit 471 | 3213 fryingpan 472 | 3214 gadget 473 | 3215 gainfully 474 | 3216 gallstone 475 | 3221 gamekeeper 476 | 3222 gangway 477 | 3223 garlic 478 | 3224 gaslight 479 | 3225 gathering 480 | 3226 gauntlet 481 | 3231 gearbox 482 | 3232 gecko 483 | 3233 gem 484 | 3234 generator 485 | 3235 geographer 486 | 3236 gerbil 487 | 3241 gesture 488 | 3242 getaway 489 | 3243 geyser 490 | 3244 ghoulishly 491 | 3245 gibberish 492 | 3246 giddiness 493 | 3251 giftshop 494 | 3252 gigabyte 495 | 3253 gimmick 496 | 3254 giraffe 497 | 3255 giveaway 498 | 3256 gizmo 499 | 3261 glasses 500 | 3262 gleeful 501 | 3263 glisten 502 | 3264 glove 503 | 3265 glucose 504 | 3266 glycerin 505 | 3311 gnarly 506 | 3312 gnomish 507 | 3313 goatskin 508 | 3314 goggles 509 | 3315 goldfish 510 | 3316 gong 511 | 3321 gooey 512 | 3322 gorgeous 513 | 3323 gosling 514 | 3324 gothic 515 | 3325 gourmet 516 | 3326 governor 517 | 3331 grape 518 | 3332 greyhound 519 | 3333 grill 520 | 3334 groundhog 521 | 3335 grumbling 522 | 3336 guacamole 523 | 3341 guerrilla 524 | 3342 guitar 525 | 3343 gullible 526 | 3344 gumdrop 527 | 3345 gurgling 528 | 3346 gusto 529 | 3351 gutless 530 | 3352 gymnast 531 | 3353 gynecology 532 | 3354 gyration 533 | 3355 habitat 534 | 3356 hacking 535 | 3361 haggard 536 | 3362 haiku 537 | 3363 halogen 538 | 3364 hamburger 539 | 3365 handgun 540 | 3366 happiness 541 | 3411 hardhat 542 | 3412 hastily 543 | 3413 hatchling 544 | 3414 haughty 545 | 3415 hazelnut 546 | 3416 headband 547 | 3421 hedgehog 548 | 3422 hefty 549 | 3423 heinously 550 | 3424 helmet 551 | 3425 hemoglobin 552 | 3426 henceforth 553 | 3431 herbs 554 | 3432 hesitation 555 | 3433 hexagon 556 | 3434 hubcap 557 | 3435 huddling 558 | 3436 huff 559 | 3441 hugeness 560 | 3442 hullabaloo 561 | 3443 human 562 | 3444 hunter 563 | 3445 hurricane 564 | 3446 hushing 565 | 3451 hyacinth 566 | 3452 hybrid 567 | 3453 hydrant 568 | 3454 hygienist 569 | 3455 hypnotist 570 | 3456 ibuprofen 571 | 3461 icepack 572 | 3462 icing 573 | 3463 iconic 574 | 3464 identical 575 | 3465 idiocy 576 | 3466 idly 577 | 3511 igloo 578 | 3512 ignition 579 | 3513 iguana 580 | 3514 illuminate 581 | 3515 imaging 582 | 3516 imbecile 583 | 3521 imitator 584 | 3522 immigrant 585 | 3523 imprint 586 | 3524 iodine 587 | 3525 ionosphere 588 | 3526 ipad 589 | 3531 iphone 590 | 3532 iridescent 591 | 3533 irksome 592 | 3534 iron 593 | 3535 irrigation 594 | 3536 island 595 | 3541 isotope 596 | 3542 issueless 597 | 3543 italicize 598 | 3544 itemizer 599 | 3545 itinerary 600 | 3546 itunes 601 | 3551 ivory 602 | 3552 jabbering 603 | 3553 jackrabbit 604 | 3554 jaguar 605 | 3555 jailhouse 606 | 3556 jalapeno 607 | 3561 jamboree 608 | 3562 janitor 609 | 3563 jarring 610 | 3564 jasmine 611 | 3565 jaundice 612 | 3566 jawbreaker 613 | 3611 jaywalker 614 | 3612 jazz 615 | 3613 jealous 616 | 3614 jeep 617 | 3615 jelly 618 | 3616 jeopardize 619 | 3621 jersey 620 | 3622 jetski 621 | 3623 jezebel 622 | 3624 jiffy 623 | 3625 jigsaw 624 | 3626 jingling 625 | 3631 jobholder 626 | 3632 jockstrap 627 | 3633 jogging 628 | 3634 john 629 | 3635 joinable 630 | 3636 jokingly 631 | 3641 journal 632 | 3642 jovial 633 | 3643 joystick 634 | 3644 jubilant 635 | 3645 judiciary 636 | 3646 juggle 637 | 3651 juice 638 | 3652 jujitsu 639 | 3653 jukebox 640 | 3654 jumpiness 641 | 3655 junkyard 642 | 3656 juror 643 | 3661 justifying 644 | 3662 juvenile 645 | 3663 kabob 646 | 3664 kamikaze 647 | 3665 kangaroo 648 | 3666 karate 649 | 4111 kayak 650 | 4112 keepsake 651 | 4113 kennel 652 | 4114 kerosene 653 | 4115 ketchup 654 | 4116 khaki 655 | 4121 kickstand 656 | 4122 kilogram 657 | 4123 kimono 658 | 4124 kingdom 659 | 4125 kiosk 660 | 4126 kissing 661 | 4131 kite 662 | 4132 kleenex 663 | 4133 knapsack 664 | 4134 kneecap 665 | 4135 knickers 666 | 4136 koala 667 | 4141 krypton 668 | 4142 laboratory 669 | 4143 ladder 670 | 4144 lakefront 671 | 4145 lantern 672 | 4146 laptop 673 | 4151 laryngitis 674 | 4152 lasagna 675 | 4153 latch 676 | 4154 laundry 677 | 4155 lavender 678 | 4156 laxative 679 | 4161 lazybones 680 | 4162 lecturer 681 | 4163 leftover 682 | 4164 leggings 683 | 4165 leisure 684 | 4166 lemon 685 | 4211 length 686 | 4212 leopard 687 | 4213 leprechaun 688 | 4214 lettuce 689 | 4215 leukemia 690 | 4216 levers 691 | 4221 lewdness 692 | 4222 liability 693 | 4223 library 694 | 4224 licorice 695 | 4225 lifeboat 696 | 4226 lightbulb 697 | 4231 likewise 698 | 4232 lilac 699 | 4233 limousine 700 | 4234 lint 701 | 4235 lioness 702 | 4236 lipstick 703 | 4241 liquid 704 | 4242 listless 705 | 4243 litter 706 | 4244 liverwurst 707 | 4245 lizard 708 | 4246 llama 709 | 4251 luau 710 | 4252 lubricant 711 | 4253 lucidity 712 | 4254 ludicrous 713 | 4255 luggage 714 | 4256 lukewarm 715 | 4261 lullaby 716 | 4262 lumberjack 717 | 4263 lunchbox 718 | 4264 luridness 719 | 4265 luscious 720 | 4266 luxurious 721 | 4311 lyrics 722 | 4312 macaroni 723 | 4313 maestro 724 | 4314 magazine 725 | 4315 mahogany 726 | 4316 maimed 727 | 4321 majority 728 | 4322 makeover 729 | 4323 malformed 730 | 4324 mammal 731 | 4325 mango 732 | 4326 mapmaker 733 | 4331 marbles 734 | 4332 massager 735 | 4333 matchstick 736 | 4334 maverick 737 | 4335 maximum 738 | 4336 mayonnaise 739 | 4341 moaning 740 | 4342 mobilize 741 | 4343 moccasin 742 | 4344 modify 743 | 4345 moisture 744 | 4346 molecule 745 | 4351 momentum 746 | 4352 monastery 747 | 4353 moonshine 748 | 4354 mortuary 749 | 4355 mosquito 750 | 4356 motorcycle 751 | 4361 mousetrap 752 | 4362 movie 753 | 4363 mower 754 | 4364 mozzarella 755 | 4365 muckiness 756 | 4366 mudflow 757 | 4411 mugshot 758 | 4412 mule 759 | 4413 mummy 760 | 4414 mundane 761 | 4415 muppet 762 | 4416 mural 763 | 4421 mustard 764 | 4422 mutation 765 | 4423 myriad 766 | 4424 myspace 767 | 4425 myth 768 | 4426 nail 769 | 4431 namesake 770 | 4432 nanosecond 771 | 4433 napkin 772 | 4434 narrator 773 | 4435 nastiness 774 | 4436 natives 775 | 4441 nautically 776 | 4442 navigate 777 | 4443 nearest 778 | 4444 nebula 779 | 4445 nectar 780 | 4446 nefarious 781 | 4451 negotiator 782 | 4452 neither 783 | 4453 nemesis 784 | 4454 neoliberal 785 | 4455 nephew 786 | 4456 nervously 787 | 4461 nest 788 | 4462 netting 789 | 4463 neuron 790 | 4464 nevermore 791 | 4465 nextdoor 792 | 4466 nicotine 793 | 4511 niece 794 | 4512 nimbleness 795 | 4513 nintendo 796 | 4514 nirvana 797 | 4515 nuclear 798 | 4516 nugget 799 | 4521 nuisance 800 | 4522 nullify 801 | 4523 numbing 802 | 4524 nuptials 803 | 4525 nursery 804 | 4526 nutcracker 805 | 4531 nylon 806 | 4532 oasis 807 | 4533 oat 808 | 4534 obediently 809 | 4535 obituary 810 | 4536 object 811 | 4541 obliterate 812 | 4542 obnoxious 813 | 4543 observer 814 | 4544 obtain 815 | 4545 obvious 816 | 4546 occupation 817 | 4551 oceanic 818 | 4552 octopus 819 | 4553 ocular 820 | 4554 office 821 | 4555 oftentimes 822 | 4556 oiliness 823 | 4561 ointment 824 | 4562 older 825 | 4563 olympics 826 | 4564 omissible 827 | 4565 omnivorous 828 | 4566 oncoming 829 | 4611 onion 830 | 4612 onlooker 831 | 4613 onstage 832 | 4614 onward 833 | 4615 onyx 834 | 4616 oomph 835 | 4621 opaquely 836 | 4622 opera 837 | 4623 opium 838 | 4624 opossum 839 | 4625 opponent 840 | 4626 optical 841 | 4631 opulently 842 | 4632 oscillator 843 | 4633 osmosis 844 | 4634 ostrich 845 | 4635 otherwise 846 | 4636 ought 847 | 4641 outhouse 848 | 4642 ovation 849 | 4643 oven 850 | 4644 owlish 851 | 4645 oxford 852 | 4646 oxidize 853 | 4651 oxygen 854 | 4652 oyster 855 | 4653 ozone 856 | 4654 pacemaker 857 | 4655 padlock 858 | 4656 pageant 859 | 4661 pajamas 860 | 4662 palm 861 | 4663 pamphlet 862 | 4664 pantyhose 863 | 4665 paprika 864 | 4666 parakeet 865 | 5111 passport 866 | 5112 patio 867 | 5113 pauper 868 | 5114 pavement 869 | 5115 payphone 870 | 5116 pebble 871 | 5121 peculiarly 872 | 5122 pedometer 873 | 5123 pegboard 874 | 5124 pelican 875 | 5125 penguin 876 | 5126 peony 877 | 5131 pepperoni 878 | 5132 peroxide 879 | 5133 pesticide 880 | 5134 petroleum 881 | 5135 pewter 882 | 5136 pharmacy 883 | 5141 pheasant 884 | 5142 phonebook 885 | 5143 phrasing 886 | 5144 physician 887 | 5145 plank 888 | 5146 pledge 889 | 5151 plotted 890 | 5152 plug 891 | 5153 plywood 892 | 5154 pneumonia 893 | 5155 podiatrist 894 | 5156 poetic 895 | 5161 pogo 896 | 5162 poison 897 | 5163 poking 898 | 5164 policeman 899 | 5165 poncho 900 | 5166 popcorn 901 | 5211 porcupine 902 | 5212 postcard 903 | 5213 poultry 904 | 5214 powerboat 905 | 5215 prairie 906 | 5216 pretzel 907 | 5221 princess 908 | 5222 propeller 909 | 5223 prune 910 | 5224 pry 911 | 5225 pseudo 912 | 5226 psychopath 913 | 5231 publisher 914 | 5232 pucker 915 | 5233 pueblo 916 | 5234 pulley 917 | 5235 pumpkin 918 | 5236 punchbowl 919 | 5241 puppy 920 | 5242 purse 921 | 5243 pushup 922 | 5244 putt 923 | 5245 puzzle 924 | 5246 pyramid 925 | 5251 python 926 | 5252 quarters 927 | 5253 quesadilla 928 | 5254 quilt 929 | 5255 quote 930 | 5256 racoon 931 | 5261 radish 932 | 5262 ragweed 933 | 5263 railroad 934 | 5264 rampantly 935 | 5265 rancidity 936 | 5266 rarity 937 | 5311 raspberry 938 | 5312 ravishing 939 | 5313 rearrange 940 | 5314 rebuilt 941 | 5315 receipt 942 | 5316 reentry 943 | 5321 refinery 944 | 5322 register 945 | 5323 rehydrate 946 | 5324 reimburse 947 | 5325 rejoicing 948 | 5326 rekindle 949 | 5331 relic 950 | 5332 remote 951 | 5333 renovator 952 | 5334 reopen 953 | 5335 reporter 954 | 5336 request 955 | 5341 rerun 956 | 5342 reservoir 957 | 5343 retriever 958 | 5344 reunion 959 | 5345 revolver 960 | 5346 rewrite 961 | 5351 rhapsody 962 | 5352 rhetoric 963 | 5353 rhino 964 | 5354 rhubarb 965 | 5355 rhyme 966 | 5356 ribbon 967 | 5361 riches 968 | 5362 ridden 969 | 5363 rigidness 970 | 5364 rimmed 971 | 5365 riptide 972 | 5366 riskily 973 | 5411 ritzy 974 | 5412 riverboat 975 | 5413 roamer 976 | 5414 robe 977 | 5415 rocket 978 | 5416 romancer 979 | 5421 ropelike 980 | 5422 rotisserie 981 | 5423 roundtable 982 | 5424 royal 983 | 5425 rubber 984 | 5426 rudderless 985 | 5431 rugby 986 | 5432 ruined 987 | 5433 rulebook 988 | 5434 rummage 989 | 5435 running 990 | 5436 rupture 991 | 5441 rustproof 992 | 5442 sabotage 993 | 5443 sacrifice 994 | 5444 saddlebag 995 | 5445 saffron 996 | 5446 sainthood 997 | 5451 saltshaker 998 | 5452 samurai 999 | 5453 sandworm 1000 | 5454 sapphire 1001 | 5455 sardine 1002 | 5456 sassy 1003 | 5461 satchel 1004 | 5462 sauna 1005 | 5463 savage 1006 | 5464 saxophone 1007 | 5465 scarf 1008 | 5466 scenario 1009 | 5511 schoolbook 1010 | 5512 scientist 1011 | 5513 scooter 1012 | 5514 scrapbook 1013 | 5515 sculpture 1014 | 5516 scythe 1015 | 5521 secretary 1016 | 5522 sedative 1017 | 5523 segregator 1018 | 5524 seismology 1019 | 5525 selected 1020 | 5526 semicolon 1021 | 5531 senator 1022 | 5532 septum 1023 | 5533 sequence 1024 | 5534 serpent 1025 | 5535 sesame 1026 | 5536 settler 1027 | 5541 severely 1028 | 5542 shack 1029 | 5543 shelf 1030 | 5544 shirt 1031 | 5545 shovel 1032 | 5546 shrimp 1033 | 5551 shuttle 1034 | 5552 shyness 1035 | 5553 siamese 1036 | 5554 sibling 1037 | 5555 siesta 1038 | 5556 silicon 1039 | 5561 simmering 1040 | 5562 singles 1041 | 5563 sisterhood 1042 | 5564 sitcom 1043 | 5565 sixfold 1044 | 5566 sizable 1045 | 5611 skateboard 1046 | 5612 skeleton 1047 | 5613 skies 1048 | 5614 skulk 1049 | 5615 skylight 1050 | 5616 slapping 1051 | 5621 sled 1052 | 5622 slingshot 1053 | 5623 sloth 1054 | 5624 slumbering 1055 | 5625 smartphone 1056 | 5626 smelliness 1057 | 5631 smitten 1058 | 5632 smokestack 1059 | 5633 smudge 1060 | 5634 snapshot 1061 | 5635 sneezing 1062 | 5636 sniff 1063 | 5641 snowsuit 1064 | 5642 snugness 1065 | 5643 speakers 1066 | 5644 sphinx 1067 | 5645 spider 1068 | 5646 splashing 1069 | 5651 sponge 1070 | 5652 sprout 1071 | 5653 spur 1072 | 5654 spyglass 1073 | 5655 squirrel 1074 | 5656 statue 1075 | 5661 steamboat 1076 | 5662 stingray 1077 | 5663 stopwatch 1078 | 5664 strawberry 1079 | 5665 student 1080 | 5666 stylus 1081 | 6111 suave 1082 | 6112 subway 1083 | 6113 suction 1084 | 6114 suds 1085 | 6115 suffocate 1086 | 6116 sugar 1087 | 6121 suitcase 1088 | 6122 sulphur 1089 | 6123 superstore 1090 | 6124 surfer 1091 | 6125 sushi 1092 | 6126 swan 1093 | 6131 sweatshirt 1094 | 6132 swimwear 1095 | 6133 sword 1096 | 6134 sycamore 1097 | 6135 syllable 1098 | 6136 symphony 1099 | 6141 synagogue 1100 | 6142 syringes 1101 | 6143 systemize 1102 | 6144 tablespoon 1103 | 6145 taco 1104 | 6146 tadpole 1105 | 6151 taekwondo 1106 | 6152 tagalong 1107 | 6153 takeout 1108 | 6154 tallness 1109 | 6155 tamale 1110 | 6156 tanned 1111 | 6161 tapestry 1112 | 6162 tarantula 1113 | 6163 tastebud 1114 | 6164 tattoo 1115 | 6165 tavern 1116 | 6166 thaw 1117 | 6211 theater 1118 | 6212 thimble 1119 | 6213 thorn 1120 | 6214 throat 1121 | 6215 thumb 1122 | 6216 thwarting 1123 | 6221 tiara 1124 | 6222 tidbit 1125 | 6223 tiebreaker 1126 | 6224 tiger 1127 | 6225 timid 1128 | 6226 tinsel 1129 | 6231 tiptoeing 1130 | 6232 tirade 1131 | 6233 tissue 1132 | 6234 tractor 1133 | 6235 tree 1134 | 6236 tripod 1135 | 6241 trousers 1136 | 6242 trucks 1137 | 6243 tryout 1138 | 6244 tubeless 1139 | 6245 tuesday 1140 | 6246 tugboat 1141 | 6251 tulip 1142 | 6252 tumbleweed 1143 | 6253 tupperware 1144 | 6254 turtle 1145 | 6255 tusk 1146 | 6256 tutorial 1147 | 6261 tuxedo 1148 | 6262 tweezers 1149 | 6263 twins 1150 | 6264 tyrannical 1151 | 6265 ultrasound 1152 | 6266 umbrella 1153 | 6311 umpire 1154 | 6312 unarmored 1155 | 6313 unbuttoned 1156 | 6314 uncle 1157 | 6315 underwear 1158 | 6316 unevenness 1159 | 6321 unflavored 1160 | 6322 ungloved 1161 | 6323 unhinge 1162 | 6324 unicycle 1163 | 6325 unjustly 1164 | 6326 unknown 1165 | 6331 unlocking 1166 | 6332 unmarked 1167 | 6333 unnoticed 1168 | 6334 unopened 1169 | 6335 unpaved 1170 | 6336 unquenched 1171 | 6341 unroll 1172 | 6342 unscrewing 1173 | 6343 untied 1174 | 6344 unusual 1175 | 6345 unveiled 1176 | 6346 unwrinkled 1177 | 6351 unyielding 1178 | 6352 unzip 1179 | 6353 upbeat 1180 | 6354 upcountry 1181 | 6355 update 1182 | 6356 upfront 1183 | 6361 upgrade 1184 | 6362 upholstery 1185 | 6363 upkeep 1186 | 6364 upload 1187 | 6365 uppercut 1188 | 6366 upright 1189 | 6411 upstairs 1190 | 6412 uptown 1191 | 6413 upwind 1192 | 6414 uranium 1193 | 6415 urban 1194 | 6416 urchin 1195 | 6421 urethane 1196 | 6422 urgent 1197 | 6423 urologist 1198 | 6424 username 1199 | 6425 usher 1200 | 6426 utensil 1201 | 6431 utility 1202 | 6432 utmost 1203 | 6433 utopia 1204 | 6434 utterance 1205 | 6435 vacuum 1206 | 6436 vagrancy 1207 | 6441 valuables 1208 | 6442 vanquished 1209 | 6443 vaporizer 1210 | 6444 varied 1211 | 6445 vaseline 1212 | 6446 vegetable 1213 | 6451 vehicle 1214 | 6452 velcro 1215 | 6453 vendor 1216 | 6454 vertebrae 1217 | 6455 vestibule 1218 | 6456 veteran 1219 | 6461 vexingly 1220 | 6462 vicinity 1221 | 6463 videogame 1222 | 6464 viewfinder 1223 | 6465 vigilante 1224 | 6466 village 1225 | 6511 vinegar 1226 | 6512 violin 1227 | 6513 viperfish 1228 | 6514 virus 1229 | 6515 visor 1230 | 6516 vitamins 1231 | 6521 vivacious 1232 | 6522 vixen 1233 | 6523 vocalist 1234 | 6524 vogue 1235 | 6525 voicemail 1236 | 6526 volleyball 1237 | 6531 voucher 1238 | 6532 voyage 1239 | 6533 vulnerable 1240 | 6534 waffle 1241 | 6535 wagon 1242 | 6536 wakeup 1243 | 6541 walrus 1244 | 6542 wanderer 1245 | 6543 wasp 1246 | 6544 water 1247 | 6545 waving 1248 | 6546 wheat 1249 | 6551 whisper 1250 | 6552 wholesaler 1251 | 6553 wick 1252 | 6554 widow 1253 | 6555 wielder 1254 | 6556 wifeless 1255 | 6561 wikipedia 1256 | 6562 wildcat 1257 | 6563 windmill 1258 | 6564 wipeout 1259 | 6565 wired 1260 | 6566 wishbone 1261 | 6611 wizardry 1262 | 6612 wobbliness 1263 | 6613 wolverine 1264 | 6614 womb 1265 | 6615 woolworker 1266 | 6616 workbasket 1267 | 6621 wound 1268 | 6622 wrangle 1269 | 6623 wreckage 1270 | 6624 wristwatch 1271 | 6625 wrongdoing 1272 | 6626 xerox 1273 | 6631 xylophone 1274 | 6632 yacht 1275 | 6633 yahoo 1276 | 6634 yard 1277 | 6635 yearbook 1278 | 6636 yesterday 1279 | 6641 yiddish 1280 | 6642 yield 1281 | 6643 yo-yo 1282 | 6644 yodel 1283 | 6645 yogurt 1284 | 6646 yuppie 1285 | 6651 zealot 1286 | 6652 zebra 1287 | 6653 zeppelin 1288 | 6654 zestfully 1289 | 6655 zigzagged 1290 | 6656 zillion 1291 | 6661 zipping 1292 | 6662 zirconium 1293 | 6663 zodiac 1294 | 6664 zombie 1295 | 6665 zookeeper 1296 | 6666 zucchini 1297 | -------------------------------------------------------------------------------- /crates/eff-lexical-data/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![forbid(unsafe_code)] 3 | 4 | // https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation 5 | include!(concat!(env!("OUT_DIR"), "/wordlists.rs")); 6 | -------------------------------------------------------------------------------- /crates/pgen/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pgen" 3 | description = "Passphrase Generator" 4 | license = "ISC" 5 | readme = "README.md" 6 | repository = "https://github.com/ctsrc/Pgen/crates/pgen" 7 | version = "3.0.0-alpha.1" 8 | authors = ["Erik Nordstrøm "] 9 | categories = ["command-line-utilities", "cryptography"] 10 | edition = "2021" 11 | default-run = "pgen" 12 | 13 | [dependencies] 14 | anyhow = { workspace = true } 15 | bip39-lexical-data = { workspace = true } 16 | clap = { workspace = true } 17 | eff-lexical-data = { workspace = true } 18 | rand = { workspace = true } 19 | sha2 = { workspace = true } 20 | thiserror = { workspace = true } 21 | 22 | [dev-dependencies] 23 | test-case = { workspace = true } 24 | -------------------------------------------------------------------------------- /crates/pgen/README.md: -------------------------------------------------------------------------------- 1 | # `pgen`(1) – Passphrase Generator 2 | 3 | [![Crates.io](https://img.shields.io/crates/v/pgen?style=flat-square)](https://crates.io/crates/pgen) 4 | [![Crates.io](https://img.shields.io/crates/d/pgen?style=flat-square)](https://crates.io/crates/pgen) 5 | [![License](https://img.shields.io/badge/license-ISC-blue?style=flat-square)](/LICENSE) 6 | [![GitHub stars](https://img.shields.io/github/stars/ctsrc/Pgen?style=social)](https://github.com/ctsrc/Pgen#start-of-content) 7 | 8 | Generate passphrases using any of the following wordlists: 9 | 10 | * the [wordlists for random passphrases][EFFWL] made by the EFF 11 | * [BIP39][BIP39] 12 | 13 | The EFF wordlists consist of words that are easy to type and easy to remember. 14 | 15 | By default, passphrases generated by `pgen` consist of twelve words 16 | randomly selected from the autocomplete-optimized wordlist. Be sure to 17 | [read the article][EFFWL] to learn about the difference between the 18 | different wordlists provided by the EFF. 19 | 20 | ## Table of Contents 21 | 22 | * [Examples of generated passphrases](#examples-of-generated-passphrases) 23 | * [Latest version available](#latest-version-available) 24 | * [Installation](#installation) 25 | * [Usage](#usage) 26 | - [Options and arguments](#options-and-arguments) 27 | * [How many bits of entropy does your passphrase need?](#how-many-bits-of-entropy-does-your-passphrase-need) 28 | * [Is a CSPRNG really needed here?](#is-a-csprng-really-needed-here) 29 | 30 | ## Examples of generated passphrases 31 | 32 | ### Using the default wordlist 33 | 34 | ```zsh 35 | pgen 36 | ``` 37 | 38 | > spyglass eruption sapphire wifeless thimble breath fossil thwarting sedative peroxide vagrancy earlobe 39 | 40 | ### Using the EFF long wordlist 41 | 42 | ```zsh 43 | pgen -w eff-long 44 | ``` 45 | 46 | > flashy tackle semifinal endowment trekker exhume citrus venus carload implant 47 | 48 | ### Using BIP39 wordlist, and custom number of words 49 | 50 | > [!NOTE] 51 | > In the current version, BIP39 wordlist is available but the BIP39 algorithm itself is not yet used. 52 | > In the upcoming `v3.0.0` release, the BIP39 algorithm will be implemented so that when you use 53 | > the BIP39 wordlist it will generate mnemonics that can be used for generation of valid Bitcoin wallets. 54 | 55 | ```zsh 56 | pgen -w bip39 -n 24 57 | ``` 58 | 59 | > sword relief this any peanut uncle supreme month impose learn rose ramp double auction course mutual bench elder 60 | > unfair dizzy harbor use casino pledge 61 | 62 | ## Latest version available 63 | 64 | ```zsh 65 | pgen --version 66 | ``` 67 | 68 | ```text 69 | pgen 3.0.0-alpha.1 70 | ``` 71 | 72 | ## Installation 73 | 74 | 1. [Install Rust](https://www.rust-lang.org/en-US/install.html). 75 | 2. Run `cargo install -f pgen@3.0.0-alpha.1` 76 | 77 | ## Usage 78 | 79 | ```text 80 | pgen [-d] [-w ] [-n ] [-k ] [-e] 81 | pgen -h | --help 82 | pgen -V | --version 83 | ``` 84 | 85 | ### Options and arguments 86 | 87 | `-w` Specify wordlist to use. 88 | 89 | * `eff-autocomplete` (default): Use *EFF's Short Wordlist #2* 90 | (EFF's "short word list" with words that have unique three-character prefixes) 91 | 92 | Features: 93 | - Each word has a unique three-character prefix. This means that software could 94 | auto-complete words in the passphrase after the user has typed the first three characters. 95 | - All words are at least an edit distance of 3 apart. This means that software could 96 | correct any single typo in the user's passphrase (and in many cases more than one typo). 97 | 98 | Details: 99 | - [Deep Dive: EFF's New Wordlists for Random Passphrases][EFFWL] (2016) 100 | - 101 | 102 | * `eff-long`: Use *EFF's Long Wordlist* 103 | (EFF's "long word list") 104 | 105 | Recommended for the creation of memorable passphrases since the increased number of words, 106 | as well as the greater effective word length, allows for good entropy with a lower amount 107 | of words compared to for example the autocomplete-optimized short wordlist. 108 | 109 | Features: 110 | - Contains words that are easy to type and remember. 111 | - Built from a list of words that prioritizes the most recognized words 112 | and then the most concrete words. 113 | - Manually checked by EFF and attempted to remove as many profane, insulting, sensitive, 114 | or emotionally-charged words as possible, and also filtered based on several public 115 | lists of vulgar English words. 116 | 117 | Details: 118 | - [Deep Dive: EFF's New Wordlists for Random Passphrases][EFFWL] (2016) 119 | - 120 | 121 | * `eff-short`: Use *EFF's Short Wordlist #1* 122 | (EFF's "general short word list") 123 | 124 | Features: 125 | - Designed to include the 1,296 most memorable and distinct words. 126 | 127 | Details: 128 | - [Deep Dive: EFF's New Wordlists for Random Passphrases][EFFWL] (2016) 129 | - 130 | 131 | * `bip39`: Use *BIP39* English wordlist 132 | 133 | Details: 134 | - [BIP39][BIP39] 135 | - 136 | 137 | `-n` Specify the number of words to use *n*. Default value: 138 | 139 | * Twelve (12) words if any of the short wordlists are being used. 140 | * Ten (10) words if the large wordlist is being used. 141 | 142 | Note: When BIP39 wordlist is used, the number of words to use must be one of: 143 | 12, 15, 18, 21, or 24. 144 | 145 | `-k` Specify the number of passphrases to generate *k*. Default value: 1. 146 | 147 | `-e` Calculate and print the entropy for the passphrase(s) that would be 148 | generated with the given settings. What is password entropy? 149 | [Entropy is a measure of what the password could have been, so it relates to the selection process](https://crypto.stackexchange.com/a/376). 150 | 151 | `--dice` Use physical six-sided dice instead of letting the computer pick 152 | words. Useful in case you distrust the ability or willingness of 153 | your computer to generate "sufficiently random" numbers. 154 | 155 | `-h`, `--help` Show help and exit. 156 | 157 | `-V`, `--version` Print version information and exit. 158 | 159 | ## Calculation of entropy 160 | 161 | When calculating the entropy of a password or a passphrase, 162 | [one must assume that the password generation procedure is known to the attacker](https://crypto.stackexchange.com/a/376). 163 | As such, the strength of the passphrases that `pgen` generate are not weakened 164 | in and of itself by the fact that the wordlists we use are publicly known. 165 | 166 | ### EFF wordlists 167 | 168 | When one of the EFF wordlists is used, you have the following total number of distinct words 169 | to pick from the respective list: 170 | 171 | - 7776 words in EFF's "long word list" (`eff-long`) 172 | - 1296 words in EFF's "general short word list" (`eff-short`) 173 | - 1296 words in EFF's "short word list" with words that have unique three-character prefixes (`eff-autocomplete`) 174 | 175 | The number of bits of entropy added by each randomly selected word from these EFF wordlists 176 | depends on the total number of words that are in the list we are selecting the words from. 177 | 178 | To calculate the entropy added by each word, we take the binary logarithm of the number of words total in the wordlist: 179 | 180 | - log2(7776) ~= `12.92` bits of entropy added from each randomly selected word in the "long word list". 181 | - log2(1296) ~= `10.33` bits of entropy added from each randomly selected word in one of the EFF's short word lists. 182 | 183 | Then: 184 | 185 | - Creating a passphrase consisting of 10 randomly selected words from the "long word list" gives 186 | a passphrase with log2(7776^10) ~= `129.25` bits of entropy. 187 | - Creating a passphrase consisting of 12 randomly selected words from one of the EFF's short word lists gives 188 | a passphrase with log2(1296^12) ~= `124.08` bits of entropy. 189 | 190 | ### BIP39 English wordlist and BIP39 algorithm 191 | 192 | When using the BIP39 algorithm, the passphrase is derived directly from a specific number of random bits, 193 | which are then padded with bits from a checksum at the end. 194 | 195 | For example, for a BIP39 mnemonic sentence consisting of 12 words, one has to use 128 random bits 196 | appended by 4 bits of checksum bits. 197 | 198 | The checksum bits do not add entropy, nor are any of the initial entropy bits discarded. 199 | 200 | The entropy of a BIP39 mnemonic sentence is simply the number of random bits 201 | it was generated from in the first place. 202 | 203 | Specifically, BIP39 has five different possible mnemonic sentence lengths, each with 204 | the following corresponding number of bits of entropy: 205 | 206 | - `128` bits of entropy for a BIP39 mnemonic sentence consisting of 12 words. 207 | - `160` bits of entropy for a BIP39 mnemonic sentence consisting of 15 words. 208 | - `192` bits of entropy for a BIP39 mnemonic sentence consisting of 18 words. 209 | - `224` bits of entropy for a BIP39 mnemonic sentence consisting of 21 words. 210 | - `256` bits of entropy for a BIP39 mnemonic sentence consisting of 24 words. 211 | 212 | ## How many bits of entropy does your passphrase need? 213 | 214 | How many bits of entropy should your passphrase consist of? 215 | 216 | Looking at [the article about password strength on Wikipedia](https://en.wikipedia.org/wiki/Password_strength), you will 217 | find that the following is said: 218 | 219 | > The minimum number of bits of entropy needed for a password depends 220 | > on the threat model for the given application. If 221 | > [key stretching](https://en.wikipedia.org/wiki/Key_stretching) 222 | > is not used, passwords with more entropy are needed. 223 | > [RFC 4086](https://tools.ietf.org/html/rfc4086), "Randomness Requirements 224 | > for Security", presents some example threat models and how to calculate 225 | > the entropy desired for each one. Their answers vary between 29 bits 226 | > of entropy needed if only online attacks are expected, and up to 128 bits 227 | > of entropy needed for important cryptographic keys used in applications 228 | > like encryption where the password or key needs to be secure for a long 229 | > period of time and stretching isn't applicable. 230 | 231 | In the case of web services such as webmail, social networks, etc., 232 | given that historically we have seen password databases leaked, where 233 | weak hashing algorithms such as MD5 were used, it is the opinion of the 234 | author that the neighbourhood of 128 bits of entropy is in fact 235 | an appropriate default for such use. 236 | 237 | ## Is a CSPRNG really needed here? 238 | 239 | Using a CSPRNG ensures uniform distribution of probability. This in turn 240 | ensures that the password entropy calculations are correct. Hence, it makes 241 | sense to use a CSPRNG. 242 | 243 | ## See also 244 | 245 | * `lastresort`(1) on [crates.io](https://crates.io/crates/base256) or [GitHub](https://github.com/ctsrc/Base256) 246 | 247 | [EFFWL]: https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases 248 | 249 | [BIP39]: https://en.bitcoin.it/wiki/BIP_0039 250 | -------------------------------------------------------------------------------- /crates/pgen/src/bip39_algorithm.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Erik Nordstrøm 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #![forbid(unsafe_code)] 18 | 19 | use bip39_lexical_data::WL_BIP39; 20 | use sha2::{Digest, Sha256}; 21 | 22 | /// Calculate BIP39 checksum (CS) bits given entropy bits. 23 | fn calculate_cs_bits(ent: &[u8]) -> u8 { 24 | let mut hasher = Sha256::new(); 25 | hasher.update(ent); 26 | let hash = hasher.finalize(); 27 | let shift = match ent.len() { 28 | // 128 bits of entropy (16 bytes) needs 4 bits of checksum 29 | 16 => 4usize, 30 | // 160 bits of entropy (20 bytes) needs 5 bits of checksum 31 | 20 => 3, 32 | // 192 bits of entropy (24 bytes) needs 6 bits of checksum 33 | 24 => 2, 34 | // 224 bits of entropy (28 bytes) needs 7 bits of checksum 35 | 28 => 1, 36 | // 256 bits of entropy (32 bytes) needs 8 bits of checksum 37 | 32 => 0, 38 | // No other number of bits of entropy aside from the above is supported by BIP39. 39 | // And since this function is internal to our program, and we only intend to call it 40 | // with the supported number of bits of entropy, there really isn't much point in going 41 | // through the extra motions of returning an error since it would mean we have a fatal 42 | // (unrecoverable) error in the coding of our program anyway. So we may as well panic 43 | // via `unreachable!()` instead of returning details about the error. 44 | _ => unreachable!(), 45 | }; 46 | hash[0] >> shift 47 | } 48 | 49 | /// Get BIP39 English word from 11 bits. 50 | fn get_word_from_11_bits(value: u16) -> &'static str { 51 | // The caller is responsible for ensuring that only the lower 11 bits are set. 52 | const MAX_ACCEPTABLE_VALUE: u16 = 0b11111111111; 53 | if value > MAX_ACCEPTABLE_VALUE { 54 | unreachable!(); 55 | } 56 | WL_BIP39[value as usize] 57 | } 58 | 59 | /// Extract 11 bit chunks from entropy bytes. Alternate implementation. 60 | /// 61 | /// Returns a `Vec` of 11 bit chunks, along with an `usize` specifying 62 | /// the number of bits that are left over for checksum in the last `u16` element of the `Vec`. 63 | fn chunk_to_11_bit_groups_alt_via_u128(ent: &[u8]) -> (Vec, usize) { 64 | // This function pads the last `u16` of output with zeros, leaving space for checksum. 65 | // The checksum bits can then be added to the result elsewhere. Adding checksum is not 66 | // a responsibility of this function. 67 | let (chunk_size, checksum_num_bits): (usize, usize) = match ent.len() { 68 | 16 => (16, 4), // one full u128 69 | 20 => (4, 5), // five u128 with 32 bits used each 70 | 24 => (8, 6), // two u128 with 64 bits used each 71 | 28 => (4, 7), // seven u128 with 32 bits used each 72 | 32 => (16, 8), // two full u128 73 | // Caller is responsible for ensuring that array length matches one of the BIP39 74 | // valid number of entropy bytes, available above. Since the chunk function is crate internal, 75 | // we can assume that this is taken into account, and we can simply panic if it's not. 76 | // No point in returning an error as the situation would be unrecoverable anyway. 77 | _ => unreachable!(), 78 | }; 79 | 80 | eprintln!("u128 has size {}", size_of::()); 81 | let groups_128 = ent 82 | .chunks(chunk_size) 83 | .map(|c| match ent.len() { 84 | 16 | 32 => u128::from_be_bytes(c.try_into().unwrap()), 85 | 24 => (u64::from_be_bytes(c.try_into().unwrap()) as u128) << 64, 86 | _ => (u32::from_be_bytes(c.try_into().unwrap()) as u128) << 96, 87 | }) 88 | .collect::>(); 89 | 90 | for group_128 in groups_128 { 91 | eprintln!("Group {group_128:#0128b}"); 92 | } 93 | 94 | // TODO: Continue implementation of this function. 95 | todo!(); 96 | } 97 | 98 | /// Extract 11 bit chunks from entropy bytes. 99 | /// 100 | /// Returns a `Vec` of 11 bit chunks, along with an `usize` specifying 101 | /// the number of bits that are left over for checksum in the last `u16` element of the `Vec`. 102 | fn chunk_to_11_bit_groups(ent: &[u8]) -> (Vec, usize) { 103 | let mut chunks = vec![]; 104 | 105 | // Initialize first output chunk. Initially empty. 106 | let mut curr_output_chunk = 0u16; 107 | // Number of bits left for curr chunk to be complete 108 | let mut cc = 11; 109 | 110 | for &curr_input_byte in ent.iter() { 111 | eprintln!("enter byte loop iteration"); 112 | eprintln!("num chunks output so far {:2}", chunks.len()); 113 | eprintln!("curr_input_byte {curr_input_byte:#010b}"); 114 | eprintln!("curr_output_chunk {curr_output_chunk:#013b}"); 115 | eprintln!("cc {cc:#2}"); 116 | 117 | // Number of bits left to take in curr input byte 118 | let mut iu = 8; 119 | eprintln!("iu {iu:#2}"); 120 | 121 | // Take all bits from input byte, filling output chunks. 122 | while iu != 0 { 123 | eprintln!("enter bit take iteration"); 124 | // Number of bits to take 125 | let take_n_bits = if cc >= iu { iu } else { cc }; 126 | eprintln!("take_n_bits {take_n_bits}"); 127 | // Mask for bits to take 128 | // - set the number of bits in the mask corresponding to the number of bits to take 129 | let mask_take_bits = (0xffu16 << (8 - take_n_bits)) as u8; 130 | eprintln!("mask_take_bits {mask_take_bits:#010b}"); 131 | // - shift the mask into position 132 | let mask_take_bits = mask_take_bits >> (8 - iu); 133 | eprintln!("mask_take_bits {mask_take_bits:#010b}"); 134 | // Take bits from input byte 135 | let mut bits_taken = curr_input_byte & mask_take_bits; 136 | eprintln!("bits_taken {bits_taken:#010b}"); 137 | 138 | // Update number of bits left for curr chunk to be complete with 11 bits taken from input. 139 | cc -= take_n_bits; 140 | eprintln!("cc {cc:#2}"); 141 | // Update the number of bits we have left to take from current byte of input. 142 | iu -= take_n_bits; 143 | eprintln!("iu {iu:#2}"); 144 | 145 | // Shift the output chunk with as many bits as we are taking, to make room for these bits. 146 | curr_output_chunk <<= take_n_bits; 147 | eprintln!("curr_output_chunk {curr_output_chunk:#013b}"); 148 | // Shift the taken bits so that they don't have any trailing zeroes. 149 | bits_taken >>= iu; 150 | // Append the taken bits to the output chunk. 151 | curr_output_chunk ^= bits_taken as u16; 152 | eprintln!("curr_output_chunk {curr_output_chunk:#013b}"); 153 | 154 | // If current chunk is complete, save it and create a new empty chunk. 155 | if cc == 0 { 156 | chunks.push(curr_output_chunk); 157 | eprintln!("new chunk"); 158 | curr_output_chunk = 0; 159 | cc = 11; 160 | } 161 | eprintln!("end bit take iteration"); 162 | } 163 | eprintln!("end byte loop iteration"); 164 | eprintln!(); 165 | } 166 | if cc != 11 { 167 | curr_output_chunk <<= cc; 168 | chunks.push(curr_output_chunk); 169 | } else { 170 | cc = 0; 171 | } 172 | 173 | for chunk in &chunks { 174 | eprintln!("chunk {chunk:#013b}"); 175 | } 176 | 177 | (chunks, cc) 178 | } 179 | 180 | #[cfg(test)] 181 | mod test { 182 | use crate::bip39_algorithm::{ 183 | calculate_cs_bits, chunk_to_11_bit_groups, get_word_from_11_bits, 184 | }; 185 | use test_case::test_case; 186 | 187 | // From : 188 | // 189 | // ```json 190 | // [ 191 | // "00000000000000000000000000000000", 192 | // "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about", 193 | // "c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04", 194 | // "xprv9s21ZrQH143K3h3fDYiay8mocZ3afhfULfb5GX8kCBdno77K4HiA15Tg23wpbeF1pLfs1c5SPmYHrEpTuuRhxMwvKDwqdKiGJS9XFKzUsAF" 195 | // ], 196 | // ``` 197 | // 198 | // - 128 bits of "entropy" (all zero in this case). 199 | // - The 12th word in the mnemonic sentence is the 4th word (index 3) in the BIP39 English wordlist. 200 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 3; "with 128 bits of input of all zeros")] 201 | // From : 202 | // 203 | // ```json 204 | // [ 205 | // "000000000000000000000000000000000000000000000000", 206 | // "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon agent", 207 | // "035895f2f481b1b0f01fcf8c289c794660b289981a78f8106447707fdd9666ca06da5a9a565181599b79f53b844d8a71dd9f439c52a3d7b3e8a79c906ac845fa", 208 | // "xprv9s21ZrQH143K3mEDrypcZ2usWqFgzKB6jBBx9B6GfC7fu26X6hPRzVjzkqkPvDqp6g5eypdk6cyhGnBngbjeHTe4LsuLG1cCmKJka5SMkmU" 209 | // ], 210 | // ``` 211 | // 212 | // - 192 bits of "entropy" (all zero in this case). 213 | // - The 18th word in the mnemonic sentence is the 40th word (index 39) in the BIP39 English wordlist. 214 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 39; "with 192 bits of input of all zeros")] 215 | // From : 216 | // 217 | // ```json 218 | // [ 219 | // "0000000000000000000000000000000000000000000000000000000000000000", 220 | // "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art", 221 | // "bda85446c68413707090a52022edd26a1c9462295029f2e60cd7c4f2bbd3097170af7a4d73245cafa9c3cca8d561a7c3de6f5d4a10be8ed2a5e608d68f92fcc8", 222 | // "xprv9s21ZrQH143K32qBagUJAMU2LsHg3ka7jqMcV98Y7gVeVyNStwYS3U7yVVoDZ4btbRNf4h6ibWpY22iRmXq35qgLs79f312g2kj5539ebPM" 223 | // ], 224 | // ``` 225 | // 226 | // - 256 bits of "entropy" (all zero in this case). 227 | // - The 24th word in the mnemonic sentence is the 103rd word (index 102) in the BIP39 English wordlist. 228 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 102; "with 256 bits of input of all zeros")] 229 | fn calculates_cs_bits_correctly(ent: &[u8], cs_expected: u8) { 230 | let cs_actual = calculate_cs_bits(ent); 231 | assert_eq!(cs_expected, cs_actual); 232 | } 233 | 234 | #[test_case(0, "abandon"; "first word in list (index 0)")] 235 | #[test_case(3, "about")] 236 | #[test_case(102, "art")] 237 | #[test_case(2047, "zoo"; "last word in list (index 2047)")] 238 | fn gets_correct_word_from_11_bits(value: u16, expected_word: &str) { 239 | let actual_word = get_word_from_11_bits(value); 240 | assert_eq!(expected_word, actual_word); 241 | } 242 | 243 | #[test] 244 | #[should_panic] 245 | fn get_word_should_panic_when_more_than_11_bits_are_set() { 246 | let value = 2048u16; 247 | let _ = get_word_from_11_bits(value); 248 | } 249 | 250 | // 128 bits of input should have 12 chunks of output, with 4 bits left in last byte for checksum, according to BIP39. 251 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], &[0,0,0,0,0,0,0,0,0,0,0,0], 4; "with 128 bits of input of all zeros")] 252 | #[test_case(&[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff], &[0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0b11111110000], 4; "with 128 bits of input of all ones")] 253 | #[test_case(&[0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0], &[2040,63,1537,2032,127,1027,2016,255,7,1984,510,0], 4; "with 128 bits of input alternating between bytes all one and all zero")] 254 | #[test_case(&[0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff], &[7,1984,510,15,1920,1020,31,1792,2040,63,1537,2032], 4; "with 128 bits of input alternating between bytes all zero and all one")] 255 | #[test_case(&[0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa], &[1365,682,1365,682,1365,682,1365,682,1365,682,1365,672], 4; "with 128 bits of input alternating bits between one and zero")] 256 | #[test_case(&[0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55], &[682,1365,682,1365,682,1365,682,1365,682,1365,682,1360], 4; "with 128 bits of input alternating bits between zero and one")] 257 | #[test_case(&[0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99], &[1228,1638,819,409,1228,1638,819,409,1228,1638,819,400], 4; "with 128 bits of input repeating 0b10011001 pattern")] 258 | #[test_case(&[0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4], &[16,258,32,516,64,1032,129,16,258,32,516,64], 4; "with 128 bits of input having every seventh bit set")] 259 | #[test_case(&[0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8,0x1,0,0x20,0x4,0,0x80], &[1,1,1,1,1,1,1,1,1,1,1,0], 4; "with 128 bits of input having every eleventh bit set")] 260 | #[test_case(&[0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7,0xfe,0xff,0xdf,0xfb,0xff,0x7f], &[2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2032], 4; "with 128 bits of input having all but every eleventh bit set")] 261 | #[test_case(&[0,0,0x20,0,0x4,0,0,0x80,0,0x10,0,0x2,0,0,0x40,0], &[0,8,0,64,0,512,2,0,16,0,128,0], 4; "with 128 bits of input having every nineteenth bit set")] 262 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], &[0,0,0,0,0,0,0,0,0,0,0,16], 4; "with 128 bits of input, having only the very last bit set")] 263 | // 160 bits of input should have 15 chunks of output, with 5 bits left in last byte for checksum, according to BIP39. 264 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 5; "with 160 bits of input of all zeros")] 265 | #[test_case(&[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff], &[0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0b11111100000], 5; "with 160 bits of input of all ones")] 266 | #[test_case(&[0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0], &[2040,63,1537,2032,127,1027,2016,255,7,1984,510,15,1920,1020,0], 5; "with 160 bits of input alternating between bytes all one and all zero")] 267 | #[test_case(&[0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff], &[7,1984,510,15,1920,1020,31,1792,2040,63,1537,2032,127,1027,2016], 5; "with 160 bits of input alternating between bytes all zero and all one")] 268 | #[test_case(&[0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa], &[1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1344], 5; "with 160 bits of input alternating bits between one and zero")] 269 | #[test_case(&[0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55], &[682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,672], 5; "with 160 bits of input alternating bits between zero and one")] 270 | #[test_case(&[0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99], &[1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1228,1638,800], 5; "with 160 bits of input repeating 0b10011001 pattern")] 271 | #[test_case(&[0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40], &[16,258,32,516,64,1032,129,16,258,32,516,64,1032,129,0], 5; "with 160 bits of input having every seventh bit set")] 272 | #[test_case(&[0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8,0x1,0,0x20,0x4,0,0x80,0x10,0x2,0,0x40], &[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0], 5; "with 160 bits of input having every eleventh bit set")] 273 | #[test_case(&[0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7,0xfe,0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf], &[2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2016], 5; "with 160 bits of input having all but every eleventh bit set")] 274 | #[test_case(&[0,0,0x20,0,0x4,0,0,0x80,0,0x10,0,0x2,0,0,0x40,0,0x8,0,0x1,0], &[0,8,0,64,0,512,2,0,16,0,128,0,1024,4,0], 5; "with 160 bits of input having every nineteenth bit set")] 275 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,32], 5; "with 160 bits of input, having only the very last bit set")] 276 | // 192 bits of input should have 18 chunks of output, with 6 bits left in last byte for checksum, according to BIP39. 277 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 6; "with 192 bits of input of all zeros")] 278 | #[test_case(&[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff], &[0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0b11111000000], 6; "with 192 bits of input of all ones")] 279 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64], 6; "with 192 bits of input, having only the very last bit set")] 280 | // 224 bits of input should have 21 chunks of output, with 7 bits left in last byte for checksum, according to BIP39. 281 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 7; "with 224 bits of input of all zeros")] 282 | #[test_case(&[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff], &[0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0b11110000000], 7; "with 224 bits of input of all ones")] 283 | #[test_case(&[0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0], &[2040,63,1537,2032,127,1027,2016,255,7,1984,510,15,1920,1020,31,1792,2040,63,1537,2032,0], 7; "with 224 bits of input alternating between bytes all one and all zero")] 284 | #[test_case(&[0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff], &[7,1984,510,15,1920,1020,31,1792,2040,63,1537,2032,127,1027,2016,255,7,1984,510,15,0b11110000000], 7; "with 224 bits of input alternating between bytes all zero and all one")] 285 | #[test_case(&[0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa], &[1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1280], 7; "with 224 bits of input alternating bits between one and zero")] 286 | #[test_case(&[0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55], &[682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,640], 7; "with 224 bits of input alternating bits between zero and one")] 287 | #[test_case(&[0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99], &[1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1152], 7; "with 224 bits of input repeating 0b10011001 pattern")] 288 | #[test_case(&[0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81], &[16,258,32,516,64,1032,129,16,258,32,516,64,1032,129,16,258,32,516,64,1032,128], 7; "with 224 bits of input having every seventh bit set")] 289 | #[test_case(&[0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8,0x1,0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8,0x1,0,0x20,0x4,0,0x80,0x10], &[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0], 7; "with 224 bits of input having every eleventh bit set")] 290 | #[test_case(&[0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7,0xfe,0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7,0xfe,0xff,0xdf,0xfb,0xff,0x7f,0xef], &[2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,1920], 7; "with 224 bits of input having all but every eleventh bit set")] 291 | #[test_case(&[0,0,0x20,0,0x4,0,0,0x80,0,0x10,0,0x2,0,0,0x40,0,0x8,0,0x1,0,0,0x20,0,0x4,0,0,0x80,0], &[0,8,0,64,0,512,2,0,16,0,128,0,1024,4,0,32,0,256,1,0,0], 7; "with 224 bits of input having every nineteenth bit set")] 292 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128], 7; "with 224 bits of input, having only the very last bit set")] 293 | // 256 bits of input should have 24 chunks of output, with 8 bits left in last byte for checksum, according to BIP39. 294 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 8; "with 256 bits of input of all zeros")] 295 | #[test_case(&[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff], &[0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0x7ff,0b11100000000], 8; "with 256 bits of input of all ones")] 296 | #[test_case(&[0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0], &[2040,63,1537,2032,127,1027,2016,255,7,1984,510,15,1920,1020,31,1792,2040,63,1537,2032,127,1027,2016,0], 8; "with 256 bits of input alternating between bytes all one and all zero")] 297 | #[test_case(&[0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff,0,0xff], &[7,1984,510,15,1920,1020,31,1792,2040,63,1537,2032,127,1027,2016,255,7,1984,510,15,1920,1020,31,0b11100000000], 8; "with 256 bits of input alternating between bytes all zero and all one")] 298 | #[test_case(&[0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa], &[1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,512], 8; "with 256 bits of input alternating bits between one and zero")] 299 | #[test_case(&[0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55], &[682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1365,682,1280], 8; "with 256 bits of input alternating bits between zero and one")] 300 | #[test_case(&[0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99], &[1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1228,1638,819,409,1228,1638,819,256], 8; "with 256 bits of input repeating 0b10011001 pattern")] 301 | #[test_case(&[0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10,0x20,0x40,0x81,0x2,0x4,0x8,0x10], &[16,258,32,516,64,1032,129,16,258,32,516,64,1032,129,16,258,32,516,64,1032,129,16,258,0], 8; "with 256 bits of input having every seventh bit set")] 302 | #[test_case(&[0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8,0x1,0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8,0x1,0,0x20,0x4,0,0x80,0x10,0x2,0,0x40,0x8], &[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0], 8; "with 256 bits of input having every eleventh bit set")] 303 | #[test_case(&[0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7,0xfe,0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7,0xfe,0xff,0xdf,0xfb,0xff,0x7f,0xef,0xfd,0xff,0xbf,0xf7], &[2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,2046,1792], 8; "with 256 bits of input having all but every eleventh bit set")] 304 | #[test_case(&[0,0,0x20,0,0x4,0,0,0x80,0,0x10,0,0x2,0,0,0x40,0,0x8,0,0x1,0,0,0x20,0,0x4,0,0,0x80,0,0x10,0,0x2,0], &[0,8,0,64,0,512,2,0,16,0,128,0,1024,4,0,32,0,256,1,0,8,0,64,0], 8; "with 256 bits of input having every nineteenth bit set")] 305 | #[test_case(&[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], &[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,256], 8; "with 256 bits of input, having only the very last bit set")] 306 | fn chunks_correctly_to_11_bit_groups( 307 | input_ent: &[u8], 308 | expected_chunks: &[u16], 309 | expected_n_cs: usize, 310 | ) { 311 | let (actual_chunks, actual_n_cs) = chunk_to_11_bit_groups(input_ent); 312 | // The output chunks should be as we think they should be. 313 | assert_eq!(expected_chunks, actual_chunks); 314 | // The number of lower bits left for checksum in the last output chunk should be as we think it should. 315 | assert_eq!(expected_n_cs, actual_n_cs); 316 | // Only the lower 11 bits should be set in each output chunk. 317 | for actual_chunk in actual_chunks { 318 | assert_eq!(actual_chunk, actual_chunk & 0b11111111111); 319 | } 320 | } 321 | } 322 | -------------------------------------------------------------------------------- /crates/pgen/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod bip39_algorithm; 2 | -------------------------------------------------------------------------------- /crates/pgen/src/main.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2019, 2023, 2024 Erik Nordstrøm 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #![forbid(unsafe_code)] 18 | 19 | use bip39_lexical_data::WL_BIP39; 20 | use clap::{Parser, ValueEnum}; 21 | use eff_lexical_data::{WL_AUTOCOMPLETE, WL_LONG, WL_SHORT}; 22 | use rand::thread_rng; 23 | use rand::Rng; 24 | use std::io::{stdin, stdout, Write}; 25 | use thiserror::Error; 26 | 27 | #[derive(Parser)] 28 | #[command(author, version, about, long_about = None)] 29 | struct Cli { 30 | /// Use physical six-sided dice instead of letting the computer pick words 31 | #[arg(short = 'd', long = "dice")] 32 | use_physical_dice: bool, 33 | /// Select wordlist to use 34 | #[arg(short = 'w', long = "wordlist", value_enum, default_value_t)] 35 | use_wlist: WordlistChoice, 36 | /// Specify the number of passphrases to generate k 37 | #[arg(short, default_value_t = 1, value_name = "k")] 38 | k: u32, 39 | /// Specify the number of words to use 40 | #[arg(short, value_name = "n")] 41 | n: Option, 42 | /// Calculate and print the entropy for the passphrase(s) that would be generated with the given settings 43 | #[arg(short = 'e')] 44 | calculate_entropy: bool, 45 | } 46 | 47 | #[derive(Eq, PartialEq, Copy, Clone, Debug, ValueEnum)] 48 | enum WordlistChoice { 49 | /// EFF's Short Wordlist #2 50 | /// 51 | /// Features: 52 | /// - Each word has a unique three-character prefix. This means that software could 53 | /// auto-complete words in the passphrase after the user has typed the first three characters. 54 | /// - All words are at least an edit distance of 3 apart. This means that software could 55 | /// correct any single typo in the user's passphrase (and in many cases more than one typo). 56 | /// 57 | /// Details: 58 | /// - 59 | /// - 60 | EffAutocomplete, 61 | /// EFF's Long Wordlist 62 | /// 63 | /// Features: 64 | /// - Contains words that are easy to type and remember. 65 | /// - Built from a list of words that prioritizes the most recognized words 66 | /// and then the most concrete words. 67 | /// - Manually checked by EFF and attempted to remove as many profane, insulting, sensitive, 68 | /// or emotionally-charged words as possible, and also filtered based on several public 69 | /// lists of vulgar English words. 70 | /// 71 | /// Details: 72 | /// - 73 | /// - 74 | EffLong, 75 | /// EFF's Short Wordlist #1 76 | /// 77 | /// Features: 78 | /// - Designed to include the 1,296 most memorable and distinct words. 79 | /// 80 | /// Details: 81 | /// - 82 | /// - 83 | EffShort, 84 | /// BIP39 wordlist 85 | /// 86 | /// Details: 87 | /// - 88 | /// - 89 | Bip39, 90 | } 91 | 92 | impl Default for WordlistChoice { 93 | fn default() -> Self { 94 | Self::EffAutocomplete 95 | } 96 | } 97 | 98 | #[derive(Debug, Error)] 99 | enum Error { 100 | #[error("Invalid number of words for BIP39: {0}")] 101 | Bip39MSLenInvalid(usize), 102 | } 103 | 104 | fn main() -> anyhow::Result<()> { 105 | let cli = Cli::parse(); 106 | 107 | let wordlist = match cli.use_wlist { 108 | WordlistChoice::EffAutocomplete => WL_AUTOCOMPLETE, 109 | WordlistChoice::EffLong => WL_LONG, 110 | WordlistChoice::EffShort => WL_SHORT, 111 | WordlistChoice::Bip39 => WL_BIP39, 112 | }; 113 | 114 | // the EFF wordlists have lengths that are an exact power of 6, 115 | // whereas the bip39 wordlist does not 116 | let num_dice: u32 = if cli.use_wlist == WordlistChoice::Bip39 { 117 | // bip39 has 2048 words, which is a power of 2. 118 | // we need 11 dice because 6**11 / 3**11 = 2048, 119 | // i.e. we use 11 dice because it leads to a multiple 120 | // of the wordlist length 121 | 11 122 | } else if cli.use_wlist == WordlistChoice::EffLong { 123 | // EFF long wordlist has 6**5 = 7776 words 124 | 5 125 | } else { 126 | // Other EFF wordlists have 6**4 = 1296 words 127 | 4 128 | }; 129 | 130 | let num_passphrases = cli.k; 131 | 132 | let num_words = match cli.n { 133 | Some(n) => { 134 | // BIP39 has specific allowable lengths of the generated mnemonic sentence (MS) in words. 135 | // See for details. 136 | let bip39_allowable_mnemonic_sentence_lengths: [usize; 5] = [12, 15, 18, 21, 24]; 137 | if cli.use_wlist == WordlistChoice::Bip39 138 | && !bip39_allowable_mnemonic_sentence_lengths.contains(&n) 139 | { 140 | eprintln!("When BIP39 wordlist is used, number of words to use must be one of: {bip39_allowable_mnemonic_sentence_lengths:?}"); 141 | return Err(Error::Bip39MSLenInvalid(n).into()); 142 | } 143 | n 144 | } 145 | None => { 146 | if cli.use_wlist == WordlistChoice::EffLong { 147 | 10 148 | } else { 149 | 12 150 | } 151 | } 152 | }; 153 | 154 | let stdout = stdout(); 155 | let mut handle = stdout.lock(); 156 | 157 | if cli.calculate_entropy { 158 | handle.write_fmt(format_args!( 159 | "Current settings will create passphrases with {:.2} bits of entropy.\n", 160 | (num_words as f64) * (wordlist.len() as f64).log2() 161 | ))?; 162 | } else { 163 | for _ in 0..num_passphrases { 164 | if cli.use_physical_dice { 165 | let mut word_idx = vec![0usize; num_words]; 166 | 167 | let width = format!("{num_words}").len(); 168 | 169 | for (i, item) in word_idx.iter_mut().enumerate().take(num_words) { 170 | eprint!("Word {:>w$} / {}. ", i + 1, num_words, w = width); 171 | // For the sake of the bip39 wordlist, we modulo index by the wordlist length, 172 | // because the range of the possible values is a multiple of the wordlist length. 173 | // 174 | // With the EFF wordlists, the wordlist lengths match the range 175 | // of the numbers we get from the dice, so for EFF wordlists 176 | // this modulo does not change anything. 177 | *item = read_dice(num_dice) % wordlist.len(); 178 | } 179 | 180 | for i in 0..num_words { 181 | handle.write_all(wordlist[word_idx[i]].as_bytes())?; 182 | if i < (num_words - 1) { 183 | handle.write_all(b" ")?; 184 | } 185 | } 186 | } else { 187 | let mut rng = thread_rng(); 188 | 189 | for i in 0..num_words { 190 | handle.write_all( 191 | wordlist[rng.gen_range(0..wordlist.len()) as usize].as_bytes(), 192 | )?; 193 | if i < (num_words - 1) { 194 | handle.write_all(b" ")?; 195 | } 196 | } 197 | } 198 | 199 | handle.write_all(b"\n")?; 200 | } 201 | } 202 | 203 | Ok(()) 204 | } 205 | 206 | fn read_dice(n: u32) -> usize { 207 | eprint!("Throw {n} dice and enter the number of eyes shown on each: "); 208 | 209 | let mut result = 0; 210 | let mut i = 0; 211 | 212 | while i < n { 213 | let mut input = String::new(); 214 | 215 | stdin().read_line(&mut input).unwrap(); 216 | 217 | for c in input.chars() { 218 | match c { 219 | '1' | '2' | '3' | '4' | '5' | '6' => { 220 | result += (c.to_digit(10).unwrap() - 1) * (6u32).pow(n - i - 1); 221 | i += 1; 222 | } 223 | _ => {} 224 | } 225 | 226 | if i == n { 227 | break; 228 | } 229 | } 230 | } 231 | 232 | result as usize 233 | } 234 | --------------------------------------------------------------------------------