Replace SHA3 with BLAKE2b everywhere

This commit is contained in:
Ignotus Peverell
2017-07-20 13:52:07 +00:00
parent 9703cba92a
commit 01b66de437
7 changed files with 23 additions and 30 deletions
+3 -6
View File
@@ -21,7 +21,7 @@ extern crate log;
extern crate env_logger;
extern crate serde;
extern crate serde_json;
extern crate tiny_keccak;
extern crate blake2;
extern crate grin_api as api;
extern crate grin_grin as grin;
@@ -34,8 +34,8 @@ use std::thread;
use std::io::Read;
use std::fs::File;
use std::time::Duration;
use tiny_keccak::Keccak;
use blake2::blake2b::blake2b;
use clap::{Arg, App, SubCommand, ArgMatches};
use daemonize::Daemonize;
@@ -264,10 +264,7 @@ fn wallet_command(wallet_args: &ArgMatches) {
let hd_seed = wallet_args.value_of("pass").expect("Wallet passphrase required.");
// TODO do something closer to BIP39, eazy solution right now
let mut sha3 = Keccak::new_sha3_256();
sha3.update(hd_seed.as_bytes());
let mut seed = [0; 32];
sha3.finalize(&mut seed);
let seed = blake2b(32, &[], hd_seed.as_bytes());
let s = Secp256k1::new();
let key = wallet::ExtendedKey::from_seed(&s, &seed[..])