diff --git a/Cargo.toml b/Cargo.toml index b45e69c..67b501d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,6 @@ blake2b_simd = "0.5" sha3 = "0.9.1" lazy_static = "1.4.0" static_assertions = "1.1.0" -byteorder = "1.4.2" # Temporary workaround for https://github.com/myrrlyn/funty/issues/3 funty = "=1.1.0" diff --git a/src/pasta/hashtocurve.rs b/src/pasta/hashtocurve.rs index bd073ae..2467e6f 100644 --- a/src/pasta/hashtocurve.rs +++ b/src/pasta/hashtocurve.rs @@ -1,7 +1,6 @@ //! This module implements "simplified SWU" hashing to short Weierstrass curves //! with a = 0. -use byteorder::{BigEndian, WriteBytesExt}; use subtle::ConstantTimeEq; use crate::arithmetic::{Curve, CurveAffine, FieldExt}; @@ -16,12 +15,10 @@ pub fn hash_to_field(message: &[u8], domain_separation_tag: &[u8], const CHUNKLEN: usize = 64; let outlen = buf.len() * CHUNKLEN; - let mut outlen_enc = vec![]; - outlen_enc.write_u32::(outlen as u32).unwrap(); let mut xof = sha3::Shake128::default(); xof.update(message); - xof.update(outlen_enc); + xof.update(&(outlen as u32).to_be_bytes()); xof.update([domain_separation_tag.len() as u8]); xof.update(domain_separation_tag);