Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aes: use core::arch::aarch64::vst1q_u8 intrinsic on armv8 #280

Merged
merged 1 commit into from Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions aes/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions aes/src/armv8.rs
Expand Up @@ -172,17 +172,9 @@ define_aes_impl!(Aes128, Aes128Enc, Aes128Dec, U16, 11, "AES-128");
define_aes_impl!(Aes192, Aes192Enc, Aes192Dec, U24, 13, "AES-192");
define_aes_impl!(Aes256, Aes256Enc, Aes256Dec, U32, 15, "AES-256");

// TODO(tarcieri): use `stdarch` intrinsic for this when it becomes available
#[inline(always)]
unsafe fn vst1q_u8(dst: *mut u8, src: uint8x16_t) {
dst.copy_from_nonoverlapping(&src as *const _ as *const u8, 16);
}

#[cfg(test)]
mod tests {
use super::{
decrypt, decrypt8, encrypt, encrypt8, expand_key, inv_expanded_keys, vst1q_u8, ParBlocks,
};
use super::{decrypt, decrypt8, encrypt, encrypt8, expand_key, inv_expanded_keys, ParBlocks};
use core::{arch::aarch64::*, convert::TryInto};
use hex_literal::hex;

Expand Down
1 change: 0 additions & 1 deletion aes/src/armv8/decrypt.rs
@@ -1,6 +1,5 @@
//! AES decryption support.

use super::vst1q_u8;
use crate::{Block, ParBlocks};
use core::arch::aarch64::*;

Expand Down
1 change: 0 additions & 1 deletion aes/src/armv8/encrypt.rs
@@ -1,6 +1,5 @@
//! AES encryption support

use super::vst1q_u8;
use crate::{Block, ParBlocks};
use core::arch::aarch64::*;

Expand Down
1 change: 0 additions & 1 deletion aes/src/armv8/hazmat.rs
Expand Up @@ -4,7 +4,6 @@
//! implementations in this crate, but instead provides raw AES-NI accelerated
//! access to the AES round function gated under the `hazmat` crate feature.

use super::vst1q_u8;
use crate::{Block, ParBlocks};
use core::arch::aarch64::*;

Expand Down