diff --git a/poly-commit/Cargo.toml b/poly-commit/Cargo.toml index 1412fb71..65bd8ead 100644 --- a/poly-commit/Cargo.toml +++ b/poly-commit/Cargo.toml @@ -17,7 +17,6 @@ ark-crypto-primitives = {version = "^0.4.0", default-features = false, features ark-std = { version = "^0.4.0", default-features = false } blake2 = { version = "0.10", default-features = false } -blake3 = { version = "1.5.4", default-features = false } derivative = { version = "2", features = [ "use_core" ] } digest = "0.10" diff --git a/poly-commit/src/constraints.rs b/poly-commit/src/constraints.rs index 12962aec..997296dd 100644 --- a/poly-commit/src/constraints.rs +++ b/poly-commit/src/constraints.rs @@ -202,7 +202,10 @@ pub struct LabeledPointVar { /// An allocated version of `QuerySet`. #[derive(Clone)] pub struct QuerySetVar( - pub HashSet<(String, LabeledPointVar), DefaultHasher>, + pub HashSet< + (String, LabeledPointVar), + BuildHasherDefault, + >, ); /// An allocated version of `Evaluations`. diff --git a/poly-commit/src/hyrax/mod.rs b/poly-commit/src/hyrax/mod.rs index 85a3a833..27545e99 100644 --- a/poly-commit/src/hyrax/mod.rs +++ b/poly-commit/src/hyrax/mod.rs @@ -11,6 +11,9 @@ use ark_poly::MultilinearExtension; use ark_serialize::serialize_to_vec; use ark_std::{marker::PhantomData, rand::RngCore, string::ToString, vec::Vec, UniformRand}; +use blake2::Blake2s256; +use digest::Digest; + #[cfg(feature = "parallel")] use rayon::prelude::*; @@ -144,15 +147,16 @@ where // generators, since the point at infinity should theoretically occur) let points: Vec<_> = ark_std::cfg_into_iter!(0u64..dim + 1) .map(|i| { - let hash = blake3::hash([PROTOCOL_NAME, &i.to_le_bytes()].concat().as_slice()); - let mut p = G::from_random_bytes(hash.as_bytes()); + let hash = + Blake2s256::digest([PROTOCOL_NAME, &i.to_le_bytes()].concat().as_slice()); + let mut p = G::from_random_bytes(&hash); let mut j = 0u64; while p.is_none() { let mut bytes = PROTOCOL_NAME.to_vec(); bytes.extend(i.to_le_bytes()); bytes.extend(j.to_le_bytes()); - let hash = blake3::hash(bytes.as_slice()); - p = G::from_random_bytes(hash.as_bytes()); + let hash = Blake2s256::digest(bytes.as_slice()); + p = G::from_random_bytes(&hash); j += 1; } let point = p.unwrap();