aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cxx/include/aesxx/aes.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-05-19 04:48:59 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-05-19 04:48:59 +0300
commitf0393777befc4ff1024513dab3ab6bad0e7ec45f (patch)
tree97571103c522ff60f96a8fdde35a0bbee9532837 /cxx/include/aesxx/aes.hpp
parentrename the project (diff)
downloadaes-tools-f0393777befc4ff1024513dab3ab6bad0e7ec45f.tar.gz
aes-tools-f0393777befc4ff1024513dab3ab6bad0e7ec45f.zip
'aesni' -> 'aes'
Diffstat (limited to 'cxx/include/aesxx/aes.hpp')
-rw-r--r--cxx/include/aesxx/aes.hpp194
1 files changed, 97 insertions, 97 deletions
diff --git a/cxx/include/aesxx/aes.hpp b/cxx/include/aesxx/aes.hpp
index 698c0ef..fe0ade4 100644
--- a/cxx/include/aesxx/aes.hpp
+++ b/cxx/include/aesxx/aes.hpp
@@ -19,17 +19,17 @@
#include <string>
-namespace aesni
+namespace aes
{
namespace aes128
{
- typedef AesNI_AES128_Block Block;
- typedef AesNI_AES128_RoundKeys RoundKeys;
- typedef AesNI_AES128_Key Key;
+ typedef AES_AES128_Block Block;
+ typedef AES_AES128_RoundKeys RoundKeys;
+ typedef AES_AES128_Key Key;
}
template <>
- struct Types<AESNI_AES128>
+ struct Types<AES_AES128>
{
typedef aes128::Block Block;
typedef aes128::RoundKeys RoundKeys;
@@ -37,84 +37,84 @@ namespace aesni
};
template <>
- std::size_t get_number_of_rounds<AESNI_AES128>()
+ std::size_t get_number_of_rounds<AES_AES128>()
{
return 11;
}
template <>
- void from_string<AESNI_AES128>(aes128::Block& dest, const char* src)
+ void from_string<AES_AES128>(aes128::Block& dest, const char* src)
{
- aesni_AES128_parse_block(&dest, src, ErrorDetailsThrowsInDestructor());
+ aes_AES128_parse_block(&dest, src, ErrorDetailsThrowsInDestructor());
}
template <>
- std::string to_string<AESNI_AES128>(const aes128::Block& src)
+ std::string to_string<AES_AES128>(const aes128::Block& src)
{
- AesNI_AES128_BlockString str;
- aesni_AES128_format_block(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES128_BlockString str;
+ aes_AES128_format_block(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- std::string to_matrix_string<AESNI_AES128>(const aes128::Block& src)
+ std::string to_matrix_string<AES_AES128>(const aes128::Block& src)
{
- AesNI_AES128_BlockMatrixString str;
- aesni_AES128_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES128_BlockMatrixString str;
+ aes_AES128_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- void from_string<AESNI_AES128>(aes128::Key& dest, const char* src)
+ void from_string<AES_AES128>(aes128::Key& dest, const char* src)
{
- aesni_AES128_parse_key(&dest, src, ErrorDetailsThrowsInDestructor());
+ aes_AES128_parse_key(&dest, src, ErrorDetailsThrowsInDestructor());
}
template <>
- std::string to_string<AESNI_AES128>(const aes128::Key& src)
+ std::string to_string<AES_AES128>(const aes128::Key& src)
{
- AesNI_AES128_KeyString str;
- aesni_AES128_format_key(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES128_KeyString str;
+ aes_AES128_format_key(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- inline void expand_key<AESNI_AES128>(
+ inline void expand_key<AES_AES128>(
const aes128::Key& key,
aes128::RoundKeys& encryption_keys)
{
- aesni_AES128_expand_key(&key, &encryption_keys);
+ aes_AES128_expand_key(&key, &encryption_keys);
}
template <>
- inline void derive_decryption_keys<AESNI_AES128>(
+ inline void derive_decryption_keys<AES_AES128>(
const aes128::RoundKeys& encryption_keys,
aes128::RoundKeys& decryption_keys)
{
- aesni_AES128_derive_decryption_keys(
+ aes_AES128_derive_decryption_keys(
&encryption_keys, &decryption_keys);
}
- AESNIXX_ENCRYPT_BLOCK_ECB(AES128);
- AESNIXX_DECRYPT_BLOCK_ECB(AES128);
- AESNIXX_ENCRYPT_BLOCK_CBC(AES128);
- AESNIXX_DECRYPT_BLOCK_CBC(AES128);
- AESNIXX_ENCRYPT_BLOCK_CFB(AES128);
- AESNIXX_DECRYPT_BLOCK_CFB(AES128);
- AESNIXX_ENCRYPT_BLOCK_OFB(AES128);
- AESNIXX_DECRYPT_BLOCK_OFB(AES128);
- AESNIXX_ENCRYPT_BLOCK_CTR(AES128);
- AESNIXX_DECRYPT_BLOCK_CTR(AES128);
+ 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);
namespace aes192
{
- typedef AesNI_AES192_Block Block;
- typedef AesNI_AES192_RoundKeys RoundKeys;
- typedef AesNI_AES192_Key Key;
+ typedef AES_AES192_Block Block;
+ typedef AES_AES192_RoundKeys RoundKeys;
+ typedef AES_AES192_Key Key;
}
template <>
- struct Types<AESNI_AES192>
+ struct Types<AES_AES192>
{
typedef aes192::Block Block;
typedef aes192::RoundKeys RoundKeys;
@@ -122,84 +122,84 @@ namespace aesni
};
template <>
- std::size_t get_number_of_rounds<AESNI_AES192>()
+ std::size_t get_number_of_rounds<AES_AES192>()
{
return 13;
}
template <>
- void from_string<AESNI_AES192>(aes192::Block& dest, const char* src)
+ void from_string<AES_AES192>(aes192::Block& dest, const char* src)
{
- aesni_AES192_parse_block(&dest, src, ErrorDetailsThrowsInDestructor());
+ aes_AES192_parse_block(&dest, src, ErrorDetailsThrowsInDestructor());
}
template <>
- std::string to_string<AESNI_AES192>(const aes192::Block& src)
+ std::string to_string<AES_AES192>(const aes192::Block& src)
{
- AesNI_AES192_BlockString str;
- aesni_AES192_format_block(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES192_BlockString str;
+ aes_AES192_format_block(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- std::string to_matrix_string<AESNI_AES192>(const aes192::Block& src)
+ std::string to_matrix_string<AES_AES192>(const aes192::Block& src)
{
- AesNI_AES192_BlockMatrixString str;
- aesni_AES192_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES192_BlockMatrixString str;
+ aes_AES192_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- void from_string<AESNI_AES192>(aes192::Key& dest, const char* src)
+ void from_string<AES_AES192>(aes192::Key& dest, const char* src)
{
- aesni_AES192_parse_key(&dest, src, ErrorDetailsThrowsInDestructor());
+ aes_AES192_parse_key(&dest, src, ErrorDetailsThrowsInDestructor());
}
template <>
- std::string to_string<AESNI_AES192>(const aes192::Key& src)
+ std::string to_string<AES_AES192>(const aes192::Key& src)
{
- AesNI_AES192_KeyString str;
- aesni_AES192_format_key(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES192_KeyString str;
+ aes_AES192_format_key(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- inline void expand_key<AESNI_AES192>(
+ inline void expand_key<AES_AES192>(
const aes192::Key& key,
aes192::RoundKeys& encryption_keys)
{
- aesni_AES192_expand_key(&key, &encryption_keys);
+ aes_AES192_expand_key(&key, &encryption_keys);
}
template <>
- inline void derive_decryption_keys<AESNI_AES192>(
+ inline void derive_decryption_keys<AES_AES192>(
const aes192::RoundKeys& encryption_keys,
aes192::RoundKeys& decryption_keys)
{
- aesni_AES192_derive_decryption_keys(
+ aes_AES192_derive_decryption_keys(
&encryption_keys, &decryption_keys);
}
- AESNIXX_ENCRYPT_BLOCK_ECB(AES192);
- AESNIXX_DECRYPT_BLOCK_ECB(AES192);
- AESNIXX_ENCRYPT_BLOCK_CBC(AES192);
- AESNIXX_DECRYPT_BLOCK_CBC(AES192);
- AESNIXX_ENCRYPT_BLOCK_CFB(AES192);
- AESNIXX_DECRYPT_BLOCK_CFB(AES192);
- AESNIXX_ENCRYPT_BLOCK_OFB(AES192);
- AESNIXX_DECRYPT_BLOCK_OFB(AES192);
- AESNIXX_ENCRYPT_BLOCK_CTR(AES192);
- AESNIXX_DECRYPT_BLOCK_CTR(AES192);
+ 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);
namespace aes256
{
- typedef AesNI_AES256_Block Block;
- typedef AesNI_AES256_RoundKeys RoundKeys;
- typedef AesNI_AES256_Key Key;
+ typedef AES_AES256_Block Block;
+ typedef AES_AES256_RoundKeys RoundKeys;
+ typedef AES_AES256_Key Key;
}
template <>
- struct Types<AESNI_AES256>
+ struct Types<AES_AES256>
{
typedef aes256::Block Block;
typedef aes256::RoundKeys RoundKeys;
@@ -207,72 +207,72 @@ namespace aesni
};
template <>
- std::size_t get_number_of_rounds<AESNI_AES256>()
+ std::size_t get_number_of_rounds<AES_AES256>()
{
return 15;
}
template <>
- void from_string<AESNI_AES256>(aes256::Block& dest, const char* src)
+ void from_string<AES_AES256>(aes256::Block& dest, const char* src)
{
- aesni_AES256_parse_block(&dest, src, ErrorDetailsThrowsInDestructor());
+ aes_AES256_parse_block(&dest, src, ErrorDetailsThrowsInDestructor());
}
template <>
- std::string to_string<AESNI_AES256>(const aes256::Block& src)
+ std::string to_string<AES_AES256>(const aes256::Block& src)
{
- AesNI_AES256_BlockString str;
- aesni_AES256_format_block(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES256_BlockString str;
+ aes_AES256_format_block(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- std::string to_matrix_string<AESNI_AES256>(const aes256::Block& src)
+ std::string to_matrix_string<AES_AES256>(const aes256::Block& src)
{
- AesNI_AES256_BlockMatrixString str;
- aesni_AES256_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES256_BlockMatrixString str;
+ aes_AES256_format_block_as_matrix(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- void from_string<AESNI_AES256>(aes256::Key& dest, const char* src)
+ void from_string<AES_AES256>(aes256::Key& dest, const char* src)
{
- aesni_AES256_parse_key(&dest, src, ErrorDetailsThrowsInDestructor());
+ aes_AES256_parse_key(&dest, src, ErrorDetailsThrowsInDestructor());
}
template <>
- std::string to_string<AESNI_AES256>(const aes256::Key& src)
+ std::string to_string<AES_AES256>(const aes256::Key& src)
{
- AesNI_AES256_KeyString str;
- aesni_AES256_format_key(&str, &src, ErrorDetailsThrowsInDestructor());
+ AES_AES256_KeyString str;
+ aes_AES256_format_key(&str, &src, ErrorDetailsThrowsInDestructor());
return { str.str };
}
template <>
- inline void expand_key<AESNI_AES256>(
+ inline void expand_key<AES_AES256>(
const aes256::Key& key,
aes256::RoundKeys& encryption_keys)
{
- aesni_AES256_expand_key(&key, &encryption_keys);
+ aes_AES256_expand_key(&key, &encryption_keys);
}
template <>
- inline void derive_decryption_keys<AESNI_AES256>(
+ inline void derive_decryption_keys<AES_AES256>(
const aes256::RoundKeys& encryption_keys,
aes256::RoundKeys& decryption_keys)
{
- aesni_AES256_derive_decryption_keys(
+ aes_AES256_derive_decryption_keys(
&encryption_keys, &decryption_keys);
}
- AESNIXX_ENCRYPT_BLOCK_ECB(AES256);
- AESNIXX_DECRYPT_BLOCK_ECB(AES256);
- AESNIXX_ENCRYPT_BLOCK_CBC(AES256);
- AESNIXX_DECRYPT_BLOCK_CBC(AES256);
- AESNIXX_ENCRYPT_BLOCK_CFB(AES256);
- AESNIXX_DECRYPT_BLOCK_CFB(AES256);
- AESNIXX_ENCRYPT_BLOCK_OFB(AES256);
- AESNIXX_DECRYPT_BLOCK_OFB(AES256);
- AESNIXX_ENCRYPT_BLOCK_CTR(AES256);
- AESNIXX_DECRYPT_BLOCK_CTR(AES256);
+ 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);
}