@@ -47,6 +47,7 @@ impl AesKey {
4747
4848 #[ target_feature( enable = "aes,neon" ) ]
4949 unsafe fn _ctr ( & self , initial_counter : & [ u8 ; 16 ] , cipher_inout : & mut [ u8 ] ) {
50+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
5051 unsafe {
5152 // counter and inc are big endian, so must be vrev32q_u8'd before use
5253 let counter = vld1q_u8 ( initial_counter. as_ptr ( ) . cast ( ) ) ;
@@ -248,6 +249,7 @@ fn sub_word(w: u32) -> u32 {
248249
249250#[ target_feature( enable = "aes" ) ]
250251unsafe fn _sub_word ( w : u32 ) -> u32 {
252+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
251253 unsafe {
252254 // we have the `aese` instruction, which is
253255 // `sub_word(shift_rows(w), S)`. however, fortunately
@@ -268,6 +270,7 @@ const RCON: [u32; 10] = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0
268270
269271#[ target_feature( enable = "aes" ) ]
270272unsafe fn aes128_block ( round_keys : & [ uint8x16_t ; 11 ] , block_inout : & mut [ u8 ] ) {
273+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
271274 unsafe {
272275 let block = vld1q_u8 ( block_inout. as_ptr ( ) as * const _ ) ;
273276 let block = _aes128_block ( round_keys, block) ;
@@ -278,6 +281,7 @@ unsafe fn aes128_block(round_keys: &[uint8x16_t; 11], block_inout: &mut [u8]) {
278281#[ target_feature( enable = "aes" ) ]
279282#[ inline]
280283unsafe fn _aes128_block ( round_keys : & [ uint8x16_t ; 11 ] , block : uint8x16_t ) -> uint8x16_t {
284+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
281285 unsafe {
282286 let block = vaeseq_u8 ( block, round_keys[ 0 ] ) ;
283287 let block = vaesmcq_u8 ( block) ;
@@ -346,6 +350,7 @@ unsafe fn _aes128_8_blocks(
346350 uint8x16_t ,
347351 uint8x16_t ,
348352) {
353+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
349354 unsafe {
350355 round_8 ! ( b0, b1, b2, b3, b4, b5, b6, b7, round_keys[ 0 ] ) ;
351356 round_8 ! ( b0, b1, b2, b3, b4, b5, b6, b7, round_keys[ 1 ] ) ;
@@ -380,6 +385,7 @@ unsafe fn _aes128_8_blocks(
380385
381386#[ target_feature( enable = "aes" ) ]
382387unsafe fn aes256_block ( round_keys : & [ uint8x16_t ; 15 ] , block_inout : & mut [ u8 ] ) {
388+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
383389 unsafe {
384390 let block = vld1q_u8 ( block_inout. as_ptr ( ) as * const _ ) ;
385391 let block = _aes256_block ( round_keys, block) ;
@@ -390,6 +396,7 @@ unsafe fn aes256_block(round_keys: &[uint8x16_t; 15], block_inout: &mut [u8]) {
390396#[ target_feature( enable = "aes" ) ]
391397#[ inline]
392398unsafe fn _aes256_block ( round_keys : & [ uint8x16_t ; 15 ] , block : uint8x16_t ) -> uint8x16_t {
399+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
393400 unsafe {
394401 let block = vaeseq_u8 ( block, round_keys[ 0 ] ) ;
395402 let block = vaesmcq_u8 ( block) ;
@@ -444,6 +451,7 @@ unsafe fn _aes256_8_blocks(
444451 uint8x16_t ,
445452 uint8x16_t ,
446453) {
454+ // SAFETY: intrinsics. see [crate::low::inline_assembly_safety#safety-of-intrinsics] for safety info.
447455 unsafe {
448456 round_8 ! ( b0, b1, b2, b3, b4, b5, b6, b7, round_keys[ 0 ] ) ;
449457 round_8 ! ( b0, b1, b2, b3, b4, b5, b6, b7, round_keys[ 1 ] ) ;
0 commit comments