Custom fork of rust-bip39 with modifications for higher speed. Unsuitable for production.
Go to file
Tobin Harding 60144920f3 Allow word count multiples of 3 instead of 6
BIP39 says

> The allowed size of ENT is 128-256 bits.

Once we add the checksum this is 132-264 bits. This is divided by 11 to
get the word count. From the BIP141
```
CS = ENT / 32
MS = (ENT + CS) / 11

|  ENT  | CS | ENT+CS |  MS  |
+-------+----+--------+------+
|  128  |  4 |   132  |  12  |
|  160  |  5 |   165  |  15  |
|  192  |  6 |   198  |  18  |
|  224  |  7 |   231  |  21  |
|  256  |  8 |   264  |  24  |
```

Currently we are limiting word count to be a multiple of 6, I do not
know why this is being done but from reading the BIP it seems that 15 is
a valid word count value.

Allow word count of 15 by checking the word count modulo 3 instead of
modulo 6. Since this check appears twice in the code, add a helper
function to reduce code duplication.

Fixes: #15
2021-11-10 09:17:14 +11:00
benches Apply rustfmt 2021-03-24 22:19:26 +00:00
src Allow word count multiples of 3 instead of 6 2021-11-10 09:17:14 +11:00
.editorconfig Rewrite keeping mnemonic in buffer 2020-06-15 11:49:24 +01:00
.gitignore First version, with static references 2020-06-07 00:46:54 +01:00
.rustfmt.toml Add .rustfmt.toml 2021-03-24 22:19:13 +00:00
.travis.yml Remove core feature 2021-03-24 19:02:35 +00:00
CHANGELOG.md Bump version to v1.0.1 2021-04-01 15:29:15 +01:00
Cargo.toml Bump version to v1.0.1 2021-04-01 15:29:15 +01:00
LICENSE First version, with static references 2020-06-07 00:46:54 +01:00
README.md Bump version to v1.0.0 2021-03-25 11:04:30 +00:00

README.md

bip39

A Rust implementation of BIP-39 mnemonic codes.

Word lists (languages)

We support all languages specified in the BIP-39 standard as of writing.

The English language is always loaded and other languages can be loaded using the corresponding feature.

Use the all-languages feature to enable all languages.

  • English (always enabled)
  • Simplified Chinese (chinese-simplified)
  • Traditional Chinese (chinese-traditional)
  • Czech (czech)
  • French (french)
  • Italian (italian)
  • Japanese (japanese)
  • Korean (korean)
  • Spanish (spanish)

MSRV

This crate supports Rust v1.29 and up and works with no_std.