aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-06-21 19:51:34 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-06-21 19:51:34 +0300
commitbe612cbab27967afcc60175ce78ea88b7108659e (patch)
treeb7715ddd869bb14e4492e4b0fafadc52886da7de /utils
parentREADME updates (diff)
downloadaes-tools-be612cbab27967afcc60175ce78ea88b7108659e.tar.gz
aes-tools-be612cbab27967afcc60175ce78ea88b7108659e.zip
fix GCC errors
Diffstat (limited to '')
-rw-r--r--utils/block_dumper.hpp8
-rw-r--r--utils/decrypt_block.cpp10
-rw-r--r--utils/decrypt_bmp.cpp12
-rw-r--r--utils/decrypt_file.cpp12
-rw-r--r--utils/encrypt_block.cpp8
-rw-r--r--utils/encrypt_bmp.cpp12
-rw-r--r--utils/encrypt_file.cpp12
7 files changed, 28 insertions, 46 deletions
diff --git a/utils/block_dumper.hpp b/utils/block_dumper.hpp
index d2b76bf..d344cda 100644
--- a/utils/block_dumper.hpp
+++ b/utils/block_dumper.hpp
@@ -82,26 +82,26 @@ namespace
dump_decryption_keys<algorithm>(wrapper.decryption_keys);
}
- template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<aes::ModeRequiresInitializationVector<mode>::value>::type* = 0>
+ template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<aes::ModeRequiresInitializationVector<mode>::value>::type* = nullptr>
void dump_next_iv(
const aes::EncryptWrapper<algorithm, mode>& wrapper)
{
dump_block<algorithm>("Next initialization vector", wrapper.iv);
}
- template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<!aes::ModeRequiresInitializationVector<mode>::value>::type* = 0>
+ template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<!aes::ModeRequiresInitializationVector<mode>::value>::type* = nullptr>
void dump_next_iv(
const aes::EncryptWrapper<algorithm, mode>&)
{ }
- template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<aes::ModeRequiresInitializationVector<mode>::value>::type* = 0>
+ template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<aes::ModeRequiresInitializationVector<mode>::value>::type* = nullptr>
void dump_next_iv(
const aes::DecryptWrapper<algorithm, mode>& wrapper)
{
dump_block<algorithm>("Next initialization vector", wrapper.iv);
}
- template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<!aes::ModeRequiresInitializationVector<mode>::value>::type* = 0>
+ template <aes::Algorithm algorithm, aes::Mode mode, typename std::enable_if<!aes::ModeRequiresInitializationVector<mode>::value>::type* = nullptr>
void dump_next_iv(
const aes::DecryptWrapper<algorithm, mode>&)
{ }
diff --git a/utils/decrypt_block.cpp b/utils/decrypt_block.cpp
index 2029669..6cc9c0a 100644
--- a/utils/decrypt_block.cpp
+++ b/utils/decrypt_block.cpp
@@ -151,16 +151,14 @@ namespace
{
aes::Box::Block iv;
aes::Box::parse_block(iv, algorithm, input.get_iv_string());
+ aes::Box box{ algorithm, key, mode, iv };
- decrypt_using_particular_box(
- aes::Box(algorithm, key, mode, iv),
- input.get_input_block_strings());
+ decrypt_using_particular_box(box, input.get_input_block_strings());
}
else
{
- decrypt_using_particular_box(
- aes::Box(algorithm, key),
- input.get_input_block_strings());
+ aes::Box box{ algorithm, key };
+ decrypt_using_particular_box(box, input.get_input_block_strings());
}
}
}
diff --git a/utils/decrypt_bmp.cpp b/utils/decrypt_bmp.cpp
index f098017..1e286e6 100644
--- a/utils/decrypt_bmp.cpp
+++ b/utils/decrypt_bmp.cpp
@@ -98,18 +98,14 @@ namespace
{
aes::Box::Block iv;
aes::Box::parse_block(iv, algorithm, settings.get_iv_string());
+ aes::Box box{ algorithm, key, mode, iv };
- decrypt_bmp(
- aes::Box(algorithm, key, mode, iv),
- ciphertext_path,
- plaintext_path);
+ decrypt_bmp(box, ciphertext_path, plaintext_path);
}
else
{
- decrypt_bmp(
- aes::Box(algorithm, key),
- ciphertext_path,
- plaintext_path);
+ aes::Box box{ algorithm, key };
+ decrypt_bmp(box, ciphertext_path, plaintext_path);
}
}
}
diff --git a/utils/decrypt_file.cpp b/utils/decrypt_file.cpp
index 33083b7..cd955bb 100644
--- a/utils/decrypt_file.cpp
+++ b/utils/decrypt_file.cpp
@@ -83,18 +83,14 @@ namespace
{
aes::Box::Block iv;
aes::Box::parse_block(iv, algorithm, settings.get_iv_string());
+ aes::Box box{ algorithm, key, mode, iv };
- decrypt_file(
- aes::Box(algorithm, key, mode, iv),
- ciphertext_path,
- plaintext_path);
+ decrypt_file(box, ciphertext_path, plaintext_path);
}
else
{
- decrypt_file(
- aes::Box(algorithm, key),
- ciphertext_path,
- plaintext_path);
+ aes::Box box{ algorithm, key };
+ decrypt_file(box, ciphertext_path, plaintext_path);
}
}
}
diff --git a/utils/encrypt_block.cpp b/utils/encrypt_block.cpp
index ac6a45a..da33612 100644
--- a/utils/encrypt_block.cpp
+++ b/utils/encrypt_block.cpp
@@ -151,14 +151,14 @@ namespace
{
aes::Box::Block iv;
aes::Box::parse_block(iv, algorithm, input.get_iv_string());
+ aes::Box box{ algorithm, key, mode, iv };
- encrypt_using_particular_box(
- aes::Box(algorithm, key, mode, iv), input.get_input_block_strings());
+ encrypt_using_particular_box(box, input.get_input_block_strings());
}
else
{
- encrypt_using_particular_box(
- aes::Box(algorithm, key), input.get_input_block_strings());
+ aes::Box box{ algorithm, key };
+ encrypt_using_particular_box(box, input.get_input_block_strings());
}
}
}
diff --git a/utils/encrypt_bmp.cpp b/utils/encrypt_bmp.cpp
index 086e14d..67ec412 100644
--- a/utils/encrypt_bmp.cpp
+++ b/utils/encrypt_bmp.cpp
@@ -98,18 +98,14 @@ namespace
{
aes::Box::Block iv;
aes::Box::parse_block(iv, algorithm, settings.get_iv_string());
+ aes::Box box{ algorithm, key, mode, iv };
- encrypt_bmp(
- aes::Box(algorithm, key, mode, iv),
- plaintext_path,
- ciphertext_path);
+ encrypt_bmp(box, plaintext_path, ciphertext_path);
}
else
{
- encrypt_bmp(
- aes::Box(algorithm, key),
- plaintext_path,
- ciphertext_path);
+ aes::Box box{ algorithm, key };
+ encrypt_bmp(box, plaintext_path, ciphertext_path);
}
}
}
diff --git a/utils/encrypt_file.cpp b/utils/encrypt_file.cpp
index 9a3dda8..4161e92 100644
--- a/utils/encrypt_file.cpp
+++ b/utils/encrypt_file.cpp
@@ -83,18 +83,14 @@ namespace
{
aes::Box::Block iv;
aes::Box::parse_block(iv, algorithm, settings.get_iv_string());
+ aes::Box box{ algorithm, key, mode, iv };
- encrypt_file(
- aes::Box(algorithm, key, mode, iv),
- plaintext_path,
- ciphertext_path);
+ encrypt_file(box, plaintext_path, ciphertext_path);
}
else
{
- encrypt_file(
- aes::Box(algorithm, key),
- plaintext_path,
- ciphertext_path);
+ aes::Box box{ algorithm, key };
+ encrypt_file(box, plaintext_path, ciphertext_path);
}
}
}