keyfork-mnemonic-from-seed: allow arbitrary sized mnemonic
This commit is contained in:
parent
2670cf63a3
commit
55b41a49ef
|
@ -149,7 +149,8 @@ impl FromStr for Mnemonic {
|
|||
None => return Err(MnemonicFromStrError::InvalidWord(index)),
|
||||
}
|
||||
}
|
||||
if ![12, 24].contains(&words.len()) {
|
||||
// 3 words for every 32 bits
|
||||
if words.len() % 3 != 0 {
|
||||
return Err(MnemonicFromStrError::InvalidWordCount(words.len()));
|
||||
}
|
||||
Ok(Mnemonic { words, wordlist })
|
||||
|
|
|
@ -6,7 +6,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
input.read_line(&mut line)?;
|
||||
let decoded = smex::decode(line.trim())?;
|
||||
|
||||
let mnemonic = Mnemonic::from_entropy(&decoded, Default::default())?;
|
||||
let mnemonic = unsafe { Mnemonic::from_raw_entropy(&decoded, Default::default()) };
|
||||
|
||||
println!("{mnemonic}");
|
||||
|
||||
|
|
Loading…
Reference in New Issue