aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonic.rs
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2021-08-17 20:25:03 +0000
committerNicholas Rodrigues Lordello <[email protected]>2021-08-17 20:25:03 +0000
commitce4994f3efaed2afbf75d58a627342bac54160db (patch)
tree072ec72ae0f3e4e5e636eb84a380398a59c3bbee /src/mnemonic.rs
parent53c20ea16872d1a7ab3e394d972f7b856d48dd0b (diff)
Signature now has a parity value
This is done as a pre-requisite to adding additional transaction types.
Diffstat (limited to 'src/mnemonic.rs')
-rw-r--r--src/mnemonic.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mnemonic.rs b/src/mnemonic.rs
index ff0718c..02f9f25 100644
--- a/src/mnemonic.rs
+++ b/src/mnemonic.rs
@@ -45,7 +45,7 @@ impl Mnemonic {
pub fn random(language: Language, mnemonic_length: usize) -> Result<Self> {
let len = mnemonic_to_byte_length(mnemonic_length)?;
let buf = {
- let mut buf = [0u8; 64];
+ let mut buf = [0; 64];
let (seed, hash) = buf.split_at_mut(len);
rand::get_entropy(&mut *seed)?;
@@ -65,10 +65,10 @@ impl Mnemonic {
let buf = {
let wordlist = language.wordlist();
- let mut buf = [0u8; 64];
+ let mut buf = [0; 64];
let (seed, hash) = buf.split_at_mut(len);
- let mut acc = 0usize;
+ let mut acc = 0;
let mut bit_offset = 0;
let mut byte_offset = 0;
for word in &words {
@@ -134,7 +134,7 @@ impl Mnemonic {
& WORD_MASK;
buf.push_str(wordlist.word(index as _));
- buf.push(separator)
+ buf.push(separator);
}
buf.pop();
@@ -145,7 +145,7 @@ impl Mnemonic {
pub fn seed(&self, password: impl AsRef<str>) -> Seed {
const ROUNDS: u32 = 2048;
- let mut buf = [0u8; 64];
+ let mut buf = [0; 64];
let salt = format!("mnemonic{}", password.as_ref());
pbkdf2::pbkdf2::<Hmac<Sha512>>(
self.to_phrase().as_bytes(),