From bb078fd01e6568982044e0f846029b9670f7f6df Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 27 Jul 2017 23:45:04 +0200 Subject: code style --- cxx/include/aesxx/api.hpp | 22 ++++++++++++++-------- cxx/include/aesxx/box.hpp | 14 ++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) (limited to 'cxx/include/aesxx') diff --git a/cxx/include/aesxx/api.hpp b/cxx/include/aesxx/api.hpp index 789320f..68112bf 100644 --- a/cxx/include/aesxx/api.hpp +++ b/cxx/include/aesxx/api.hpp @@ -66,20 +66,23 @@ namespace aes const typename Types::RoundKeys& encryption_keys, typename Types::RoundKeys& decryption_keys); - template ::value>::type* = nullptr> + template ::value>::type* = nullptr> void encrypt_block( const typename Types::Block& plaintext, const typename Types::RoundKeys& round_keys, typename Types::Block& iv, typename Types::Block& ciphertext); - template ::value>::type* = nullptr> + template ::value>::type* = nullptr> void encrypt_block( const typename Types::Block& plaintext, const typename Types::RoundKeys& round_keys, typename Types::Block& ciphertext); - template ::value>::type* = nullptr> + template ::value>::type* = nullptr> void encrypt_block( const typename Types::Block& plaintext, const typename Types::RoundKeys& round_keys, @@ -89,20 +92,23 @@ namespace aes encrypt_block(plaintext, round_keys, ciphertext); } - template ::value>::type* = nullptr> + template ::value>::type* = nullptr> void decrypt_block( const typename Types::Block& ciphertext, const typename Types::RoundKeys& round_keys, typename Types::Block& iv, typename Types::Block& plaintext); - template ::value>::type* = nullptr> + template ::value>::type* = nullptr> void decrypt_block( const typename Types::Block& ciphertext, const typename Types::RoundKeys& round_keys, typename Types::Block& plaintext); - template ::value>::type* = nullptr> + template ::value>::type* = nullptr> void decrypt_block( const typename Types::Block& ciphertext, const typename Types::RoundKeys& round_keys, @@ -117,7 +123,7 @@ namespace aes { EncryptWrapper( const typename Types::Key& key, - const typename Types::Block& iv) : iv(iv) + const typename Types::Block& iv) : iv{iv} { expand_key(key, encryption_keys); } @@ -139,7 +145,7 @@ namespace aes { DecryptWrapper( const typename Types::Key& key, - const typename Types::Block& iv) : iv(iv) + const typename Types::Block& iv) : iv{iv} { typename Types::RoundKeys encryption_keys; expand_key(key, encryption_keys); diff --git a/cxx/include/aesxx/box.hpp b/cxx/include/aesxx/box.hpp index 3d9529b..076407c 100644 --- a/cxx/include/aesxx/box.hpp +++ b/cxx/include/aesxx/box.hpp @@ -11,10 +11,8 @@ #include -#include #include -#include #include #include @@ -77,16 +75,16 @@ namespace aes } Box(Algorithm algorithm, const Key& key) - : algorithm(algorithm) - , mode(AES_ECB) + : algorithm{algorithm} + , mode{AES_ECB} { aes_box_init(&impl, algorithm, &key, mode, nullptr, ErrorDetailsThrowsInDestructor{}); } Box(Algorithm algorithm, const Key& key, Mode mode, const Block& iv) - : algorithm(algorithm) - , mode(mode) + : algorithm{algorithm} + , mode{mode} { aes_box_init(&impl, algorithm, &key, mode, &iv, ErrorDetailsThrowsInDestructor{}); @@ -110,7 +108,7 @@ namespace aes const void* src_buf, std::size_t src_size) { - std::size_t dest_size; + std::size_t dest_size = 0; aes_box_encrypt_buffer( &impl, @@ -139,7 +137,7 @@ namespace aes const void* src_buf, std::size_t src_size) { - std::size_t dest_size; + std::size_t dest_size = 0; aes_box_decrypt_buffer( &impl, -- cgit v1.2.3