Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions universal-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub trait UniversalHash: Clone {
fn new(key: &Key<Self>) -> Self;

/// Input a block into the universal hash function
fn update_block(&mut self, block: &Block<Self>);
fn update(&mut self, block: &Block<Self>);

/// Input data into the universal hash function. If the length of the
/// data is not a multiple of the block size, the remaining data is
Expand All @@ -60,15 +60,15 @@ pub trait UniversalHash: Clone {
let mut chunks = data.chunks_exact(Self::BlockSize::to_usize());

for chunk in &mut chunks {
self.update_block(GenericArray::from_slice(chunk));
self.update(GenericArray::from_slice(chunk));
}

let rem = chunks.remainder();

if !rem.is_empty() {
let mut padded_block = GenericArray::default();
padded_block[..rem.len()].copy_from_slice(rem);
self.update_block(&padded_block);
self.update(&padded_block);
}
}

Expand Down