aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils/decrypt_block.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-09-01 02:53:39 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-09-01 02:53:39 +0300
commit32f8a474fdfe5ed1a5a9dfc34fa2dd41e1a6d9c1 (patch)
tree4d7eec934fd76754dfa0e28868f3f67601ba9d05 /utils/decrypt_block.cpp
parentcxx: Boost.Config for compiler workarounds (diff)
downloadaes-tools-32f8a474fdfe5ed1a5a9dfc34fa2dd41e1a6d9c1.tar.gz
aes-tools-32f8a474fdfe5ed1a5a9dfc34fa2dd41e1a6d9c1.zip
refactoring
Diffstat (limited to '')
-rw-r--r--utils/decrypt_block.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/utils/decrypt_block.cpp b/utils/decrypt_block.cpp
index 6159eb5..7c8e773 100644
--- a/utils/decrypt_block.cpp
+++ b/utils/decrypt_block.cpp
@@ -131,7 +131,7 @@ namespace
template <aesni::Algorithm algorithm>
bool decrypt_using_boxes_with_algorithm(
- const AesNI_BoxAlgorithmParams& algorithm_params,
+ const AesNI_BoxKey& box_key,
aesni::Mode mode,
const std::string& key,
std::deque<std::string> ciphertexts)
@@ -153,7 +153,7 @@ namespace
aesni_box_init(
&box,
algorithm,
- &algorithm_params,
+ &box_key,
mode,
iv_ptr,
aesni::ErrorDetailsThrowsInDestructor());
@@ -183,27 +183,27 @@ namespace
const std::string& key,
std::deque<std::string> ciphertexts)
{
- AesNI_BoxAlgorithmParams algorithm_params;
+ AesNI_BoxKey box_key;
switch (algorithm)
{
case AESNI_AES128:
aesni::from_string<AESNI_AES128>(
- algorithm_params.aes128_key, key);
+ box_key.aes128_key, key);
return decrypt_using_boxes_with_algorithm<AESNI_AES128>(
- algorithm_params, mode, key, ciphertexts);
+ box_key, mode, key, ciphertexts);
case AESNI_AES192:
aesni::from_string<AESNI_AES192>(
- algorithm_params.aes192_key, key);
+ box_key.aes192_key, key);
return decrypt_using_boxes_with_algorithm<AESNI_AES192>(
- algorithm_params, mode, key, ciphertexts);
+ box_key, mode, key, ciphertexts);
case AESNI_AES256:
aesni::from_string<AESNI_AES256>(
- algorithm_params.aes256_key, key);
+ box_key.aes256_key, key);
return decrypt_using_boxes_with_algorithm<AESNI_AES256>(
- algorithm_params, mode, key, ciphertexts);
+ box_key, mode, key, ciphertexts);
default:
return false;