@@ -159,30 +159,27 @@ pub(super) fn verify_sequential_avx2_vaes(
159159 output_3 = _mm256_xor_si256 ( output_3, keys_256[ 10 ] ) ;
160160
161161 for _ in 0 ..checkpoint_iterations / 2 {
162- // TODO: Shouldn't be unsafe: https://github.com/rust-lang/rust/issues/141718
163- unsafe {
164- for i in 1 ..10 {
165- input_0 = _mm256_aesenc_epi128 ( input_0, keys_256[ i] ) ;
166- input_1 = _mm256_aesenc_epi128 ( input_1, keys_256[ i] ) ;
167- input_2 = _mm256_aesenc_epi128 ( input_2, keys_256[ i] ) ;
168- input_3 = _mm256_aesenc_epi128 ( input_3, keys_256[ i] ) ;
169-
170- output_0 = _mm256_aesdec_epi128 ( output_0, inv_keys_256[ i] ) ;
171- output_1 = _mm256_aesdec_epi128 ( output_1, inv_keys_256[ i] ) ;
172- output_2 = _mm256_aesdec_epi128 ( output_2, inv_keys_256[ i] ) ;
173- output_3 = _mm256_aesdec_epi128 ( output_3, inv_keys_256[ i] ) ;
174- }
175-
176- input_0 = _mm256_aesenclast_epi128 ( input_0, xor_key_256) ;
177- input_1 = _mm256_aesenclast_epi128 ( input_1, xor_key_256) ;
178- input_2 = _mm256_aesenclast_epi128 ( input_2, xor_key_256) ;
179- input_3 = _mm256_aesenclast_epi128 ( input_3, xor_key_256) ;
180-
181- output_0 = _mm256_aesdeclast_epi128 ( output_0, xor_key_256) ;
182- output_1 = _mm256_aesdeclast_epi128 ( output_1, xor_key_256) ;
183- output_2 = _mm256_aesdeclast_epi128 ( output_2, xor_key_256) ;
184- output_3 = _mm256_aesdeclast_epi128 ( output_3, xor_key_256) ;
162+ for i in 1 ..10 {
163+ input_0 = _mm256_aesenc_epi128 ( input_0, keys_256[ i] ) ;
164+ input_1 = _mm256_aesenc_epi128 ( input_1, keys_256[ i] ) ;
165+ input_2 = _mm256_aesenc_epi128 ( input_2, keys_256[ i] ) ;
166+ input_3 = _mm256_aesenc_epi128 ( input_3, keys_256[ i] ) ;
167+
168+ output_0 = _mm256_aesdec_epi128 ( output_0, inv_keys_256[ i] ) ;
169+ output_1 = _mm256_aesdec_epi128 ( output_1, inv_keys_256[ i] ) ;
170+ output_2 = _mm256_aesdec_epi128 ( output_2, inv_keys_256[ i] ) ;
171+ output_3 = _mm256_aesdec_epi128 ( output_3, inv_keys_256[ i] ) ;
185172 }
173+
174+ input_0 = _mm256_aesenclast_epi128 ( input_0, xor_key_256) ;
175+ input_1 = _mm256_aesenclast_epi128 ( input_1, xor_key_256) ;
176+ input_2 = _mm256_aesenclast_epi128 ( input_2, xor_key_256) ;
177+ input_3 = _mm256_aesenclast_epi128 ( input_3, xor_key_256) ;
178+
179+ output_0 = _mm256_aesdeclast_epi128 ( output_0, xor_key_256) ;
180+ output_1 = _mm256_aesdeclast_epi128 ( output_1, xor_key_256) ;
181+ output_2 = _mm256_aesdeclast_epi128 ( output_2, xor_key_256) ;
182+ output_3 = _mm256_aesdeclast_epi128 ( output_3, xor_key_256) ;
186183 }
187184
188185 // Code below is a more efficient version of this:
@@ -264,22 +261,19 @@ pub(super) fn verify_sequential_avx512f_vaes(
264261 output_1 = _mm512_xor_si512 ( output_1, keys_512[ 10 ] ) ;
265262
266263 for _ in 0 ..checkpoint_iterations / 2 {
267- // TODO: Shouldn't be unsafe: https://github.com/rust-lang/rust/issues/141718
268- unsafe {
269- for i in 1 ..10 {
270- input_0 = _mm512_aesenc_epi128 ( input_0, keys_512[ i] ) ;
271- input_1 = _mm512_aesenc_epi128 ( input_1, keys_512[ i] ) ;
264+ for i in 1 ..10 {
265+ input_0 = _mm512_aesenc_epi128 ( input_0, keys_512[ i] ) ;
266+ input_1 = _mm512_aesenc_epi128 ( input_1, keys_512[ i] ) ;
272267
273- output_0 = _mm512_aesdec_epi128 ( output_0, inv_keys_512[ i] ) ;
274- output_1 = _mm512_aesdec_epi128 ( output_1, inv_keys_512[ i] ) ;
275- }
268+ output_0 = _mm512_aesdec_epi128 ( output_0, inv_keys_512[ i] ) ;
269+ output_1 = _mm512_aesdec_epi128 ( output_1, inv_keys_512[ i] ) ;
270+ }
276271
277- input_0 = _mm512_aesenclast_epi128 ( input_0, xor_key_512) ;
278- input_1 = _mm512_aesenclast_epi128 ( input_1, xor_key_512) ;
272+ input_0 = _mm512_aesenclast_epi128 ( input_0, xor_key_512) ;
273+ input_1 = _mm512_aesenclast_epi128 ( input_1, xor_key_512) ;
279274
280- output_0 = _mm512_aesdeclast_epi128 ( output_0, xor_key_512) ;
281- output_1 = _mm512_aesdeclast_epi128 ( output_1, xor_key_512) ;
282- }
275+ output_0 = _mm512_aesdeclast_epi128 ( output_0, xor_key_512) ;
276+ output_1 = _mm512_aesdeclast_epi128 ( output_1, xor_key_512) ;
283277 }
284278
285279 // Code below is a more efficient version of this:
0 commit comments