Skip to content

Commit

Permalink
tiger: move tables to src/tables.bin
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Jan 11, 2024
1 parent 3f785e8 commit c3b3af7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1,043 deletions.
18 changes: 9 additions & 9 deletions tiger/src/compress.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use super::tables::{T1, T2, T3, T4};
use super::tables::TABLES;
use super::State;

#[inline(always)]
fn round(a: &mut u64, b: &mut u64, c: &mut u64, x: &u64, mul: u8) {
*c ^= *x;
let c2: [u8; 8] = c.to_le_bytes();
let a2 = T1[usize::from(c2[0])]
^ T2[usize::from(c2[2])]
^ T3[usize::from(c2[4])]
^ T4[usize::from(c2[6])];
let b2 = T4[usize::from(c2[1])]
^ T3[usize::from(c2[3])]
^ T2[usize::from(c2[5])]
^ T1[usize::from(c2[7])];
let a2 = TABLES[0][usize::from(c2[0])]
^ TABLES[1][usize::from(c2[2])]
^ TABLES[2][usize::from(c2[4])]
^ TABLES[3][usize::from(c2[6])];
let b2 = TABLES[3][usize::from(c2[1])]
^ TABLES[2][usize::from(c2[3])]
^ TABLES[1][usize::from(c2[5])]
^ TABLES[0][usize::from(c2[7])];
*a = a.wrapping_sub(a2);
*b = b.wrapping_add(b2).wrapping_mul(u64::from(mul));
}
Expand Down
1 change: 0 additions & 1 deletion tiger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]

pub use digest::{self, Digest};
Expand Down
Binary file added tiger/src/tables.bin
Binary file not shown.
Loading

0 comments on commit c3b3af7

Please sign in to comment.