From f0393777befc4ff1024513dab3ab6bad0e7ec45f Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 19 May 2016 04:48:59 +0300 Subject: 'aesni' -> 'aes' --- cxx/include/aesxx/mode.hpp | 150 ++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 75 deletions(-) (limited to 'cxx/include/aesxx/mode.hpp') diff --git a/cxx/include/aesxx/mode.hpp b/cxx/include/aesxx/mode.hpp index 706c4b5..70f16c6 100644 --- a/cxx/include/aesxx/mode.hpp +++ b/cxx/include/aesxx/mode.hpp @@ -12,16 +12,16 @@ #include -namespace aesni +namespace aes { - typedef AesNI_Mode Mode; + typedef AES_Mode Mode; template struct ModeRequiresInitializationVector : public std::true_type { }; template <> - struct ModeRequiresInitializationVector : public std::false_type + struct ModeRequiresInitializationVector : public std::false_type { }; template @@ -30,127 +30,127 @@ namespace aesni inline bool mode_requires_initialization_vector(Mode mode) { - return mode != AESNI_ECB; + return mode != AES_ECB; } template <> - struct ModeUsesEncryptionKeysOnly : public std::false_type + struct ModeUsesEncryptionKeysOnly : public std::false_type { }; template <> - struct ModeUsesEncryptionKeysOnly : public std::false_type + struct ModeUsesEncryptionKeysOnly : public std::false_type { }; inline bool mode_uses_encryption_keys_only(Mode mode) { - return mode != AESNI_ECB && mode != AESNI_CBC; + return mode != AES_ECB && mode != AES_CBC; } -#define AESNIXX_ENCRYPT_BLOCK_ECB(prefix) \ +#define AESXX_ENCRYPT_BLOCK_ECB(prefix) \ template <> \ - inline void encrypt_block( \ - const typename Types::Block& plaintext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& ciphertext) \ + inline void encrypt_block( \ + const typename Types::Block& plaintext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& ciphertext) \ { \ - ciphertext = aesni_## prefix ##_encrypt_block_ECB(plaintext, &encryption_keys); \ + ciphertext = aes_## prefix ##_encrypt_block_ECB(plaintext, &encryption_keys); \ } -#define AESNIXX_DECRYPT_BLOCK_ECB(prefix) \ +#define AESXX_DECRYPT_BLOCK_ECB(prefix) \ template <> \ - inline void decrypt_block( \ - const typename Types::Block& ciphertext, \ - const typename Types::RoundKeys& decryption_keys, \ - typename Types::Block& plaintext) \ + inline void decrypt_block( \ + const typename Types::Block& ciphertext, \ + const typename Types::RoundKeys& decryption_keys, \ + typename Types::Block& plaintext) \ { \ - plaintext = aesni_## prefix ##_decrypt_block_ECB(ciphertext, &decryption_keys); \ + plaintext = aes_## prefix ##_decrypt_block_ECB(ciphertext, &decryption_keys); \ } -#define AESNIXX_ENCRYPT_BLOCK_CBC(prefix) \ +#define AESXX_ENCRYPT_BLOCK_CBC(prefix) \ template <> \ - inline void encrypt_block( \ - const typename Types::Block& plaintext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& ciphertext) \ + inline void encrypt_block( \ + const typename Types::Block& plaintext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& ciphertext) \ { \ - ciphertext = aesni_## prefix ##_encrypt_block_CBC(plaintext, &encryption_keys, iv, &iv); \ + ciphertext = aes_## prefix ##_encrypt_block_CBC(plaintext, &encryption_keys, iv, &iv); \ } -#define AESNIXX_DECRYPT_BLOCK_CBC(prefix) \ +#define AESXX_DECRYPT_BLOCK_CBC(prefix) \ template <> \ - inline void decrypt_block( \ - const typename Types::Block& ciphertext, \ - const typename Types::RoundKeys& decryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& plaintext) \ + inline void decrypt_block( \ + const typename Types::Block& ciphertext, \ + const typename Types::RoundKeys& decryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& plaintext) \ { \ - plaintext = aesni_## prefix ##_decrypt_block_CBC(ciphertext, &decryption_keys, iv, &iv); \ + plaintext = aes_## prefix ##_decrypt_block_CBC(ciphertext, &decryption_keys, iv, &iv); \ } -#define AESNIXX_ENCRYPT_BLOCK_CFB(prefix) \ +#define AESXX_ENCRYPT_BLOCK_CFB(prefix) \ template <> \ - inline void encrypt_block( \ - const typename Types::Block& plaintext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& ciphertext) \ + inline void encrypt_block( \ + const typename Types::Block& plaintext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& ciphertext) \ { \ - ciphertext = aesni_## prefix ##_encrypt_block_CFB(plaintext, &encryption_keys, iv, &iv); \ + ciphertext = aes_## prefix ##_encrypt_block_CFB(plaintext, &encryption_keys, iv, &iv); \ } -#define AESNIXX_DECRYPT_BLOCK_CFB(prefix) \ +#define AESXX_DECRYPT_BLOCK_CFB(prefix) \ template <> \ - inline void decrypt_block( \ - const typename Types::Block& ciphertext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& plaintext) \ + inline void decrypt_block( \ + const typename Types::Block& ciphertext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& plaintext) \ { \ - plaintext = aesni_## prefix ##_decrypt_block_CFB(ciphertext, &encryption_keys, iv, &iv); \ + plaintext = aes_## prefix ##_decrypt_block_CFB(ciphertext, &encryption_keys, iv, &iv); \ } -#define AESNIXX_ENCRYPT_BLOCK_OFB(prefix) \ +#define AESXX_ENCRYPT_BLOCK_OFB(prefix) \ template <> \ - inline void encrypt_block( \ - const typename Types::Block& plaintext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& ciphertext) \ + inline void encrypt_block( \ + const typename Types::Block& plaintext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& ciphertext) \ { \ - ciphertext = aesni_## prefix ##_encrypt_block_OFB(plaintext, &encryption_keys, iv, &iv); \ + ciphertext = aes_## prefix ##_encrypt_block_OFB(plaintext, &encryption_keys, iv, &iv); \ } -#define AESNIXX_DECRYPT_BLOCK_OFB(prefix) \ +#define AESXX_DECRYPT_BLOCK_OFB(prefix) \ template <> \ - inline void decrypt_block( \ - const typename Types::Block& ciphertext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& plaintext) \ + inline void decrypt_block( \ + const typename Types::Block& ciphertext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& plaintext) \ { \ - plaintext = aesni_## prefix ##_decrypt_block_OFB(ciphertext, &encryption_keys, iv, &iv); \ + plaintext = aes_## prefix ##_decrypt_block_OFB(ciphertext, &encryption_keys, iv, &iv); \ } -#define AESNIXX_ENCRYPT_BLOCK_CTR(prefix) \ +#define AESXX_ENCRYPT_BLOCK_CTR(prefix) \ template <> \ - inline void encrypt_block( \ - const typename Types::Block& plaintext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& ciphertext) \ + inline void encrypt_block( \ + const typename Types::Block& plaintext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& ciphertext) \ { \ - ciphertext = aesni_## prefix ##_encrypt_block_CTR(plaintext, &encryption_keys, iv, &iv); \ + ciphertext = aes_## prefix ##_encrypt_block_CTR(plaintext, &encryption_keys, iv, &iv); \ } -#define AESNIXX_DECRYPT_BLOCK_CTR(prefix) \ +#define AESXX_DECRYPT_BLOCK_CTR(prefix) \ template <> \ - inline void decrypt_block( \ - const typename Types::Block& ciphertext, \ - const typename Types::RoundKeys& encryption_keys, \ - typename Types::Block& iv, \ - typename Types::Block& plaintext) \ + inline void decrypt_block( \ + const typename Types::Block& ciphertext, \ + const typename Types::RoundKeys& encryption_keys, \ + typename Types::Block& iv, \ + typename Types::Block& plaintext) \ { \ - plaintext = aesni_## prefix ##_decrypt_block_CTR(ciphertext, &encryption_keys, iv, &iv); \ + plaintext = aes_## prefix ##_decrypt_block_CTR(ciphertext, &encryption_keys, iv, &iv); \ } } -- cgit v1.2.3