Skip to content

Commit 61e39e6

Browse files
authored
Fix Hc256Core h2 function (#324)
1 parent 4cb053f commit 61e39e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hc-256/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ impl Hc256Core {
198198

199199
#[inline]
200200
fn h2(&self, x: u32) -> u32 {
201-
self.qtable[(x & 0xff) as usize]
202-
.wrapping_add(self.qtable[(256 + ((x >> 8) & 0xff)) as usize])
203-
.wrapping_add(self.qtable[(512 + ((x >> 16) & 0xff)) as usize])
204-
.wrapping_add(self.qtable[(768 + ((x >> 24) & 0xff)) as usize])
201+
self.ptable[(x & 0xff) as usize]
202+
.wrapping_add(self.ptable[(256 + ((x >> 8) & 0xff)) as usize])
203+
.wrapping_add(self.ptable[(512 + ((x >> 16) & 0xff)) as usize])
204+
.wrapping_add(self.ptable[(768 + ((x >> 24) & 0xff)) as usize])
205205
}
206206

207207
fn gen_word(&mut self) -> u32 {

0 commit comments

Comments
 (0)