bellman: Migrate to sha2 0.9

This commit is contained in:
Jack Grigg 2020-06-25 22:03:14 +12:00
parent b6a2e4e485
commit 10ac7ce51f
2 changed files with 3 additions and 4 deletions

View File

@ -27,7 +27,7 @@ subtle = "2.2.1"
hex-literal = "0.2"
rand = "0.7"
rand_xorshift = "0.2"
sha2 = "0.8"
sha2 = "0.9"
[features]
groth16 = ["pairing"]

View File

@ -343,8 +343,8 @@ mod test {
for input_len in (0..32).chain((32..256).filter(|a| a % 8 == 0)) {
let mut h = Sha256::new();
let data: Vec<u8> = (0..input_len).map(|_| rng.next_u32() as u8).collect();
h.input(&data);
let hash_result = h.result();
h.update(&data);
let hash_result = h.finalize();
let mut cs = TestConstraintSystem::<Fr>::new();
let mut input_bits = vec![];
@ -366,7 +366,6 @@ mod test {
assert!(cs.is_satisfied());
let mut s = hash_result
.as_ref()
.iter()
.flat_map(|&byte| (0..8).rev().map(move |i| (byte >> i) & 1u8 == 1u8));