add rust-crypto

This commit is contained in:
jiangyuanshu 2020-05-21 12:48:44 +08:00
parent 2a7ba538db
commit 167ec2277c
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,7 @@ phase2 = "0.2.1"
pairing = "0.14"
rand = "0.4"
blake2-rfc = "0.2"
rust-crypto = "0.2"
[dependencies.byteorder]
version = "1"

View File

@ -7,6 +7,8 @@ extern crate byteorder;
#[macro_use]
extern crate hex_literal;
extern crate crypto;
use std::fs::File;
use std::io::{BufWriter, BufReader};
use blake2_rfc::blake2b::Blake2b;
@ -32,6 +34,8 @@ fn main() {
use byteorder::{ReadBytesExt, BigEndian};
use rand::{SeedableRng};
use rand::chacha::ChaChaRng;
use crypto::sha2::Sha256;
use crypto::digest::Digest;
// Place block hash here (block number #631130)
let mut beacon_value: [u8; 32] = hex!("00000000000000000008de28ff08672c5b85add6d51024b90fa9424dadc82691");
@ -45,7 +49,7 @@ fn main() {
// parallelized
if i % (1u64<<(N-10)) == 0 {
print!("{}: ", i);
for b in cur_hash.iter() {
for b in beacon_value.iter() {
print!("{:02x}", b);
}
println!("");