sha2/sha512/soft.rs
1cfg_if::cfg_if! {
2 if #[cfg(sha2_backend_soft = "compact")] {
3 mod compact;
4 pub(super) use compact::compress;
5 } else {
6 mod unroll;
7 pub(super) use unroll::compress;
8 }
9}
10
11#[inline(always)]
12fn to_u64s(block: &[u8; 128]) -> [u64; 16] {
13 core::array::from_fn(|i| {
14 let chunk = block[8 * i..][..8].try_into().unwrap();
15 u64::from_be_bytes(chunk)
16 })
17}