mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-30 20:11:23 +00:00
Migrate to blake2b_simd and blake2s_simd crates
The primary reason for migrating is that these crates provide APIs for setting the personalisation string. This enables us to depend solely on published crates, and thus publish our own crates. The SIMD implementations are ported from libsodium. Closes #67.
This commit is contained in:
@@ -7,12 +7,9 @@ authors = [
|
||||
|
||||
[dependencies]
|
||||
bellman = { path = "../bellman" }
|
||||
blake2b_simd = "0.5"
|
||||
byteorder = "1"
|
||||
ff = { path = "../ff" }
|
||||
pairing = { path = "../pairing" }
|
||||
rand = "0.4"
|
||||
sapling-crypto = { path = "../sapling-crypto" }
|
||||
|
||||
[dependencies.blake2-rfc]
|
||||
git = "https://github.com/gtank/blake2-rfc"
|
||||
rev = "7a5b5fc99ae483a0043db7547fb79a6fa44b88a9"
|
||||
|
@@ -1,10 +1,10 @@
|
||||
use blake2_rfc::blake2b::Blake2b;
|
||||
use blake2b_simd::State;
|
||||
use std::io::{self, Read};
|
||||
|
||||
/// Abstraction over a reader which hashes the data being read.
|
||||
pub struct HashReader<R: Read> {
|
||||
reader: R,
|
||||
hasher: Blake2b,
|
||||
hasher: State,
|
||||
}
|
||||
|
||||
impl<R: Read> HashReader<R> {
|
||||
@@ -12,7 +12,7 @@ impl<R: Read> HashReader<R> {
|
||||
pub fn new(reader: R) -> Self {
|
||||
HashReader {
|
||||
reader: reader,
|
||||
hasher: Blake2b::new(64),
|
||||
hasher: State::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
extern crate bellman;
|
||||
extern crate blake2_rfc;
|
||||
extern crate blake2b_simd;
|
||||
extern crate byteorder;
|
||||
extern crate ff;
|
||||
extern crate pairing;
|
||||
|
Reference in New Issue
Block a user