Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Apr 13, 2021
1 parent b13e0f4 commit a6af2e2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions umbral-pre/src/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ pub fn unsafe_hash_to_point(dst: &[u8], data: &[u8]) -> Option<CurvePoint> {
// We use an internal 32-bit counter as additional input
let mut i = 0u32;
while i < <u32>::MAX {
let ibytes = (i as u32).to_be_bytes();

let result = BytesDigest::new_with_dst(dst)
.chain_bytes(&data_len)
.chain_bytes(data)
.chain_bytes(&ibytes)
.chain_bytes(&i.to_be_bytes())
.finalize();

// Set the sign byte
Expand Down Expand Up @@ -67,7 +65,7 @@ impl Hash {
}

pub fn chain_bytes<T: AsRef<[u8]>>(self, bytes: T) -> Self {
Self(digest::Digest::chain(self.0, bytes.as_ref()))
Self(self.0.chain(bytes.as_ref()))
}

pub fn digest(self) -> Sha256 {
Expand Down

0 comments on commit a6af2e2

Please sign in to comment.