1use cfg_if::cfg_if;
5
6mod arch_optimal;
7pub mod portable;
8mod strategies;
9
10cfg_if! {
11 if #[cfg(all(target_arch = "x86_64"))] {
12 mod x86_64;
13 pub use x86_64::{packed_aes_128, packed_aes_256, packed_aes_512, packed_ghash_128, packed_ghash_256, packed_ghash_512, M128, M256, M512, m256_from_u128s};
14 pub use x86_64::packed_ghash_128::{GhashWideMul1x, GhashSquare1x, GhashInvert1x};
15 pub use x86_64::packed_ghash_256::{GhashWideMul2x, GhashSquare2x, GhashInvert2x};
16 pub use x86_64::packed_ghash_512::{GhashWideMul4x, GhashSquare4x, GhashInvert4x};
17 pub use x86_64::packed_ghash_sq_256::GhashSqWideMul1x;
18 pub use x86_64::packed_aes_128::{AesWideMul16x, AesSquare16x, AesInvert16x};
19 pub use x86_64::packed_aes_256::{AesWideMul32x, AesSquare32x, AesInvert32x};
20 pub use x86_64::packed_aes_512::{AesWideMul64x, AesSquare64x, AesInvert64x};
21 } else if #[cfg(target_arch = "aarch64")] {
22 mod aarch64;
23 pub use aarch64::{packed_aes_128, packed_ghash_128, M128, M256, M512, m256_from_u128s};
24 pub use aarch64::packed_ghash_128::{GhashWideMul1x, GhashSquare1x, GhashInvert1x};
25 pub use portable::{packed_aes_256, packed_aes_512, packed_ghash_256, packed_ghash_512};
26 pub use portable::packed_ghash_256::{GhashWideMul2x, GhashSquare2x, GhashInvert2x};
27 pub use portable::packed_ghash_512::{GhashWideMul4x, GhashSquare4x, GhashInvert4x};
28 pub use portable::packed_ghash_sq_256::GhashSqWideMul1x;
29 pub use aarch64::packed_aes_128::{AesWideMul16x, AesSquare16x, AesInvert16x};
30 pub use portable::packed_aes_256::{AesWideMul32x, AesSquare32x, AesInvert32x};
31 pub use portable::packed_aes_512::{AesWideMul64x, AesSquare64x, AesInvert64x};
32 } else if #[cfg(target_arch = "wasm32")] {
33 mod wasm32;
34 pub use wasm32::{packed_ghash_128, packed_ghash_256};
35 pub use wasm32::packed_ghash_128::{GhashWideMul1x, GhashSquare1x, GhashInvert1x};
36 pub use portable::{M128, M256, M512, m256_from_u128s, packed_aes_128, packed_aes_256, packed_aes_512, packed_ghash_512};
37 pub use portable::packed_ghash_256::{GhashWideMul2x, GhashSquare2x, GhashInvert2x};
38 pub use portable::packed_ghash_512::{GhashWideMul4x, GhashSquare4x, GhashInvert4x};
39 pub use portable::packed_ghash_sq_256::GhashSqWideMul1x;
40 pub use portable::packed_aes_128::{AesWideMul16x, AesSquare16x, AesInvert16x};
41 pub use portable::packed_aes_256::{AesWideMul32x, AesSquare32x, AesInvert32x};
42 pub use portable::packed_aes_512::{AesWideMul64x, AesSquare64x, AesInvert64x};
43 } else {
44 pub use portable::{M128, M256, M512, m256_from_u128s, packed_aes_128, packed_aes_256, packed_aes_512, packed_ghash_128, packed_ghash_256, packed_ghash_512};
45 pub use portable::packed_ghash_128::{GhashWideMul1x, GhashSquare1x, GhashInvert1x};
46 pub use portable::packed_ghash_256::{GhashWideMul2x, GhashSquare2x, GhashInvert2x};
47 pub use portable::packed_ghash_512::{GhashWideMul4x, GhashSquare4x, GhashInvert4x};
48 pub use portable::packed_ghash_sq_256::GhashSqWideMul1x;
49 pub use portable::packed_aes_128::{AesWideMul16x, AesSquare16x, AesInvert16x};
50 pub use portable::packed_aes_256::{AesWideMul32x, AesSquare32x, AesInvert32x};
51 pub use portable::packed_aes_512::{AesWideMul64x, AesSquare64x, AesInvert64x};
52 }
53}
54
55pub use arch_optimal::*;
56pub(crate) use portable::packed_arithmetic::{interleave_mask_even, interleave_with_mask};
57pub use portable::{
58 arithmetic::itoh_tsujii::invert_b128,
59 packed::PackedPrimitiveType,
60 packed_aes_8,
61 packed_aes_8::{AesInvert1x, AesSquare1x, AesWideMul1x},
62 pairwise_table_arithmetic::BytewiseLookup,
63 reuse_multiply_arithmetic::ReuseMultiply,
64 scaled_arithmetic::Scaled,
65};
66pub use strategies::*;