diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-17 23:25:52 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-17 23:25:52 +0300 |
commit | 44d58e0a10c7dfdb33899fa98c0eea790e0b90ce (patch) | |
tree | 646541b156ffdd88bbaa4f1fa860aed465dfce60 /src/c/aes192.c | |
parent | refactoring (diff) | |
download | aes-tools-44d58e0a10c7dfdb33899fa98c0eea790e0b90ce.tar.gz aes-tools-44d58e0a10c7dfdb33899fa98c0eea790e0b90ce.zip |
factoring out AES-specific stuff
Diffstat (limited to 'src/c/aes192.c')
-rw-r--r-- | src/c/aes192.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/c/aes192.c b/src/c/aes192.c index 6e97637..702ee5e 100644 --- a/src/c/aes192.c +++ b/src/c/aes192.c @@ -11,8 +11,8 @@ #include <emmintrin.h> #include <wmmintrin.h> -AesNI_Block128 __fastcall aesni_aes192_encrypt_block_( - AesNI_Block128 plaintext, +AesNI_Aes_Block __fastcall aesni_aes192_encrypt_block_( + AesNI_Aes_Block plaintext, const AesNI_Aes192_RoundKeys* encryption_keys) { plaintext = _mm_xor_si128(plaintext, encryption_keys->keys[0]); @@ -30,8 +30,8 @@ AesNI_Block128 __fastcall aesni_aes192_encrypt_block_( return _mm_aesenclast_si128(plaintext, encryption_keys->keys[12]); } -AesNI_Block128 __fastcall aesni_aes192_decrypt_block_( - AesNI_Block128 ciphertext, +AesNI_Aes_Block __fastcall aesni_aes192_decrypt_block_( + AesNI_Aes_Block ciphertext, const AesNI_Aes192_RoundKeys* decryption_keys) { ciphertext = _mm_xor_si128(ciphertext, decryption_keys->keys[0]); @@ -50,11 +50,11 @@ AesNI_Block128 __fastcall aesni_aes192_decrypt_block_( } static void __fastcall aesni_aes192_expand_key_assist( - AesNI_Block128* prev_lo, - AesNI_Block128* prev_hi, - AesNI_Block128 hwgen) + AesNI_Aes_Block* prev_lo, + AesNI_Aes_Block* prev_hi, + AesNI_Aes_Block hwgen) { - AesNI_Block128 tmp = *prev_lo; + AesNI_Aes_Block tmp = *prev_lo; tmp = _mm_slli_si128(tmp, 4); *prev_lo = _mm_xor_si128(*prev_lo, tmp); @@ -75,8 +75,8 @@ static void __fastcall aesni_aes192_expand_key_assist( } void __fastcall aesni_aes192_expand_key_( - AesNI_Block128 key_lo, - AesNI_Block128 key_hi, + AesNI_Aes_Block key_lo, + AesNI_Aes_Block key_hi, AesNI_Aes192_RoundKeys* encryption_keys) { encryption_keys->keys[0] = key_lo; |