@@ -213,7 +213,7 @@ pub trait DeoxysBcType: deoxys_bc::DeoxysBcInternal {
213213
214214 for k in & keys[ 1 ..] {
215215 #[ cfg( target_feature = "aes" ) ]
216- aes:: round :: cipher ( block. into ( ) , k. into ( ) ) ;
216+ aes:: hazmat :: cipher_round ( block. into ( ) , k. into ( ) ) ;
217217
218218 #[ cfg( not( target_feature = "aes" ) ) ]
219219 aes_ref:: encrypt_round ( block, k) ;
@@ -231,26 +231,15 @@ pub trait DeoxysBcType: deoxys_bc::DeoxysBcInternal {
231231 * b ^= k;
232232 }
233233
234- // Will be replaced with the aes crate
235- unsafe {
236- use core:: arch:: x86_64:: * ;
237- let b = _mm_loadu_si128 ( block. as_ptr ( ) as * const __m128i ) ;
238- let out = _mm_aesimc_si128 ( b) ;
239- _mm_storeu_si128 ( block. as_mut_ptr ( ) as * mut __m128i , out) ;
240- }
234+ aes:: hazmat:: inv_mix_columns ( block. into ( ) ) ;
241235
242236 for k in keys[ ..r - 1 ] . iter_mut ( ) {
243237 // Will be replaced with the aes crate
244- unsafe {
245- use core:: arch:: x86_64:: * ;
246- let k2 = _mm_loadu_si128 ( k. as_ptr ( ) as * const __m128i ) ;
247- let out = _mm_aesimc_si128 ( k2) ;
248- _mm_storeu_si128 ( k. as_mut_ptr ( ) as * mut __m128i , out) ;
249- }
238+ aes:: hazmat:: inv_mix_columns ( k. into ( ) ) ;
250239 }
251240
252241 for k in keys[ ..r - 1 ] . iter ( ) . rev ( ) {
253- aes:: round :: equiv_inv_cipher ( block. into ( ) , k. into ( ) ) ;
242+ aes:: hazmat :: equiv_inv_cipher_round ( block. into ( ) , k. into ( ) ) ;
254243 }
255244
256245 aes_ref:: mix_columns ( block, & aes_ref:: MIX_COLUMNS_MATRIX ) ;
0 commit comments