chacha20/
backends.rs

1use cfg_if::cfg_if;
2
3cfg_if! {
4    if #[cfg(chacha20_force_soft)] {
5        pub(crate) mod soft;
6    } else if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
7        cfg_if! {
8            if #[cfg(chacha20_force_avx2)] {
9                pub(crate) mod avx2;
10            } else if #[cfg(chacha20_force_sse2)] {
11                pub(crate) mod sse2;
12            } else {
13                pub(crate) mod soft;
14                pub(crate) mod avx2;
15                pub(crate) mod sse2;
16            }
17        }
18    } else if #[cfg(all(chacha20_force_neon, target_arch = "aarch64", target_feature = "neon"))] {
19        pub(crate) mod neon;
20    } else {
21        pub(crate) mod soft;
22    }
23}