diff --git a/Cargo.toml b/Cargo.toml index 6eb7361b6..7b70857c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,4 +63,4 @@ alloc = ["zeroize/alloc"] # fiat-crypto backend with formally-verified field arithmetic fiat_backend = ["fiat-crypto"] # The SIMD backend uses parallel formulas, using either AVX2 or AVX512-IFMA. -simd_backend = ["nightly", "packed_simd"] +simd_backend = ["alloc", "nightly", "packed_simd"] diff --git a/src/lib.rs b/src/lib.rs index e0067dc9e..52d1a1c50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,8 @@ // External dependencies: //------------------------------------------------------------------------ -#[cfg(all(feature = "alloc", not(feature = "std")))] +#[cfg(feature = "alloc")] +#[allow(unused_imports)] #[macro_use] extern crate alloc; diff --git a/src/montgomery.rs b/src/montgomery.rs index 7e8e0df48..53c76fb14 100644 --- a/src/montgomery.rs +++ b/src/montgomery.rs @@ -470,9 +470,9 @@ mod test { ]; #[test] - #[cfg(feature = "std")] // Vec + #[cfg(feature = "alloc")] // Vec fn montgomery_elligator_correct() { - let bytes: std::vec::Vec = (0u8..32u8).collect(); + let bytes: alloc::vec::Vec = (0u8..32u8).collect(); let bits_in: [u8; 32] = (&bytes[..]).try_into().expect("Range invariant broken"); let fe = FieldElement::from_bytes(&bits_in);