Skip to content

Commit 49cd5c6

Browse files
Merge pull request #5 from synonymdev/fix/mnemonic-entropy
fix: 12 word mnemonic entropy
2 parents 5d03074 + 89ec280 commit 49cd5c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/io/utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ use std::sync::Arc;
6262
/// [`Builder::set_entropy_bip39_mnemonic`]: crate::Builder::set_entropy_bip39_mnemonic
6363
pub fn generate_entropy_mnemonic() -> Mnemonic {
6464
// bip39::Mnemonic supports 256 bit entropy max
65-
let mut entropy = [0; 32];
65+
// We use 12 words, which is 128 bit entropy
66+
let mut entropy = [0; 16];
6667
thread_rng().fill_bytes(&mut entropy);
6768
Mnemonic::from_entropy(&entropy).unwrap()
6869
}

0 commit comments

Comments
 (0)