From 62da5737e82340cfd5f924b9b53fbec2f9079c42 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Fri, 11 Dec 2020 12:51:21 +0700 Subject: [PATCH] Fix test leading zeroes in the hash lead to test failure --- src/cryptographic_primitives/commitments/hash_commitment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptographic_primitives/commitments/hash_commitment.rs b/src/cryptographic_primitives/commitments/hash_commitment.rs index c70f2ab5..01f607fe 100644 --- a/src/cryptographic_primitives/commitments/hash_commitment.rs +++ b/src/cryptographic_primitives/commitments/hash_commitment.rs @@ -80,7 +80,7 @@ mod tests { let (_commitment, blind_factor) = HashCommitment::create_commitment(&message); let commitment2 = HashCommitment::create_commitment_with_user_defined_randomness(&message, &blind_factor); - assert_eq!(commitment2.to_str_radix(16).len(), SECURITY_BITS / 4); + assert!(commitment2.to_str_radix(16).len() / 2 <= SECURITY_BITS / 8); } #[test]