diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-25 19:56:14 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-25 19:56:14 +0300 |
commit | a151a774f4ce6c4b13c819502efcfe919bbf050b (patch) | |
tree | 5cbed50713e2ea176c04327560b51df65bcd8b54 /cxx/include | |
parent | utils: code style (diff) | |
download | aes-tools-a151a774f4ce6c4b13c819502efcfe919bbf050b.tar.gz aes-tools-a151a774f4ce6c4b13c819502efcfe919bbf050b.zip |
code style
Diffstat (limited to '')
-rw-r--r-- | cxx/include/aesxx/aes.hpp | 36 | ||||
-rw-r--r-- | cxx/include/aesxx/api.hpp | 24 | ||||
-rw-r--r-- | cxx/include/aesxx/error.hpp | 2 |
3 files changed, 31 insertions, 31 deletions
diff --git a/cxx/include/aesxx/aes.hpp b/cxx/include/aesxx/aes.hpp index d1f68d2..efac790 100644 --- a/cxx/include/aesxx/aes.hpp +++ b/cxx/include/aesxx/aes.hpp @@ -34,19 +34,19 @@ namespace aes }; template <> - std::size_t get_number_of_rounds<AES_AES128>() + inline std::size_t get_number_of_rounds<AES_AES128>() { return 11; } template <> - void from_string<AES_AES128>(aes128::Block& dest, const char* src) + inline void from_string<AES_AES128>(aes128::Block& dest, const char* src) { aes_AES128_parse_block(&dest, src, ErrorDetailsThrowsInDestructor{}); } template <> - std::string to_string<AES_AES128>(const aes128::Block& src) + inline std::string to_string<AES_AES128>(const aes128::Block& src) { AES_AES128_BlockString str; aes_AES128_format_block(&str, &src, ErrorDetailsThrowsInDestructor{}); @@ -54,7 +54,7 @@ namespace aes } template <> - std::string to_matrix_string<AES_AES128>(const aes128::Block& src) + 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{}); @@ -62,13 +62,13 @@ namespace aes } template <> - void from_string<AES_AES128>(aes128::Key& dest, const char* src) + inline void from_string<AES_AES128>(aes128::Key& dest, const char* src) { aes_AES128_parse_key(&dest, src, ErrorDetailsThrowsInDestructor{}); } template <> - std::string to_string<AES_AES128>(const aes128::Key& src) + inline std::string to_string<AES_AES128>(const aes128::Key& src) { AES_AES128_KeyString str; aes_AES128_format_key(&str, &src, ErrorDetailsThrowsInDestructor{}); @@ -119,19 +119,19 @@ namespace aes }; template <> - std::size_t get_number_of_rounds<AES_AES192>() + inline std::size_t get_number_of_rounds<AES_AES192>() { return 13; } template <> - void from_string<AES_AES192>(aes192::Block& dest, const char* src) + inline void from_string<AES_AES192>(aes192::Block& dest, const char* src) { aes_AES192_parse_block(&dest, src, ErrorDetailsThrowsInDestructor{}); } template <> - std::string to_string<AES_AES192>(const aes192::Block& src) + inline std::string to_string<AES_AES192>(const aes192::Block& src) { AES_AES192_BlockString str; aes_AES192_format_block(&str, &src, ErrorDetailsThrowsInDestructor{}); @@ -139,7 +139,7 @@ namespace aes } template <> - std::string to_matrix_string<AES_AES192>(const aes192::Block& src) + 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{}); @@ -147,13 +147,13 @@ namespace aes } template <> - void from_string<AES_AES192>(aes192::Key& dest, const char* src) + inline void from_string<AES_AES192>(aes192::Key& dest, const char* src) { aes_AES192_parse_key(&dest, src, ErrorDetailsThrowsInDestructor{}); } template <> - std::string to_string<AES_AES192>(const aes192::Key& src) + inline std::string to_string<AES_AES192>(const aes192::Key& src) { AES_AES192_KeyString str; aes_AES192_format_key(&str, &src, ErrorDetailsThrowsInDestructor{}); @@ -204,19 +204,19 @@ namespace aes }; template <> - std::size_t get_number_of_rounds<AES_AES256>() + inline std::size_t get_number_of_rounds<AES_AES256>() { return 15; } template <> - void from_string<AES_AES256>(aes256::Block& dest, const char* src) + inline void from_string<AES_AES256>(aes256::Block& dest, const char* src) { aes_AES256_parse_block(&dest, src, ErrorDetailsThrowsInDestructor{}); } template <> - std::string to_string<AES_AES256>(const aes256::Block& src) + inline std::string to_string<AES_AES256>(const aes256::Block& src) { AES_AES256_BlockString str; aes_AES256_format_block(&str, &src, ErrorDetailsThrowsInDestructor{}); @@ -224,7 +224,7 @@ namespace aes } template <> - std::string to_matrix_string<AES_AES256>(const aes256::Block& src) + 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{}); @@ -232,13 +232,13 @@ namespace aes } template <> - void from_string<AES_AES256>(aes256::Key& dest, const char* src) + inline void from_string<AES_AES256>(aes256::Key& dest, const char* src) { aes_AES256_parse_key(&dest, src, ErrorDetailsThrowsInDestructor{}); } template <> - std::string to_string<AES_AES256>(const aes256::Key& src) + inline std::string to_string<AES_AES256>(const aes256::Key& src) { AES_AES256_KeyString str; aes_AES256_format_key(&str, &src, ErrorDetailsThrowsInDestructor{}); diff --git a/cxx/include/aesxx/api.hpp b/cxx/include/aesxx/api.hpp index 2d0871f..789320f 100644 --- a/cxx/include/aesxx/api.hpp +++ b/cxx/include/aesxx/api.hpp @@ -27,7 +27,7 @@ namespace aes const char*); template <Algorithm algorithm> - inline void from_string( + void from_string( typename Types<algorithm>::Block& dest, const std::string& src) { @@ -46,7 +46,7 @@ namespace aes const char*); template <Algorithm algorithm> - inline void from_string( + void from_string( typename Types<algorithm>::Key& dest, const std::string& src) { @@ -57,30 +57,30 @@ namespace aes std::string to_string(const typename Types<algorithm>::Key&); template <Algorithm algorithm> - inline void expand_key( + void expand_key( const typename Types<algorithm>::Key& key, typename Types<algorithm>::RoundKeys& encryption_keys); template <Algorithm algorithm> - inline void derive_decryption_keys( + void derive_decryption_keys( const typename Types<algorithm>::RoundKeys& encryption_keys, typename Types<algorithm>::RoundKeys& decryption_keys); template <Algorithm algorithm, Mode mode, typename std::enable_if<ModeRequiresInitVector<mode>::value>::type* = nullptr> - inline void encrypt_block( + void encrypt_block( const typename Types<algorithm>::Block& plaintext, const typename Types<algorithm>::RoundKeys& round_keys, typename Types<algorithm>::Block& iv, typename Types<algorithm>::Block& ciphertext); template <Algorithm algorithm, Mode mode, typename std::enable_if<!ModeRequiresInitVector<mode>::value>::type* = nullptr> - inline void encrypt_block( + void encrypt_block( const typename Types<algorithm>::Block& plaintext, const typename Types<algorithm>::RoundKeys& round_keys, typename Types<algorithm>::Block& ciphertext); template <Algorithm algorithm, Mode mode, typename std::enable_if<!ModeRequiresInitVector<mode>::value>::type* = nullptr> - inline void encrypt_block( + void encrypt_block( const typename Types<algorithm>::Block& plaintext, const typename Types<algorithm>::RoundKeys& round_keys, typename Types<algorithm>::Block&, @@ -90,20 +90,20 @@ namespace aes } template <Algorithm algorithm, Mode mode, typename std::enable_if<ModeRequiresInitVector<mode>::value>::type* = nullptr> - inline void decrypt_block( + void decrypt_block( const typename Types<algorithm>::Block& ciphertext, const typename Types<algorithm>::RoundKeys& round_keys, typename Types<algorithm>::Block& iv, typename Types<algorithm>::Block& plaintext); template <Algorithm algorithm, Mode mode, typename std::enable_if<!ModeRequiresInitVector<mode>::value>::type* = nullptr> - inline void decrypt_block( + void decrypt_block( const typename Types<algorithm>::Block& ciphertext, const typename Types<algorithm>::RoundKeys& round_keys, typename Types<algorithm>::Block& plaintext); template <Algorithm algorithm, Mode mode, typename std::enable_if<!ModeRequiresInitVector<mode>::value>::type* = nullptr> - inline void decrypt_block( + void decrypt_block( const typename Types<algorithm>::Block& ciphertext, const typename Types<algorithm>::RoundKeys& round_keys, typename Types<algorithm>::Block&, @@ -122,7 +122,7 @@ namespace aes expand_key<algorithm>(key, encryption_keys); } - inline void encrypt_block( + void encrypt_block( const typename Types<algorithm>::Block& plaintext, typename Types<algorithm>::Block& ciphertext) { @@ -154,7 +154,7 @@ namespace aes } } - inline void decrypt_block( + void decrypt_block( const typename Types<algorithm>::Block& ciphertext, typename Types<algorithm>::Block& plaintext) { diff --git a/cxx/include/aesxx/error.hpp b/cxx/include/aesxx/error.hpp index 21f65d5..4d2c783 100644 --- a/cxx/include/aesxx/error.hpp +++ b/cxx/include/aesxx/error.hpp @@ -69,7 +69,7 @@ namespace aes const void* call_stack[AES_MAX_CALL_STACK_LENGTH] = {nullptr}; }; - std::ostream& operator<<(std::ostream& os, const Error& error) + inline std::ostream& operator<<(std::ostream& os, const Error& error) { os << "AES error: " << error.what() << '\n'; os << "Call stack:\n"; |