Skip to content

Commit

Permalink
Allow overriding the u32 and u64 backend selection via features
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Dec 7, 2022
1 parent 84365f7 commit 3d10889
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
3 changes: 2 additions & 1 deletion src/backend/serial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 3d10889

Please sign in to comment.