diff --git a/Cargo.toml b/Cargo.toml index 81dca59c1..69d5d34dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,3 +63,11 @@ alloc = ["zeroize/alloc"] fiat_backend = ["fiat-crypto"] # The SIMD backend uses parallel formulas, using either AVX2 or AVX512-IFMA. simd_backend = ["nightly", "packed_simd"] + +# Target backend overrides for fiat_backend +fiat_64 = [] +fiat_32 = [] + +# Target backend overrides for the default serial backend +serial_64 = [] +serial_32 = [] \ No newline at end of file diff --git a/src/backend/serial/mod.rs b/src/backend/serial/mod.rs index 3569b5043..b0d8502ab 100644 --- a/src/backend/serial/mod.rs +++ b/src/backend/serial/mod.rs @@ -21,7 +21,8 @@ use cfg_if::cfg_if; cfg_if! { - if #[cfg(feature = "fiat_backend")] { + + if #[cfg(any(feature = "fiat_backend", feature = "fiat_64", feature = "fiat_32"))] { #[cfg(all(feature = "fiat_64", feature = "fiat_32"))] compile_error!("Overrides fiat_64 or fiat_32 are mutually exclusive - cannot enable both.");