diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-30 05:13:44 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-30 05:13:44 +0300 |
commit | 1109190cc2edd86f12cdd16847f3e80e48dccc50 (patch) | |
tree | a688b89f7e4ede0defaeb79ffb8e8a99ece5a395 /include/aesni/raw.h | |
parent | support AES-{128,192}-cbc (diff) | |
download | aes-tools-1109190cc2edd86f12cdd16847f3e80e48dccc50.tar.gz aes-tools-1109190cc2edd86f12cdd16847f3e80e48dccc50.zip |
detach key expansion routines
Block encryption/decryption routines now don't expand key schedules on
each call.
Diffstat (limited to 'include/aesni/raw.h')
-rw-r--r-- | include/aesni/raw.h | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/include/aesni/raw.h b/include/aesni/raw.h index ffda8d2..db342c7 100644 --- a/include/aesni/raw.h +++ b/include/aesni/raw.h @@ -10,58 +10,73 @@ #include "data.h" +void __fastcall raw_aes128_expand_key_schedule( + AesBlock128 key, + Aes128KeySchedule* key_schedule); +void __fastcall raw_aes128_invert_key_schedule( + Aes128KeySchedule* key_schedule, + Aes128KeySchedule* inverted_schedule); + AesBlock128 __fastcall raw_aes128ecb_encrypt( AesBlock128 plain, - AesBlock128 key); + Aes128KeySchedule* key_schedule); AesBlock128 __fastcall raw_aes128ecb_decrypt( AesBlock128 cypher, - AesBlock128 key); + Aes128KeySchedule* inverted_schedule); AesBlock128 __fastcall raw_aes128cbc_encrypt( AesBlock128 plain, - AesBlock128 key, + Aes128KeySchedule* key_schedule, AesBlock128* iv); AesBlock128 __fastcall raw_aes128cbc_decrypt( AesBlock128 cypher, - AesBlock128 key, + Aes128KeySchedule* inverted_schedule, AesBlock128* iv); +void __fastcall raw_aes192_expand_key_schedule( + AesBlock128 key_lo, + AesBlock128 key_hi, + Aes192KeySchedule* key_schedule); +void __fastcall raw_aes192_invert_key_schedule( + Aes192KeySchedule* key_schedule, + Aes192KeySchedule* inverted_schedule); + AesBlock128 __fastcall raw_aes192ecb_encrypt( AesBlock128 plain, - AesBlock128 key_lo, - AesBlock128 key_hi); + Aes192KeySchedule* key_schedule); AesBlock128 __fastcall raw_aes192ecb_decrypt( AesBlock128 cypher, - AesBlock128 key_lo, - AesBlock128 key_hi); + Aes192KeySchedule* inverted_schedule); AesBlock128 __fastcall raw_aes192cbc_encrypt( AesBlock128 plain, - AesBlock128 key_lo, - AesBlock128 key_hi, + Aes192KeySchedule* key_schedule, AesBlock128 *iv); AesBlock128 __fastcall raw_aes192cbc_decrypt( AesBlock128 cypher, + Aes192KeySchedule* inverted_schedule, + AesBlock128 *iv); + +void __fastcall raw_aes256_expand_key_schedule( AesBlock128 key_lo, AesBlock128 key_hi, - AesBlock128 *iv); + Aes256KeySchedule* key_schedule); +void __fastcall raw_aes256_invert_key_schedule( + Aes256KeySchedule* key_schedule, + Aes256KeySchedule* inverted_schedule); AesBlock128 __fastcall raw_aes256ecb_encrypt( AesBlock128 plain, - AesBlock128 key_lo, - AesBlock128 key_hi); + Aes256KeySchedule* key_schedule); AesBlock128 __fastcall raw_aes256ecb_decrypt( AesBlock128 cypher, - AesBlock128 key_lo, - AesBlock128 key_hi); + Aes256KeySchedule* inverted_schedule); AesBlock128 __fastcall raw_aes256cbc_encrypt( AesBlock128 plain, - AesBlock128 key_lo, - AesBlock128 key_hi, + Aes256KeySchedule* key_schedule, AesBlock128 *iv); AesBlock128 __fastcall raw_aes256cbc_decrypt( AesBlock128 cypher, - AesBlock128 key_lo, - AesBlock128 key_hi, + Aes256KeySchedule* inverted_schedule, AesBlock128 *iv); |