X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fcrypto_native%2Faes.h;h=d1b3104d981c1072ddc8f49a8b0bd4b3ed966071;hb=78b58f65f1c94d7a5efbf191b4a6e8b6cc12ae66;hp=d09239130345b6fbc4b1d30f9e088c8605047aa7;hpb=27d12d30cdf5af37fad0e14db0877ca716af2115;p=vpp.git diff --git a/src/plugins/crypto_native/aes.h b/src/plugins/crypto_native/aes.h index d0923913034..d1b3104d981 100644 --- a/src/plugins/crypto_native/aes.h +++ b/src/plugins/crypto_native/aes.h @@ -196,23 +196,20 @@ aes_key_expand (__m128i * k, u8 * key, aes_key_size_t ks) static_always_inline void -aes_key_enc_to_dec (__m128i * k, aes_key_size_t ks) +aes_key_enc_to_dec (__m128i * ke, __m128i * kd, aes_key_size_t ks) { int rounds = AES_KEY_ROUNDS (ks); - __m128i r; - r = k[rounds]; - k[rounds] = k[0]; - k[0] = r; + kd[rounds] = ke[0]; + kd[0] = ke[rounds]; for (int i = 1; i < (rounds / 2); i++) { - r = k[rounds - i]; - k[rounds - i] = _mm_aesimc_si128 (k[i]); - k[i] = _mm_aesimc_si128 (r); + kd[rounds - i] = _mm_aesimc_si128 (ke[i]); + kd[i] = _mm_aesimc_si128 (ke[rounds - i]); } - k[rounds / 2] = _mm_aesimc_si128 (k[rounds / 2]); + kd[rounds / 2] = _mm_aesimc_si128 (ke[rounds / 2]); } #endif /* __aesni_h__ */