sha2/sha256/
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
11fn to_u32s(block: &[u8; 64]) -> [u32; 16] {
12    core::array::from_fn(|i| {
13        let chunk = block[4 * i..][..4].try_into().unwrap();
14        u32::from_be_bytes(chunk)
15    })
16}