aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils/decrypt_block.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-05-04 04:08:15 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-05-04 04:08:15 +0300
commit188460a91bd37ca6f18fb89e448819b642953be7 (patch)
tree12fa7b29fa207240fe8ddf19d70f5a5333bf1233 /utils/decrypt_block.cpp
parentrefactoring (diff)
downloadaes-tools-188460a91bd37ca6f18fb89e448819b642953be7.tar.gz
aes-tools-188460a91bd37ca6f18fb89e448819b642953be7.zip
code style & refactoring
Diffstat (limited to '')
-rw-r--r--utils/decrypt_block.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/utils/decrypt_block.cpp b/utils/decrypt_block.cpp
index 4744d49..34f8abe 100644
--- a/utils/decrypt_block.cpp
+++ b/utils/decrypt_block.cpp
@@ -27,13 +27,13 @@ namespace
if (aes::ModeRequiresInitVector<mode>())
{
- aes::from_string<algorithm>(iv, input.get_iv_string());
+ aes::from_string<algorithm>(iv, input.iv);
if (verbose)
dump_iv<algorithm>(iv);
}
typename aes::Types<algorithm>::Key key;
- aes::from_string<algorithm>(key, input.get_key_string());
+ aes::from_string<algorithm>(key, input.key);
if (verbose)
dump_key<algorithm>(key);
@@ -41,10 +41,10 @@ namespace
if (verbose)
dump_wrapper<algorithm, mode>(decrypt);
- for (const auto& input_block_string : input.get_input_block_strings())
+ for (const auto& block : input.blocks)
{
typename aes::Types<algorithm>::Block ciphertext, plaintext;
- aes::from_string<algorithm>(ciphertext, input_block_string);
+ aes::from_string<algorithm>(ciphertext, block);
decrypt.decrypt_block(ciphertext, plaintext);
@@ -123,12 +123,12 @@ namespace
void decrypt_using_particular_box(
aes::Box& box,
- const std::vector<std::string>& input_block_strings)
+ const std::vector<std::string>& blocks)
{
- for (const auto& input_block_string : input_block_strings)
+ for (const auto& block : blocks)
{
aes::Box::Block ciphertext;
- box.parse_block(ciphertext, input_block_string);
+ box.parse_block(ciphertext, block);
aes::Box::Block plaintext;
box.decrypt_block(ciphertext, plaintext);
@@ -142,20 +142,20 @@ namespace
const Input& input)
{
aes::Box::Key key;
- aes::Box::parse_key(key, algorithm, input.get_key_string());
+ aes::Box::parse_key(key, algorithm, input.key);
if (aes::mode_requires_init_vector(mode))
{
aes::Box::Block iv;
- aes::Box::parse_block(iv, algorithm, input.get_iv_string());
+ aes::Box::parse_block(iv, algorithm, input.iv);
aes::Box box{algorithm, key, mode, iv};
- decrypt_using_particular_box(box, input.get_input_block_strings());
+ decrypt_using_particular_box(box, input.blocks);
}
else
{
aes::Box box{algorithm, key};
- decrypt_using_particular_box(box, input.get_input_block_strings());
+ decrypt_using_particular_box(box, input.blocks);
}
}
}