From 42818edc291790fa1b6f0ebd0a7898639f14c763 Mon Sep 17 00:00:00 2001 From: Chuong Dong Date: Fri, 23 Jun 2023 09:22:32 -0700 Subject: [PATCH] Fix Hc256Core h2 function --- hc-256/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hc-256/src/lib.rs b/hc-256/src/lib.rs index 000ea013..0d8b45a3 100644 --- a/hc-256/src/lib.rs +++ b/hc-256/src/lib.rs @@ -198,10 +198,10 @@ impl Hc256Core { #[inline] fn h2(&self, x: u32) -> u32 { - self.qtable[(x & 0xff) as usize] - .wrapping_add(self.qtable[(256 + ((x >> 8) & 0xff)) as usize]) - .wrapping_add(self.qtable[(512 + ((x >> 16) & 0xff)) as usize]) - .wrapping_add(self.qtable[(768 + ((x >> 24) & 0xff)) as usize]) + self.ptable[(x & 0xff) as usize] + .wrapping_add(self.ptable[(256 + ((x >> 8) & 0xff)) as usize]) + .wrapping_add(self.ptable[(512 + ((x >> 16) & 0xff)) as usize]) + .wrapping_add(self.ptable[(768 + ((x >> 24) & 0xff)) as usize]) } fn gen_word(&mut self) -> u32 {