aes 0.9.4

Pure Rust implementation of the Advanced Encryption Standard (a.k.a. Rijndael)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Block;
use core::arch::aarch64::{uint8x16_t, vld1q_u8, vst1q_u8};

#[inline]
#[target_feature(enable = "neon")]
pub(super) fn load_block(block: &Block) -> uint8x16_t {
    // SAFETY: `vld1q_u8` supports unaligned loads
    unsafe { vld1q_u8(block.as_ptr()) }
}

#[inline]
#[target_feature(enable = "neon")]
pub(super) fn store_block(dst: &mut Block, block: uint8x16_t) {
    // SAFETY: `vst1q_u8` supports unaligned stores
    unsafe { vst1q_u8(dst.as_mut_ptr(), block) }
}