aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/aes/aes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/aes/aes.h')
-rw-r--r--include/aes/aes.h560
1 files changed, 280 insertions, 280 deletions
diff --git a/include/aes/aes.h b/include/aes/aes.h
index ea859a3..62a301b 100644
--- a/include/aes/aes.h
+++ b/include/aes/aes.h
@@ -19,415 +19,415 @@ extern "C"
{
#endif
-typedef AesNI_Block128 AesNI_AES_Block;
-typedef AesNI_AES_Block AesNI_AES128_Block;
-typedef AesNI_AES_Block AesNI_AES192_Block;
-typedef AesNI_AES_Block AesNI_AES256_Block;
+typedef AES_Block128 AES_AES_Block;
+typedef AES_AES_Block AES_AES128_Block;
+typedef AES_AES_Block AES_AES192_Block;
+typedef AES_AES_Block AES_AES256_Block;
typedef struct
{
- AesNI_AES_Block key;
+ AES_AES_Block key;
}
-AesNI_AES128_Key;
+AES_AES128_Key;
typedef struct
{
- AesNI_AES_Block hi;
- AesNI_AES_Block lo;
+ AES_AES_Block hi;
+ AES_AES_Block lo;
}
-AesNI_AES192_Key;
+AES_AES192_Key;
typedef struct
{
- AesNI_AES_Block hi;
- AesNI_AES_Block lo;
+ AES_AES_Block hi;
+ AES_AES_Block lo;
}
-AesNI_AES256_Key;
+AES_AES256_Key;
-static __inline void aesni_AES_make_block(AesNI_AES_Block* dest, int hi3, int hi2, int lo1, int lo0)
+static __inline void aes_AES_make_block(AES_AES_Block* dest, int hi3, int hi2, int lo1, int lo0)
{
- *dest = aesni_make_block128(hi3, hi2, lo1, lo0);
+ *dest = aes_make_block128(hi3, hi2, lo1, lo0);
}
-static __inline void aesni_AES128_make_block(AesNI_AES128_Block* dest, int hi3, int hi2, int lo1, int lo0)
+static __inline void aes_AES128_make_block(AES_AES128_Block* dest, int hi3, int hi2, int lo1, int lo0)
{
- aesni_AES_make_block(dest, hi3, hi2, lo1, lo0);
+ aes_AES_make_block(dest, hi3, hi2, lo1, lo0);
}
-static __inline void aesni_AES192_make_block(AesNI_AES192_Block* dest, int hi3, int hi2, int lo1, int lo0)
+static __inline void aes_AES192_make_block(AES_AES192_Block* dest, int hi3, int hi2, int lo1, int lo0)
{
- aesni_AES_make_block(dest, hi3, hi2, lo1, lo0);
+ aes_AES_make_block(dest, hi3, hi2, lo1, lo0);
}
-static __inline void aesni_AES256_make_block(AesNI_AES256_Block* dest, int hi3, int hi2, int lo1, int lo0)
+static __inline void aes_AES256_make_block(AES_AES256_Block* dest, int hi3, int hi2, int lo1, int lo0)
{
- aesni_AES_make_block(dest, hi3, hi2, lo1, lo0);
+ aes_AES_make_block(dest, hi3, hi2, lo1, lo0);
}
-static __inline void aesni_AES128_make_key(AesNI_AES128_Key* dest, int hi3, int hi2, int lo1, int lo0)
+static __inline void aes_AES128_make_key(AES_AES128_Key* dest, int hi3, int hi2, int lo1, int lo0)
{
- aesni_AES_make_block(&dest->key, hi3, hi2, lo1, lo0);
+ aes_AES_make_block(&dest->key, hi3, hi2, lo1, lo0);
}
-static __inline void aesni_AES192_make_key(AesNI_AES192_Key* dest, int hi5, int hi4, int lo3, int lo2, int lo1, int lo0)
+static __inline void aes_AES192_make_key(AES_AES192_Key* dest, int hi5, int hi4, int lo3, int lo2, int lo1, int lo0)
{
- aesni_AES_make_block(&dest->hi, 0, 0, hi5, hi4);
- aesni_AES_make_block(&dest->lo, lo3, lo2, lo1, lo0);
+ aes_AES_make_block(&dest->hi, 0, 0, hi5, hi4);
+ aes_AES_make_block(&dest->lo, lo3, lo2, lo1, lo0);
}
-static __inline void aesni_AES256_make_key(AesNI_AES256_Key* dest, int hi7, int hi6, int hi5, int hi4, int lo3, int lo2, int lo1, int lo0)
+static __inline void aes_AES256_make_key(AES_AES256_Key* dest, int hi7, int hi6, int hi5, int hi4, int lo3, int lo2, int lo1, int lo0)
{
- aesni_AES_make_block(&dest->hi, hi7, hi6, hi5, hi4);
- aesni_AES_make_block(&dest->lo, lo3, lo2, lo1, lo0);
+ aes_AES_make_block(&dest->hi, hi7, hi6, hi5, hi4);
+ aes_AES_make_block(&dest->lo, lo3, lo2, lo1, lo0);
}
-typedef struct { char str[33]; } AesNI_AES_BlockString;
-typedef AesNI_AES_BlockString AesNI_AES128_BlockString;
-typedef AesNI_AES_BlockString AesNI_AES192_BlockString;
-typedef AesNI_AES_BlockString AesNI_AES256_BlockString;
+typedef struct { char str[33]; } AES_AES_BlockString;
+typedef AES_AES_BlockString AES_AES128_BlockString;
+typedef AES_AES_BlockString AES_AES192_BlockString;
+typedef AES_AES_BlockString AES_AES256_BlockString;
-typedef struct { char str[49]; } AesNI_AES_BlockMatrixString;
-typedef AesNI_AES_BlockMatrixString AesNI_AES128_BlockMatrixString;
-typedef AesNI_AES_BlockMatrixString AesNI_AES192_BlockMatrixString;
-typedef AesNI_AES_BlockMatrixString AesNI_AES256_BlockMatrixString;
+typedef struct { char str[49]; } AES_AES_BlockMatrixString;
+typedef AES_AES_BlockMatrixString AES_AES128_BlockMatrixString;
+typedef AES_AES_BlockMatrixString AES_AES192_BlockMatrixString;
+typedef AES_AES_BlockMatrixString AES_AES256_BlockMatrixString;
-AesNI_StatusCode aesni_AES_format_block(
- AesNI_AES_BlockString*,
- const AesNI_AES_Block*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES_format_block(
+ AES_AES_BlockString*,
+ const AES_AES_Block*,
+ AES_ErrorDetails*);
-static __inline AesNI_StatusCode aesni_AES128_format_block(
- AesNI_AES128_BlockString* dest,
- const AesNI_AES128_Block* src,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES128_format_block(
+ AES_AES128_BlockString* dest,
+ const AES_AES128_Block* src,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_format_block(dest, src, err_details);
+ return aes_AES_format_block(dest, src, err_details);
}
-static __inline AesNI_StatusCode aesni_AES192_format_block(
- AesNI_AES192_BlockString* dest,
- const AesNI_AES192_Block* src,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES192_format_block(
+ AES_AES192_BlockString* dest,
+ const AES_AES192_Block* src,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_format_block(dest, src, err_details);
+ return aes_AES_format_block(dest, src, err_details);
}
-static __inline AesNI_StatusCode aesni_AES256_format_block(
- AesNI_AES256_BlockString* dest,
- const AesNI_AES256_Block* src,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES256_format_block(
+ AES_AES256_BlockString* dest,
+ const AES_AES256_Block* src,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_format_block(dest, src, err_details);
+ return aes_AES_format_block(dest, src, err_details);
}
-AesNI_StatusCode aesni_AES_format_block_as_matrix(
- AesNI_AES_BlockMatrixString*,
- const AesNI_AES_Block*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES_format_block_as_matrix(
+ AES_AES_BlockMatrixString*,
+ const AES_AES_Block*,
+ AES_ErrorDetails*);
-static __inline AesNI_StatusCode aesni_AES128_format_block_as_matrix(
- AesNI_AES128_BlockMatrixString* dest,
- const AesNI_AES128_Block* src,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES128_format_block_as_matrix(
+ AES_AES128_BlockMatrixString* dest,
+ const AES_AES128_Block* src,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_format_block_as_matrix(dest, src, err_details);
+ return aes_AES_format_block_as_matrix(dest, src, err_details);
}
-static __inline AesNI_StatusCode aesni_AES192_format_block_as_matrix(
- AesNI_AES192_BlockMatrixString* dest,
- const AesNI_AES192_Block* src,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES192_format_block_as_matrix(
+ AES_AES192_BlockMatrixString* dest,
+ const AES_AES192_Block* src,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_format_block_as_matrix(dest, src, err_details);
+ return aes_AES_format_block_as_matrix(dest, src, err_details);
}
-static __inline AesNI_StatusCode aesni_AES256_format_block_as_matrix(
- AesNI_AES256_BlockMatrixString* dest,
- const AesNI_AES256_Block* src,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES256_format_block_as_matrix(
+ AES_AES256_BlockMatrixString* dest,
+ const AES_AES256_Block* src,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_format_block_as_matrix(dest, src, err_details);
+ return aes_AES_format_block_as_matrix(dest, src, err_details);
}
-AesNI_StatusCode aesni_AES_print_block(
- const AesNI_AES_Block*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES_print_block(
+ const AES_AES_Block*,
+ AES_ErrorDetails*);
-static __inline AesNI_StatusCode aesni_AES128_print_block(
- const AesNI_AES128_Block* block,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES128_print_block(
+ const AES_AES128_Block* block,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_print_block(block, err_details);
+ return aes_AES_print_block(block, err_details);
}
-static __inline AesNI_StatusCode aesni_AES192_print_block(
- const AesNI_AES192_Block* block,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES192_print_block(
+ const AES_AES192_Block* block,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_print_block(block, err_details);
+ return aes_AES_print_block(block, err_details);
}
-static __inline AesNI_StatusCode aesni_AES256_print_block(
- const AesNI_AES256_Block* block,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES256_print_block(
+ const AES_AES256_Block* block,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_print_block(block, err_details);
+ return aes_AES_print_block(block, err_details);
}
-AesNI_StatusCode aesni_AES_print_block_as_matrix(
- const AesNI_AES_Block*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES_print_block_as_matrix(
+ const AES_AES_Block*,
+ AES_ErrorDetails*);
-static __inline AesNI_StatusCode aesni_AES128_print_block_as_matrix(
- const AesNI_AES128_Block* block,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES128_print_block_as_matrix(
+ const AES_AES128_Block* block,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_print_block_as_matrix(block, err_details);
+ return aes_AES_print_block_as_matrix(block, err_details);
}
-static __inline AesNI_StatusCode aesni_AES192_print_block_as_matrix(
- const AesNI_AES192_Block* block,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES192_print_block_as_matrix(
+ const AES_AES192_Block* block,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_print_block_as_matrix(block, err_details);
+ return aes_AES_print_block_as_matrix(block, err_details);
}
-static __inline AesNI_StatusCode aesni_AES256_print_block_as_matrix(
- const AesNI_AES256_Block* block,
- AesNI_ErrorDetails* err_details)
+static __inline AES_StatusCode aes_AES256_print_block_as_matrix(
+ const AES_AES256_Block* block,
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_print_block_as_matrix(block, err_details);
+ return aes_AES_print_block_as_matrix(block, err_details);
}
-AesNI_StatusCode aesni_AES_parse_block(
- AesNI_AES_Block* dest,
+AES_StatusCode aes_AES_parse_block(
+ AES_AES_Block* dest,
const char* src,
- AesNI_ErrorDetails* err_details);
+ AES_ErrorDetails* err_details);
-static __inline AesNI_StatusCode aesni_AES128_parse_block(
- AesNI_AES128_Block* dest,
+static __inline AES_StatusCode aes_AES128_parse_block(
+ AES_AES128_Block* dest,
const char* src,
- AesNI_ErrorDetails* err_details)
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_parse_block(dest, src, err_details);
+ return aes_AES_parse_block(dest, src, err_details);
}
-static __inline AesNI_StatusCode aesni_AES192_parse_block(
- AesNI_AES192_Block* dest,
+static __inline AES_StatusCode aes_AES192_parse_block(
+ AES_AES192_Block* dest,
const char* src,
- AesNI_ErrorDetails* err_details)
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_parse_block(dest, src, err_details);
+ return aes_AES_parse_block(dest, src, err_details);
}
-static __inline AesNI_StatusCode aesni_AES256_parse_block(
- AesNI_AES256_Block* dest,
+static __inline AES_StatusCode aes_AES256_parse_block(
+ AES_AES256_Block* dest,
const char* src,
- AesNI_ErrorDetails* err_details)
+ AES_ErrorDetails* err_details)
{
- return aesni_AES_parse_block(dest, src, err_details);
+ return aes_AES_parse_block(dest, src, err_details);
}
-typedef struct { char str[33]; } AesNI_AES128_KeyString;
-typedef struct { char str[49]; } AesNI_AES192_KeyString;
-typedef struct { char str[65]; } AesNI_AES256_KeyString;
+typedef struct { char str[33]; } AES_AES128_KeyString;
+typedef struct { char str[49]; } AES_AES192_KeyString;
+typedef struct { char str[65]; } AES_AES256_KeyString;
-AesNI_StatusCode aesni_AES128_format_key(
- AesNI_AES128_KeyString*,
- const AesNI_AES128_Key*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES128_format_key(
+ AES_AES128_KeyString*,
+ const AES_AES128_Key*,
+ AES_ErrorDetails*);
-AesNI_StatusCode aesni_AES192_format_key(
- AesNI_AES192_KeyString*,
- const AesNI_AES192_Key*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES192_format_key(
+ AES_AES192_KeyString*,
+ const AES_AES192_Key*,
+ AES_ErrorDetails*);
-AesNI_StatusCode aesni_AES256_format_key(
- AesNI_AES256_KeyString*,
- const AesNI_AES256_Key*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES256_format_key(
+ AES_AES256_KeyString*,
+ const AES_AES256_Key*,
+ AES_ErrorDetails*);
-AesNI_StatusCode aesni_AES128_print_key(
- const AesNI_AES128_Key*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES128_print_key(
+ const AES_AES128_Key*,
+ AES_ErrorDetails*);
-AesNI_StatusCode aesni_AES192_print_key(
- const AesNI_AES192_Key*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES192_print_key(
+ const AES_AES192_Key*,
+ AES_ErrorDetails*);
-AesNI_StatusCode aesni_AES256_print_key(
- const AesNI_AES256_Key*,
- AesNI_ErrorDetails*);
+AES_StatusCode aes_AES256_print_key(
+ const AES_AES256_Key*,
+ AES_ErrorDetails*);
-AesNI_StatusCode aesni_AES128_parse_key(
- AesNI_AES128_Key* dest,
+AES_StatusCode aes_AES128_parse_key(
+ AES_AES128_Key* dest,
const char* src,
- AesNI_ErrorDetails* err_details);
+ AES_ErrorDetails* err_details);
-AesNI_StatusCode aesni_AES192_parse_key(
- AesNI_AES192_Key* dest,
+AES_StatusCode aes_AES192_parse_key(
+ AES_AES192_Key* dest,
const char* src,
- AesNI_ErrorDetails* err_details);
+ AES_ErrorDetails* err_details);
-AesNI_StatusCode aesni_AES256_parse_key(
- AesNI_AES256_Key* dest,
+AES_StatusCode aes_AES256_parse_key(
+ AES_AES256_Key* dest,
const char* src,
- AesNI_ErrorDetails* err_details);
+ AES_ErrorDetails* err_details);
typedef struct
{
- AesNI_AES_Block keys[11];
+ AES_AES_Block keys[11];
}
-AesNI_AES128_RoundKeys;
+AES_AES128_RoundKeys;
typedef struct
{
- AesNI_AES_Block keys[13];
+ AES_AES_Block keys[13];
}
-AesNI_AES192_RoundKeys;
+AES_AES192_RoundKeys;
typedef struct
{
- AesNI_AES_Block keys[15];
+ AES_AES_Block keys[15];
}
-AesNI_AES256_RoundKeys;
+AES_AES256_RoundKeys;
-void __fastcall aesni_AES128_expand_key_(
- AesNI_AES_Block key,
- AesNI_AES128_RoundKeys* encryption_keys);
+void __fastcall aes_AES128_expand_key_(
+ AES_AES_Block key,
+ AES_AES128_RoundKeys* encryption_keys);
-void __fastcall aesni_AES192_expand_key_(
- AesNI_AES_Block key_lo,
- AesNI_AES_Block key_hi,
- AesNI_AES192_RoundKeys* encryption_keys);
+void __fastcall aes_AES192_expand_key_(
+ AES_AES_Block key_lo,
+ AES_AES_Block key_hi,
+ AES_AES192_RoundKeys* encryption_keys);
-void __fastcall aesni_AES256_expand_key_(
- AesNI_AES_Block key_lo,
- AesNI_AES_Block key_hi,
- AesNI_AES256_RoundKeys* encryption_keys);
+void __fastcall aes_AES256_expand_key_(
+ AES_AES_Block key_lo,
+ AES_AES_Block key_hi,
+ AES_AES256_RoundKeys* encryption_keys);
-void __fastcall aesni_AES128_derive_decryption_keys_(
- const AesNI_AES128_RoundKeys* encryption_keys,
- AesNI_AES128_RoundKeys* decryption_keys);
+void __fastcall aes_AES128_derive_decryption_keys_(
+ const AES_AES128_RoundKeys* encryption_keys,
+ AES_AES128_RoundKeys* decryption_keys);
-void __fastcall aesni_AES192_derive_decryption_keys_(
- const AesNI_AES192_RoundKeys* encryption_keys,
- AesNI_AES192_RoundKeys* decryption_keys);
+void __fastcall aes_AES192_derive_decryption_keys_(
+ const AES_AES192_RoundKeys* encryption_keys,
+ AES_AES192_RoundKeys* decryption_keys);
-void __fastcall aesni_AES256_derive_decryption_keys_(
- const AesNI_AES256_RoundKeys* encryption_keys,
- AesNI_AES256_RoundKeys* decryption_keys);
+void __fastcall aes_AES256_derive_decryption_keys_(
+ const AES_AES256_RoundKeys* encryption_keys,
+ AES_AES256_RoundKeys* decryption_keys);
-AesNI_AES_Block __fastcall aesni_AES128_encrypt_block_(
- AesNI_AES_Block plaintext,
- const AesNI_AES128_RoundKeys*);
+AES_AES_Block __fastcall aes_AES128_encrypt_block_(
+ AES_AES_Block plaintext,
+ const AES_AES128_RoundKeys*);
-AesNI_AES_Block __fastcall aesni_AES192_encrypt_block_(
- AesNI_AES_Block plaintext,
- const AesNI_AES192_RoundKeys*);
+AES_AES_Block __fastcall aes_AES192_encrypt_block_(
+ AES_AES_Block plaintext,
+ const AES_AES192_RoundKeys*);
-AesNI_AES_Block __fastcall aesni_AES256_encrypt_block_(
- AesNI_AES_Block plaintext,
- const AesNI_AES256_RoundKeys*);
+AES_AES_Block __fastcall aes_AES256_encrypt_block_(
+ AES_AES_Block plaintext,
+ const AES_AES256_RoundKeys*);
-AesNI_AES_Block __fastcall aesni_AES128_decrypt_block_(
- AesNI_AES_Block ciphertext,
- const AesNI_AES128_RoundKeys*);
+AES_AES_Block __fastcall aes_AES128_decrypt_block_(
+ AES_AES_Block ciphertext,
+ const AES_AES128_RoundKeys*);
-AesNI_AES_Block __fastcall aesni_AES192_decrypt_block_(
- AesNI_AES_Block ciphertext,
- const AesNI_AES192_RoundKeys*);
+AES_AES_Block __fastcall aes_AES192_decrypt_block_(
+ AES_AES_Block ciphertext,
+ const AES_AES192_RoundKeys*);
-AesNI_AES_Block __fastcall aesni_AES256_decrypt_block_(
- AesNI_AES_Block ciphertext,
- const AesNI_AES256_RoundKeys*);
+AES_AES_Block __fastcall aes_AES256_decrypt_block_(
+ AES_AES_Block ciphertext,
+ const AES_AES256_RoundKeys*);
-static __inline AesNI_AES_Block __fastcall aesni_AES_xor_blocks(
- AesNI_AES_Block a,
- AesNI_AES_Block b)
+static __inline AES_AES_Block __fastcall aes_AES_xor_blocks(
+ AES_AES_Block a,
+ AES_AES_Block b)
{
- return aesni_xor_block128(a, b);
+ return aes_xor_block128(a, b);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES128_xor_blocks(
- AesNI_AES128_Block a,
- AesNI_AES128_Block b)
+static __inline AES_AES_Block __fastcall aes_AES128_xor_blocks(
+ AES_AES128_Block a,
+ AES_AES128_Block b)
{
- return aesni_AES_xor_blocks(a, b);
+ return aes_AES_xor_blocks(a, b);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES192_xor_blocks(
- AesNI_AES192_Block a,
- AesNI_AES192_Block b)
+static __inline AES_AES_Block __fastcall aes_AES192_xor_blocks(
+ AES_AES192_Block a,
+ AES_AES192_Block b)
{
- return aesni_AES_xor_blocks(a, b);
+ return aes_AES_xor_blocks(a, b);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES256_xor_blocks(
- AesNI_AES256_Block a,
- AesNI_AES256_Block b)
+static __inline AES_AES_Block __fastcall aes_AES256_xor_blocks(
+ AES_AES256_Block a,
+ AES_AES256_Block b)
{
- return aesni_AES_xor_blocks(a, b);
+ return aes_AES_xor_blocks(a, b);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES_inc_block(
- AesNI_AES_Block block)
+static __inline AES_AES_Block __fastcall aes_AES_inc_block(
+ AES_AES_Block block)
{
- block = aesni_reverse_byte_order_block128(block);
- block = aesni_inc_block128(block);
- return aesni_reverse_byte_order_block128(block);
+ block = aes_reverse_byte_order_block128(block);
+ block = aes_inc_block128(block);
+ return aes_reverse_byte_order_block128(block);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES128_inc_block(
- AesNI_AES128_Block block)
+static __inline AES_AES_Block __fastcall aes_AES128_inc_block(
+ AES_AES128_Block block)
{
- return aesni_AES_inc_block(block);
+ return aes_AES_inc_block(block);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES192_inc_block(
- AesNI_AES192_Block block)
+static __inline AES_AES_Block __fastcall aes_AES192_inc_block(
+ AES_AES192_Block block)
{
- return aesni_AES_inc_block(block);
+ return aes_AES_inc_block(block);
}
-static __inline AesNI_AES_Block __fastcall aesni_AES256_inc_block(
- AesNI_AES256_Block block)
+static __inline AES_AES_Block __fastcall aes_AES256_inc_block(
+ AES_AES256_Block block)
{
- return aesni_AES_inc_block(block);
+ return aes_AES_inc_block(block);
}
-AESNI_ENCRYPT_BLOCK_ECB(AES128);
-AESNI_DECRYPT_BLOCK_ECB(AES128);
-AESNI_ENCRYPT_BLOCK_CBC(AES128);
-AESNI_DECRYPT_BLOCK_CBC(AES128);
-AESNI_ENCRYPT_BLOCK_CFB(AES128);
-AESNI_DECRYPT_BLOCK_CFB(AES128);
-AESNI_ENCRYPT_BLOCK_OFB(AES128);
-AESNI_DECRYPT_BLOCK_OFB(AES128);
-AESNI_ENCRYPT_BLOCK_CTR(AES128);
-AESNI_DECRYPT_BLOCK_CTR(AES128);
+AES_ENCRYPT_BLOCK_ECB(AES128);
+AES_DECRYPT_BLOCK_ECB(AES128);
+AES_ENCRYPT_BLOCK_CBC(AES128);
+AES_DECRYPT_BLOCK_CBC(AES128);
+AES_ENCRYPT_BLOCK_CFB(AES128);
+AES_DECRYPT_BLOCK_CFB(AES128);
+AES_ENCRYPT_BLOCK_OFB(AES128);
+AES_DECRYPT_BLOCK_OFB(AES128);
+AES_ENCRYPT_BLOCK_CTR(AES128);
+AES_DECRYPT_BLOCK_CTR(AES128);
-AESNI_ENCRYPT_BLOCK_ECB(AES192);
-AESNI_DECRYPT_BLOCK_ECB(AES192);
-AESNI_ENCRYPT_BLOCK_CBC(AES192);
-AESNI_DECRYPT_BLOCK_CBC(AES192);
-AESNI_ENCRYPT_BLOCK_CFB(AES192);
-AESNI_DECRYPT_BLOCK_CFB(AES192);
-AESNI_ENCRYPT_BLOCK_OFB(AES192);
-AESNI_DECRYPT_BLOCK_OFB(AES192);
-AESNI_ENCRYPT_BLOCK_CTR(AES192);
-AESNI_DECRYPT_BLOCK_CTR(AES192);
+AES_ENCRYPT_BLOCK_ECB(AES192);
+AES_DECRYPT_BLOCK_ECB(AES192);
+AES_ENCRYPT_BLOCK_CBC(AES192);
+AES_DECRYPT_BLOCK_CBC(AES192);
+AES_ENCRYPT_BLOCK_CFB(AES192);
+AES_DECRYPT_BLOCK_CFB(AES192);
+AES_ENCRYPT_BLOCK_OFB(AES192);
+AES_DECRYPT_BLOCK_OFB(AES192);
+AES_ENCRYPT_BLOCK_CTR(AES192);
+AES_DECRYPT_BLOCK_CTR(AES192);
-AESNI_ENCRYPT_BLOCK_ECB(AES256);
-AESNI_DECRYPT_BLOCK_ECB(AES256);
-AESNI_ENCRYPT_BLOCK_CBC(AES256);
-AESNI_DECRYPT_BLOCK_CBC(AES256);
-AESNI_ENCRYPT_BLOCK_CFB(AES256);
-AESNI_DECRYPT_BLOCK_CFB(AES256);
-AESNI_ENCRYPT_BLOCK_OFB(AES256);
-AESNI_DECRYPT_BLOCK_OFB(AES256);
-AESNI_ENCRYPT_BLOCK_CTR(AES256);
-AESNI_DECRYPT_BLOCK_CTR(AES256);
+AES_ENCRYPT_BLOCK_ECB(AES256);
+AES_DECRYPT_BLOCK_ECB(AES256);
+AES_ENCRYPT_BLOCK_CBC(AES256);
+AES_DECRYPT_BLOCK_CBC(AES256);
+AES_ENCRYPT_BLOCK_CFB(AES256);
+AES_DECRYPT_BLOCK_CFB(AES256);
+AES_ENCRYPT_BLOCK_OFB(AES256);
+AES_DECRYPT_BLOCK_OFB(AES256);
+AES_ENCRYPT_BLOCK_CTR(AES256);
+AES_DECRYPT_BLOCK_CTR(AES256);
/**
* \brief Expands an AES-128 key into 10 encryption round keys.
@@ -435,13 +435,13 @@ AESNI_DECRYPT_BLOCK_CTR(AES256);
* \param[in] key The AES-128 key.
* \param[out] encryption_keys The AES-128 encryption round keys. Must not be `NULL`.
*/
-static __inline void __fastcall aesni_AES128_expand_key(
- const AesNI_AES128_Key* key,
- AesNI_AES128_RoundKeys* encryption_keys)
+static __inline void __fastcall aes_AES128_expand_key(
+ const AES_AES128_Key* key,
+ AES_AES128_RoundKeys* encryption_keys)
{
assert(encryption_keys);
- aesni_AES128_expand_key_(key->key, encryption_keys);
+ aes_AES128_expand_key_(key->key, encryption_keys);
}
/**
@@ -450,14 +450,14 @@ static __inline void __fastcall aesni_AES128_expand_key(
* \param[in] encryption_keys The AES-128 encryption round keys. Must not be `NULL`.
* \param[out] decryption_keys The AES-128 decryption round keys. Must not be `NULL`.
*/
-static __inline void __fastcall aesni_AES128_derive_decryption_keys(
- const AesNI_AES128_RoundKeys* encryption_keys,
- AesNI_AES128_RoundKeys* decryption_keys)
+static __inline void __fastcall aes_AES128_derive_decryption_keys(
+ const AES_AES128_RoundKeys* encryption_keys,
+ AES_AES128_RoundKeys* decryption_keys)
{
assert(encryption_keys);
assert(decryption_keys);
- aesni_AES128_derive_decryption_keys_(encryption_keys, decryption_keys);
+ aes_AES128_derive_decryption_keys_(encryption_keys, decryption_keys);
}
/**
@@ -466,14 +466,14 @@ static __inline void __fastcall aesni_AES128_derive_decryption_keys(
* \param[in] key The AES-192 key.
* \param[out] encryption_keys The AES-192 encryption round keys. Must not be `NULL`.
*/
-static __inline void __fastcall aesni_AES192_expand_key(
- const AesNI_AES192_Key* key,
- AesNI_AES192_RoundKeys* encryption_keys)
+static __inline void __fastcall aes_AES192_expand_key(
+ const AES_AES192_Key* key,
+ AES_AES192_RoundKeys* encryption_keys)
{
assert(key);
assert(encryption_keys);
- aesni_AES192_expand_key_(key->lo, key->hi, encryption_keys);
+ aes_AES192_expand_key_(key->lo, key->hi, encryption_keys);
}
/**
@@ -482,14 +482,14 @@ static __inline void __fastcall aesni_AES192_expand_key(
* \param[in] encryption_keys The AES-192 encryption round keys. Must not be `NULL`.
* \param[out] decryption_keys The AES-192 decryption round keys. Must not be `NULL`.
*/
-static __inline void __fastcall aesni_AES192_derive_decryption_keys(
- const AesNI_AES192_RoundKeys* encryption_keys,
- AesNI_AES192_RoundKeys* decryption_keys)
+static __inline void __fastcall aes_AES192_derive_decryption_keys(
+ const AES_AES192_RoundKeys* encryption_keys,
+ AES_AES192_RoundKeys* decryption_keys)
{
assert(encryption_keys);
assert(decryption_keys);
- aesni_AES192_derive_decryption_keys_(encryption_keys, decryption_keys);
+ aes_AES192_derive_decryption_keys_(encryption_keys, decryption_keys);
}
/**
@@ -498,14 +498,14 @@ static __inline void __fastcall aesni_AES192_derive_decryption_keys(
* \param[in] key The AES-256 key.
* \param[out] encryption_keys The AES-256 encryption round keys. Must not be `NULL`.
*/
-static __inline void __fastcall aesni_AES256_expand_key(
- const AesNI_AES256_Key* key,
- AesNI_AES256_RoundKeys* encryption_keys)
+static __inline void __fastcall aes_AES256_expand_key(
+ const AES_AES256_Key* key,
+ AES_AES256_RoundKeys* encryption_keys)
{
assert(key);
assert(encryption_keys);
- aesni_AES256_expand_key_(key->lo, key->hi, encryption_keys);
+ aes_AES256_expand_key_(key->lo, key->hi, encryption_keys);
}
/**
@@ -514,14 +514,14 @@ static __inline void __fastcall aesni_AES256_expand_key(
* \param[in] encryption_keys The AES-256 encryption round keys. Must not be `NULL`.
* \param[out] decryption_keys The AES-256 decryption round keys. Must not be `NULL`.
*/
-static __inline void __fastcall aesni_AES256_derive_decryption_keys(
- const AesNI_AES256_RoundKeys* encryption_keys,
- AesNI_AES256_RoundKeys* decryption_keys)
+static __inline void __fastcall aes_AES256_derive_decryption_keys(
+ const AES_AES256_RoundKeys* encryption_keys,
+ AES_AES256_RoundKeys* decryption_keys)
{
assert(encryption_keys);
assert(decryption_keys);
- aesni_AES256_derive_decryption_keys_(encryption_keys, decryption_keys);
+ aes_AES256_derive_decryption_keys_(encryption_keys, decryption_keys);
}
#ifdef __cplusplus