diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-22 18:59:57 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-22 19:02:05 +0200 |
| commit | 72c774265d8d740e7fd6f5a6b8c5abff7d79237c (patch) | |
| tree | ece7008a9e32ad36922860fca24ac834b731ade4 /aesxx/utils/helpers | |
| parent | aesxx/utils: move helper headers to helpers/ (diff) | |
| download | aes-tools-72c774265d8d740e7fd6f5a6b8c5abff7d79237c.tar.gz aes-tools-72c774265d8d740e7fd6f5a6b8c5abff7d79237c.zip | |
aesxx: refactoring
Diffstat (limited to 'aesxx/utils/helpers')
| -rw-r--r-- | aesxx/utils/helpers/block_input.hpp | 24 | ||||
| -rw-r--r-- | aesxx/utils/helpers/cmd_parser_block.hpp | 27 |
2 files changed, 26 insertions, 25 deletions
diff --git a/aesxx/utils/helpers/block_input.hpp b/aesxx/utils/helpers/block_input.hpp deleted file mode 100644 index 042a680..0000000 --- a/aesxx/utils/helpers/block_input.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com> -// This file is part of the "AES tools" project. -// For details, see https://github.com/egor-tensin/aes-tools. -// Distributed under the MIT License. - -#pragma once - -#include <string> -#include <string_view> -#include <utility> -#include <vector> - -class Input { -public: - Input(std::string_view key, std::string_view iv, std::vector<std::string>&& blocks) - : key{key}, iv{iv}, blocks{std::move(blocks)} {} - - Input(std::string key, std::vector<std::string>&& blocks) - : key{key}, blocks{std::move(blocks)} {} - - const std::string key; - const std::string iv; - const std::vector<std::string> blocks; -}; diff --git a/aesxx/utils/helpers/cmd_parser_block.hpp b/aesxx/utils/helpers/cmd_parser_block.hpp index c8db431..0093617 100644 --- a/aesxx/utils/helpers/cmd_parser_block.hpp +++ b/aesxx/utils/helpers/cmd_parser_block.hpp @@ -5,7 +5,6 @@ #pragma once -#include "block_input.hpp" #include "cmd_parser.hpp" #include "data_parsers.hpp" @@ -22,6 +21,32 @@ class BlockSettings : public SettingsParser { public: + class Input { + public: + Input(std::string_view key, std::string_view iv, std::vector<std::string>&& blocks) + : key{key}, iv{iv}, blocks{std::move(blocks)} {} + + Input(std::string key, std::vector<std::string>&& blocks) + : key{key}, blocks{std::move(blocks)} {} + + std::string get_key() const { + return key; + } + + std::string get_iv() const { + return iv; + } + + std::vector<std::string> get_blocks() const { + return blocks; + } + + private: + std::string key; + std::string iv; + std::vector<std::string> blocks; + }; + aes::Algorithm algorithm = AES_AES128; aes::Mode mode = AES_ECB; |
