diff --git a/aes/CHANGELOG.md b/aes/CHANGELOG.md index 80536929..fa8ae692 100644 --- a/aes/CHANGELOG.md +++ b/aes/CHANGELOG.md @@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed +- Use the `aes` target feature instead of `crypto` on ARMv8. ([#279]) - Bump `ctr` dependency to v0.8 ([#275]) [#275]: https://github.com/RustCrypto/block-ciphers/pull/275 +[#279]: https://github.com/RustCrypto/block-ciphers/pull/279 ## 0.7.4 (2021-06-01) ### Added diff --git a/aes/src/armv8/decrypt.rs b/aes/src/armv8/decrypt.rs index a78bdf70..d05c1c9d 100644 --- a/aes/src/armv8/decrypt.rs +++ b/aes/src/armv8/decrypt.rs @@ -5,7 +5,7 @@ use crate::{Block, ParBlocks}; use core::arch::aarch64::*; /// Perform AES decryption using the given expanded keys. -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] #[target_feature(enable = "neon")] pub(super) unsafe fn decrypt(expanded_keys: &[uint8x16_t; N], block: &mut Block) { let rounds = N - 1; @@ -31,7 +31,7 @@ pub(super) unsafe fn decrypt(expanded_keys: &[uint8x16_t; N], bl } /// Perform parallel AES decryption 8-blocks-at-a-time using the given expanded keys. -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] #[target_feature(enable = "neon")] pub(super) unsafe fn decrypt8( expanded_keys: &[uint8x16_t; N], diff --git a/aes/src/armv8/encrypt.rs b/aes/src/armv8/encrypt.rs index a9452989..162c63ec 100644 --- a/aes/src/armv8/encrypt.rs +++ b/aes/src/armv8/encrypt.rs @@ -5,7 +5,7 @@ use crate::{Block, ParBlocks}; use core::arch::aarch64::*; /// Perform AES encryption using the given expanded keys. -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] #[target_feature(enable = "neon")] pub(super) unsafe fn encrypt(expanded_keys: &[uint8x16_t; N], block: &mut Block) { let rounds = N - 1; @@ -31,7 +31,7 @@ pub(super) unsafe fn encrypt(expanded_keys: &[uint8x16_t; N], bl } /// Perform parallel AES encryption 8-blocks-at-a-time using the given expanded keys. -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] #[target_feature(enable = "neon")] pub(super) unsafe fn encrypt8( expanded_keys: &[uint8x16_t; N], diff --git a/aes/src/armv8/hazmat.rs b/aes/src/armv8/hazmat.rs index c08893d7..ce8b160a 100644 --- a/aes/src/armv8/hazmat.rs +++ b/aes/src/armv8/hazmat.rs @@ -10,7 +10,7 @@ use core::arch::aarch64::*; /// AES cipher (encrypt) round function. #[allow(clippy::cast_ptr_alignment)] -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] pub(crate) unsafe fn cipher_round(block: &mut Block, round_key: &Block) { let b = vld1q_u8(block.as_ptr()); let k = vld1q_u8(round_key.as_ptr()); @@ -29,7 +29,7 @@ pub(crate) unsafe fn cipher_round(block: &mut Block, round_key: &Block) { /// AES cipher (encrypt) round function: parallel version. #[allow(clippy::cast_ptr_alignment)] -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] pub(crate) unsafe fn cipher_round_par(blocks: &mut ParBlocks, round_keys: &ParBlocks) { for i in 0..8 { let mut state = vld1q_u8(blocks[i].as_ptr()); @@ -49,7 +49,7 @@ pub(crate) unsafe fn cipher_round_par(blocks: &mut ParBlocks, round_keys: &ParBl /// AES equivalent inverse cipher (decrypt) round function. #[allow(clippy::cast_ptr_alignment)] -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] pub(crate) unsafe fn equiv_inv_cipher_round(block: &mut Block, round_key: &Block) { let b = vld1q_u8(block.as_ptr()); let k = vld1q_u8(round_key.as_ptr()); @@ -68,7 +68,7 @@ pub(crate) unsafe fn equiv_inv_cipher_round(block: &mut Block, round_key: &Block /// AES equivalent inverse cipher (decrypt) round function: parallel version. #[allow(clippy::cast_ptr_alignment)] -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] pub(crate) unsafe fn equiv_inv_cipher_round_par(blocks: &mut ParBlocks, round_keys: &ParBlocks) { for i in 0..8 { let mut state = vld1q_u8(blocks[i].as_ptr()); @@ -88,7 +88,7 @@ pub(crate) unsafe fn equiv_inv_cipher_round_par(blocks: &mut ParBlocks, round_ke /// AES mix columns function. #[allow(clippy::cast_ptr_alignment)] -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] pub(crate) unsafe fn mix_columns(block: &mut Block) { let b = vld1q_u8(block.as_ptr()); let out = vaesmcq_u8(b); @@ -97,7 +97,7 @@ pub(crate) unsafe fn mix_columns(block: &mut Block) { /// AES inverse mix columns function. #[allow(clippy::cast_ptr_alignment)] -#[target_feature(enable = "crypto")] +#[target_feature(enable = "aes")] pub(crate) unsafe fn inv_mix_columns(block: &mut Block) { let b = vld1q_u8(block.as_ptr()); let out = vaesimcq_u8(b); diff --git a/aes/src/lib.rs b/aes/src/lib.rs index 18122be0..f33183c1 100644 --- a/aes/src/lib.rs +++ b/aes/src/lib.rs @@ -26,7 +26,7 @@ //! `armv8` crate feature. //! //! On Linux and macOS, when the `armv8` feature is enabled support for AES -//! intrinsics is autodetected at runtime. On other platforms the `crypto` +//! intrinsics is autodetected at runtime. On other platforms the `aes` //! target feature must be enabled via RUSTFLAGS. //! //! ## `x86`/`x86_64` intrinsics (AES-NI)