Skip to main content

osom_lib_hashes/sha2/sha2_256/platform/
mod.rs

1//! Holds the specialized, per arch implementations of `SHA2_256`
2
3mod sha2_256_template;
4
5mod sha2_256_x86;
6pub use sha2_256_x86::*;
7
8mod sha2_256_aarch64;
9pub use sha2_256_aarch64::*;
10
11// Ensure that all `SHA2_256` structs are of the same size.
12const _: () = const {
13    use crate::sha2::sha2_256::portable::SHA2_256_Portable;
14
15    macro_rules! assert_sha_size {
16        ( $id: ident ) => {
17            assert!(
18                size_of::<$id>() == size_of::<SHA2_256_Portable>(),
19                concat!(stringify!($id), " has unexpected size.")
20            );
21        };
22    }
23
24    assert_sha_size!(SHA2_256_Portable);
25    assert_sha_size!(SHA2_256_x86);
26    assert_sha_size!(SHA2_256_aarch64);
27};