add rust-crypto
This commit is contained in:
parent
2a7ba538db
commit
167ec2277c
|
@ -29,6 +29,7 @@ phase2 = "0.2.1"
|
||||||
pairing = "0.14"
|
pairing = "0.14"
|
||||||
rand = "0.4"
|
rand = "0.4"
|
||||||
blake2-rfc = "0.2"
|
blake2-rfc = "0.2"
|
||||||
|
rust-crypto = "0.2"
|
||||||
|
|
||||||
[dependencies.byteorder]
|
[dependencies.byteorder]
|
||||||
version = "1"
|
version = "1"
|
||||||
|
|
|
@ -7,6 +7,8 @@ extern crate byteorder;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate hex_literal;
|
extern crate hex_literal;
|
||||||
|
|
||||||
|
extern crate crypto;
|
||||||
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{BufWriter, BufReader};
|
use std::io::{BufWriter, BufReader};
|
||||||
use blake2_rfc::blake2b::Blake2b;
|
use blake2_rfc::blake2b::Blake2b;
|
||||||
|
@ -32,6 +34,8 @@ fn main() {
|
||||||
use byteorder::{ReadBytesExt, BigEndian};
|
use byteorder::{ReadBytesExt, BigEndian};
|
||||||
use rand::{SeedableRng};
|
use rand::{SeedableRng};
|
||||||
use rand::chacha::ChaChaRng;
|
use rand::chacha::ChaChaRng;
|
||||||
|
use crypto::sha2::Sha256;
|
||||||
|
use crypto::digest::Digest;
|
||||||
|
|
||||||
// Place block hash here (block number #631130)
|
// Place block hash here (block number #631130)
|
||||||
let mut beacon_value: [u8; 32] = hex!("00000000000000000008de28ff08672c5b85add6d51024b90fa9424dadc82691");
|
let mut beacon_value: [u8; 32] = hex!("00000000000000000008de28ff08672c5b85add6d51024b90fa9424dadc82691");
|
||||||
|
@ -45,7 +49,7 @@ fn main() {
|
||||||
// parallelized
|
// parallelized
|
||||||
if i % (1u64<<(N-10)) == 0 {
|
if i % (1u64<<(N-10)) == 0 {
|
||||||
print!("{}: ", i);
|
print!("{}: ", i);
|
||||||
for b in cur_hash.iter() {
|
for b in beacon_value.iter() {
|
||||||
print!("{:02x}", b);
|
print!("{:02x}", b);
|
||||||
}
|
}
|
||||||
println!("");
|
println!("");
|
||||||
|
|
Loading…
Reference in New Issue