diff options
Diffstat (limited to 'rust/vendor/polyval/src/backend.rs')
-rw-r--r-- | rust/vendor/polyval/src/backend.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/rust/vendor/polyval/src/backend.rs b/rust/vendor/polyval/src/backend.rs new file mode 100644 index 0000000..2bd0c28 --- /dev/null +++ b/rust/vendor/polyval/src/backend.rs @@ -0,0 +1,24 @@ +//! POLYVAL backends + +#[cfg_attr(not(target_pointer_width = "64"), path = "backend/soft32.rs")] +#[cfg_attr(target_pointer_width = "64", path = "backend/soft64.rs")] +mod soft; + +use cfg_if::cfg_if; + +cfg_if! { + if #[cfg(all(target_arch = "aarch64", feature = "armv8", not(feature = "force-soft")))] { + mod autodetect; + mod pmull; + pub use crate::backend::autodetect::Polyval; + } else if #[cfg(all( + any(target_arch = "x86_64", target_arch = "x86"), + not(feature = "force-soft") + ))] { + mod autodetect; + mod clmul; + pub use crate::backend::autodetect::Polyval; + } else { + pub use crate::backend::soft::Polyval; + } +} |