Remove dependency on byteorder crate

This commit is contained in:
Sean Bowe 2021-02-02 11:57:21 -07:00 committed by Daira Hopwood
parent 783e602e85
commit c48229ce0f
2 changed files with 1 additions and 5 deletions

View file

@ -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"

View file

@ -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<F: FieldExt>(message: &[u8], domain_separation_tag: &[u8],
const CHUNKLEN: usize = 64;
let outlen = buf.len() * CHUNKLEN;
let mut outlen_enc = vec![];
outlen_enc.write_u32::<BigEndian>(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);