summaryrefslogtreecommitdiffstatshomepage
path: root/aesxx
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-07-20 21:32:29 +0200
committerEgor Tensin <egor@tensin.name>2026-07-20 21:32:29 +0200
commitf2c9b2934b9be0f93105c411f5dbea564800fc3f (patch)
tree1fd5b3d68904e44768273ee52598acd09dc04b14 /aesxx
parentget rid of outdated __inline (diff)
downloadaes-tools-f2c9b2934b9be0f93105c411f5dbea564800fc3f.tar.gz
aes-tools-f2c9b2934b9be0f93105c411f5dbea564800fc3f.zip
remove a few levels of stupid indirection
Diffstat (limited to 'aesxx')
-rw-r--r--aesxx/include/aesxx/aes.hpp138
-rw-r--r--aesxx/include/aesxx/data.hpp18
-rw-r--r--aesxx/include/aesxx/mode.hpp140
3 files changed, 148 insertions, 148 deletions
diff --git a/aesxx/include/aesxx/aes.hpp b/aesxx/include/aesxx/aes.hpp
index 1b5aefa..6271b24 100644
--- a/aesxx/include/aesxx/aes.hpp
+++ b/aesxx/include/aesxx/aes.hpp
@@ -19,9 +19,9 @@
namespace aes {
namespace aes128 {
-typedef AES_AES128_Block Block;
-typedef AES_AES128_RoundKeys RoundKeys;
-typedef AES_AES128_Key Key;
+typedef AES_Block Block;
+typedef AES128_RoundKeys RoundKeys;
+typedef AES128_Key Key;
} // namespace aes128
@@ -34,38 +34,38 @@ struct Types<AES_AES128> {
template <>
inline void from_string<AES_AES128>(aes128::Block& dest, std::string_view src) {
- aes_AES128_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
+ aes128_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
template <>
inline std::string to_string<AES_AES128>(const aes128::Block& src) {
- AES_AES128_BlockString str;
- aes_AES128_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES128_BlockString str;
+ aes128_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline std::string to_matrix_string<AES_AES128>(const aes128::Block& src) {
- AES_AES128_BlockMatrixString str;
- aes_AES128_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES128_BlockMatrixString str;
+ aes128_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline void from_string<AES_AES128>(aes128::Key& dest, std::string_view src) {
- aes_AES128_parse_key(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
+ aes128_parse_key(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
template <>
inline std::string to_string<AES_AES128>(const aes128::Key& src) {
- AES_AES128_KeyString str;
- aes_AES128_format_key(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES128_KeyString str;
+ aes128_format_key(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline void expand_key<AES_AES128>(const aes128::Key& key, aes128::RoundKeys& encryption_keys) {
- aes_AES128_expand_key(&key, &encryption_keys);
+ aes128_expand_key(&key, &encryption_keys);
}
template <>
@@ -73,25 +73,25 @@ inline void derive_decryption_keys<AES_AES128>(
const aes128::RoundKeys& encryption_keys,
aes128::RoundKeys& decryption_keys
) {
- aes_AES128_derive_decryption_keys(&encryption_keys, &decryption_keys);
+ aes128_derive_decryption_keys(&encryption_keys, &decryption_keys);
}
-AESXX_ENCRYPT_BLOCK_ECB(AES128);
-AESXX_DECRYPT_BLOCK_ECB(AES128);
-AESXX_ENCRYPT_BLOCK_CBC(AES128);
-AESXX_DECRYPT_BLOCK_CBC(AES128);
-AESXX_ENCRYPT_BLOCK_CFB(AES128);
-AESXX_DECRYPT_BLOCK_CFB(AES128);
-AESXX_ENCRYPT_BLOCK_OFB(AES128);
-AESXX_DECRYPT_BLOCK_OFB(AES128);
-AESXX_ENCRYPT_BLOCK_CTR(AES128);
-AESXX_DECRYPT_BLOCK_CTR(AES128);
+AESXX_ENCRYPT_BLOCK_ECB(128);
+AESXX_DECRYPT_BLOCK_ECB(128);
+AESXX_ENCRYPT_BLOCK_CBC(128);
+AESXX_DECRYPT_BLOCK_CBC(128);
+AESXX_ENCRYPT_BLOCK_CFB(128);
+AESXX_DECRYPT_BLOCK_CFB(128);
+AESXX_ENCRYPT_BLOCK_OFB(128);
+AESXX_DECRYPT_BLOCK_OFB(128);
+AESXX_ENCRYPT_BLOCK_CTR(128);
+AESXX_DECRYPT_BLOCK_CTR(128);
namespace aes192 {
-typedef AES_AES192_Block Block;
-typedef AES_AES192_RoundKeys RoundKeys;
-typedef AES_AES192_Key Key;
+typedef AES_Block Block;
+typedef AES192_RoundKeys RoundKeys;
+typedef AES192_Key Key;
} // namespace aes192
@@ -104,38 +104,38 @@ struct Types<AES_AES192> {
template <>
inline void from_string<AES_AES192>(aes192::Block& dest, std::string_view src) {
- aes_AES192_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
+ aes192_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
template <>
inline std::string to_string<AES_AES192>(const aes192::Block& src) {
- AES_AES192_BlockString str;
- aes_AES192_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES192_BlockString str;
+ aes192_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline std::string to_matrix_string<AES_AES192>(const aes192::Block& src) {
- AES_AES192_BlockMatrixString str;
- aes_AES192_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES192_BlockMatrixString str;
+ aes192_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline void from_string<AES_AES192>(aes192::Key& dest, std::string_view src) {
- aes_AES192_parse_key(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
+ aes192_parse_key(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
template <>
inline std::string to_string<AES_AES192>(const aes192::Key& src) {
- AES_AES192_KeyString str;
- aes_AES192_format_key(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES192_KeyString str;
+ aes192_format_key(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline void expand_key<AES_AES192>(const aes192::Key& key, aes192::RoundKeys& encryption_keys) {
- aes_AES192_expand_key(&key, &encryption_keys);
+ aes192_expand_key(&key, &encryption_keys);
}
template <>
@@ -143,25 +143,25 @@ inline void derive_decryption_keys<AES_AES192>(
const aes192::RoundKeys& encryption_keys,
aes192::RoundKeys& decryption_keys
) {
- aes_AES192_derive_decryption_keys(&encryption_keys, &decryption_keys);
+ aes192_derive_decryption_keys(&encryption_keys, &decryption_keys);
}
-AESXX_ENCRYPT_BLOCK_ECB(AES192);
-AESXX_DECRYPT_BLOCK_ECB(AES192);
-AESXX_ENCRYPT_BLOCK_CBC(AES192);
-AESXX_DECRYPT_BLOCK_CBC(AES192);
-AESXX_ENCRYPT_BLOCK_CFB(AES192);
-AESXX_DECRYPT_BLOCK_CFB(AES192);
-AESXX_ENCRYPT_BLOCK_OFB(AES192);
-AESXX_DECRYPT_BLOCK_OFB(AES192);
-AESXX_ENCRYPT_BLOCK_CTR(AES192);
-AESXX_DECRYPT_BLOCK_CTR(AES192);
+AESXX_ENCRYPT_BLOCK_ECB(192);
+AESXX_DECRYPT_BLOCK_ECB(192);
+AESXX_ENCRYPT_BLOCK_CBC(192);
+AESXX_DECRYPT_BLOCK_CBC(192);
+AESXX_ENCRYPT_BLOCK_CFB(192);
+AESXX_DECRYPT_BLOCK_CFB(192);
+AESXX_ENCRYPT_BLOCK_OFB(192);
+AESXX_DECRYPT_BLOCK_OFB(192);
+AESXX_ENCRYPT_BLOCK_CTR(192);
+AESXX_DECRYPT_BLOCK_CTR(192);
namespace aes256 {
-typedef AES_AES256_Block Block;
-typedef AES_AES256_RoundKeys RoundKeys;
-typedef AES_AES256_Key Key;
+typedef AES_Block Block;
+typedef AES256_RoundKeys RoundKeys;
+typedef AES256_Key Key;
} // namespace aes256
@@ -174,38 +174,38 @@ struct Types<AES_AES256> {
template <>
inline void from_string<AES_AES256>(aes256::Block& dest, std::string_view src) {
- aes_AES256_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
+ aes256_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
template <>
inline std::string to_string<AES_AES256>(const aes256::Block& src) {
- AES_AES256_BlockString str;
- aes_AES256_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES256_BlockString str;
+ aes256_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline std::string to_matrix_string<AES_AES256>(const aes256::Block& src) {
- AES_AES256_BlockMatrixString str;
- aes_AES256_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES256_BlockMatrixString str;
+ aes256_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline void from_string<AES_AES256>(aes256::Key& dest, std::string_view src) {
- aes_AES256_parse_key(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
+ aes256_parse_key(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
template <>
inline std::string to_string<AES_AES256>(const aes256::Key& src) {
- AES_AES256_KeyString str;
- aes_AES256_format_key(&str, &src, ErrorDetailsThrowsInDestructor{});
+ AES256_KeyString str;
+ aes256_format_key(&str, &src, ErrorDetailsThrowsInDestructor{});
return {str.str};
}
template <>
inline void expand_key<AES_AES256>(const aes256::Key& key, aes256::RoundKeys& encryption_keys) {
- aes_AES256_expand_key(&key, &encryption_keys);
+ aes256_expand_key(&key, &encryption_keys);
}
template <>
@@ -213,18 +213,18 @@ inline void derive_decryption_keys<AES_AES256>(
const aes256::RoundKeys& encryption_keys,
aes256::RoundKeys& decryption_keys
) {
- aes_AES256_derive_decryption_keys(&encryption_keys, &decryption_keys);
+ aes256_derive_decryption_keys(&encryption_keys, &decryption_keys);
}
-AESXX_ENCRYPT_BLOCK_ECB(AES256);
-AESXX_DECRYPT_BLOCK_ECB(AES256);
-AESXX_ENCRYPT_BLOCK_CBC(AES256);
-AESXX_DECRYPT_BLOCK_CBC(AES256);
-AESXX_ENCRYPT_BLOCK_CFB(AES256);
-AESXX_DECRYPT_BLOCK_CFB(AES256);
-AESXX_ENCRYPT_BLOCK_OFB(AES256);
-AESXX_DECRYPT_BLOCK_OFB(AES256);
-AESXX_ENCRYPT_BLOCK_CTR(AES256);
-AESXX_DECRYPT_BLOCK_CTR(AES256);
+AESXX_ENCRYPT_BLOCK_ECB(256);
+AESXX_DECRYPT_BLOCK_ECB(256);
+AESXX_ENCRYPT_BLOCK_CBC(256);
+AESXX_DECRYPT_BLOCK_CBC(256);
+AESXX_ENCRYPT_BLOCK_CFB(256);
+AESXX_DECRYPT_BLOCK_CFB(256);
+AESXX_ENCRYPT_BLOCK_OFB(256);
+AESXX_DECRYPT_BLOCK_OFB(256);
+AESXX_ENCRYPT_BLOCK_CTR(256);
+AESXX_DECRYPT_BLOCK_CTR(256);
} // namespace aes
diff --git a/aesxx/include/aesxx/data.hpp b/aesxx/include/aesxx/data.hpp
index e381995..a93a781 100644
--- a/aesxx/include/aesxx/data.hpp
+++ b/aesxx/include/aesxx/data.hpp
@@ -11,38 +11,38 @@
namespace aes {
-typedef AES_Block128 Block128;
+typedef AES_Block Block128;
inline void make_block(Block128& dest, int hi3, int hi2, int lo1, int lo0) {
- dest = aes_make_block128(hi3, hi2, lo1, lo0);
+ dest = aes_make_block(hi3, hi2, lo1, lo0);
}
inline void load_block(Block128& dest, const void* src) {
- dest = aes_load_block128(src);
+ dest = aes_load_block(src);
}
inline void load_block_aligned(Block128& dest, const void* src) {
- dest = aes_load_block128_aligned(src);
+ dest = aes_load_block_aligned(src);
}
inline void store_block(void* dest, Block128& src) {
- aes_store_block128(dest, src);
+ aes_store_block(dest, src);
}
inline void store_block_aligned(void* dest, Block128& src) {
- aes_store_block128_aligned(dest, src);
+ aes_store_block_aligned(dest, src);
}
inline Block128 xor_blocks(Block128& a, Block128& b) {
- return aes_xor_block128(a, b);
+ return aes_xor_blocks(a, b);
}
inline Block128 reverse_byte_order(Block128& block) {
- return aes_reverse_byte_order_block128(block);
+ return aes_reverse_byte_order_block(block);
}
inline Block128 inc_block(Block128& block) {
- return aes_inc_block128(block);
+ return aes_inc_block(block);
}
} // namespace aes
diff --git a/aesxx/include/aesxx/mode.hpp b/aesxx/include/aesxx/mode.hpp
index 9fbcaae..d6f282a 100644
--- a/aesxx/include/aesxx/mode.hpp
+++ b/aesxx/include/aesxx/mode.hpp
@@ -21,114 +21,114 @@ inline constexpr bool mode_uses_encryption_keys_only(Mode mode) {
return mode != AES_ECB && mode != AES_CBC;
}
-#define AESXX_ENCRYPT_BLOCK_ECB(prefix) \
+#define AESXX_ENCRYPT_BLOCK_ECB(version) \
template <> \
- inline void encrypt_block<AES_##prefix, AES_ECB>( \
- const typename Types<AES_##prefix>::Block& plaintext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block&, \
- typename Types<AES_##prefix>::Block& ciphertext \
+ inline void encrypt_block<AES_AES##version, AES_ECB>( \
+ const typename Types<AES_AES##version>::Block& plaintext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block&, \
+ typename Types<AES_AES##version>::Block& ciphertext \
) { \
- ciphertext = aes_##prefix##_encrypt_block_ECB(plaintext, &encryption_keys); \
+ ciphertext = aes##version##_encrypt_block_ECB(plaintext, &encryption_keys); \
}
-#define AESXX_DECRYPT_BLOCK_ECB(prefix) \
+#define AESXX_DECRYPT_BLOCK_ECB(version) \
template <> \
- inline void decrypt_block<AES_##prefix, AES_ECB>( \
- const typename Types<AES_##prefix>::Block& ciphertext, \
- const typename Types<AES_##prefix>::RoundKeys& decryption_keys, \
- typename Types<AES_##prefix>::Block&, \
- typename Types<AES_##prefix>::Block& plaintext \
+ inline void decrypt_block<AES_AES##version, AES_ECB>( \
+ const typename Types<AES_AES##version>::Block& ciphertext, \
+ const typename Types<AES_AES##version>::RoundKeys& decryption_keys, \
+ typename Types<AES_AES##version>::Block&, \
+ typename Types<AES_AES##version>::Block& plaintext \
) { \
- plaintext = aes_##prefix##_decrypt_block_ECB(ciphertext, &decryption_keys); \
+ plaintext = aes##version##_decrypt_block_ECB(ciphertext, &decryption_keys); \
}
-#define AESXX_ENCRYPT_BLOCK_CBC(prefix) \
+#define AESXX_ENCRYPT_BLOCK_CBC(version) \
template <> \
- inline void encrypt_block<AES_##prefix, AES_CBC>( \
- const typename Types<AES_##prefix>::Block& plaintext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& ciphertext \
+ inline void encrypt_block<AES_AES##version, AES_CBC>( \
+ const typename Types<AES_AES##version>::Block& plaintext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& ciphertext \
) { \
- ciphertext = aes_##prefix##_encrypt_block_CBC(plaintext, &encryption_keys, iv, &iv); \
+ ciphertext = aes##version##_encrypt_block_CBC(plaintext, &encryption_keys, iv, &iv); \
}
-#define AESXX_DECRYPT_BLOCK_CBC(prefix) \
+#define AESXX_DECRYPT_BLOCK_CBC(version) \
template <> \
- inline void decrypt_block<AES_##prefix, AES_CBC>( \
- const typename Types<AES_##prefix>::Block& ciphertext, \
- const typename Types<AES_##prefix>::RoundKeys& decryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& plaintext \
+ inline void decrypt_block<AES_AES##version, AES_CBC>( \
+ const typename Types<AES_AES##version>::Block& ciphertext, \
+ const typename Types<AES_AES##version>::RoundKeys& decryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& plaintext \
) { \
- plaintext = aes_##prefix##_decrypt_block_CBC(ciphertext, &decryption_keys, iv, &iv); \
+ plaintext = aes##version##_decrypt_block_CBC(ciphertext, &decryption_keys, iv, &iv); \
}
-#define AESXX_ENCRYPT_BLOCK_CFB(prefix) \
+#define AESXX_ENCRYPT_BLOCK_CFB(version) \
template <> \
- inline void encrypt_block<AES_##prefix, AES_CFB>( \
- const typename Types<AES_##prefix>::Block& plaintext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& ciphertext \
+ inline void encrypt_block<AES_AES##version, AES_CFB>( \
+ const typename Types<AES_AES##version>::Block& plaintext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& ciphertext \
) { \
- ciphertext = aes_##prefix##_encrypt_block_CFB(plaintext, &encryption_keys, iv, &iv); \
+ ciphertext = aes##version##_encrypt_block_CFB(plaintext, &encryption_keys, iv, &iv); \
}
-#define AESXX_DECRYPT_BLOCK_CFB(prefix) \
+#define AESXX_DECRYPT_BLOCK_CFB(version) \
template <> \
- inline void decrypt_block<AES_##prefix, AES_CFB>( \
- const typename Types<AES_##prefix>::Block& ciphertext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& plaintext \
+ inline void decrypt_block<AES_AES##version, AES_CFB>( \
+ const typename Types<AES_AES##version>::Block& ciphertext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& plaintext \
) { \
- plaintext = aes_##prefix##_decrypt_block_CFB(ciphertext, &encryption_keys, iv, &iv); \
+ plaintext = aes##version##_decrypt_block_CFB(ciphertext, &encryption_keys, iv, &iv); \
}
-#define AESXX_ENCRYPT_BLOCK_OFB(prefix) \
+#define AESXX_ENCRYPT_BLOCK_OFB(version) \
template <> \
- inline void encrypt_block<AES_##prefix, AES_OFB>( \
- const typename Types<AES_##prefix>::Block& plaintext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& ciphertext \
+ inline void encrypt_block<AES_AES##version, AES_OFB>( \
+ const typename Types<AES_AES##version>::Block& plaintext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& ciphertext \
) { \
- ciphertext = aes_##prefix##_encrypt_block_OFB(plaintext, &encryption_keys, iv, &iv); \
+ ciphertext = aes##version##_encrypt_block_OFB(plaintext, &encryption_keys, iv, &iv); \
}
-#define AESXX_DECRYPT_BLOCK_OFB(prefix) \
+#define AESXX_DECRYPT_BLOCK_OFB(version) \
template <> \
- inline void decrypt_block<AES_##prefix, AES_OFB>( \
- const typename Types<AES_##prefix>::Block& ciphertext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& plaintext \
+ inline void decrypt_block<AES_AES##version, AES_OFB>( \
+ const typename Types<AES_AES##version>::Block& ciphertext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& plaintext \
) { \
- plaintext = aes_##prefix##_decrypt_block_OFB(ciphertext, &encryption_keys, iv, &iv); \
+ plaintext = aes##version##_decrypt_block_OFB(ciphertext, &encryption_keys, iv, &iv); \
}
-#define AESXX_ENCRYPT_BLOCK_CTR(prefix) \
+#define AESXX_ENCRYPT_BLOCK_CTR(version) \
template <> \
- inline void encrypt_block<AES_##prefix, AES_CTR>( \
- const typename Types<AES_##prefix>::Block& plaintext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& ciphertext \
+ inline void encrypt_block<AES_AES##version, AES_CTR>( \
+ const typename Types<AES_AES##version>::Block& plaintext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& ciphertext \
) { \
- ciphertext = aes_##prefix##_encrypt_block_CTR(plaintext, &encryption_keys, iv, &iv); \
+ ciphertext = aes##version##_encrypt_block_CTR(plaintext, &encryption_keys, iv, &iv); \
}
-#define AESXX_DECRYPT_BLOCK_CTR(prefix) \
+#define AESXX_DECRYPT_BLOCK_CTR(version) \
template <> \
- inline void decrypt_block<AES_##prefix, AES_CTR>( \
- const typename Types<AES_##prefix>::Block& ciphertext, \
- const typename Types<AES_##prefix>::RoundKeys& encryption_keys, \
- typename Types<AES_##prefix>::Block& iv, \
- typename Types<AES_##prefix>::Block& plaintext \
+ inline void decrypt_block<AES_AES##version, AES_CTR>( \
+ const typename Types<AES_AES##version>::Block& ciphertext, \
+ const typename Types<AES_AES##version>::RoundKeys& encryption_keys, \
+ typename Types<AES_AES##version>::Block& iv, \
+ typename Types<AES_AES##version>::Block& plaintext \
) { \
- plaintext = aes_##prefix##_decrypt_block_CTR(ciphertext, &encryption_keys, iv, &iv); \
+ plaintext = aes##version##_decrypt_block_CTR(ciphertext, &encryption_keys, iv, &iv); \
}
} // namespace aes