diff options
| author | Egor Tensin <egor@tensin.name> | 2026-07-21 18:57:25 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-07-21 18:57:25 +0200 |
| commit | 27d80744b46b6476ce4761a6199e6293d41c91ab (patch) | |
| tree | d30f336682a24520c628a15fc84bcfbd1501199d /aesxx/include | |
| parent | aes/box: remove useless interface method (diff) | |
| download | aes-tools-27d80744b46b6476ce4761a6199e6293d41c91ab.tar.gz aes-tools-27d80744b46b6476ce4761a6199e6293d41c91ab.zip | |
minor refactoring
Diffstat (limited to 'aesxx/include')
| -rw-r--r-- | aesxx/include/aesxx/box.hpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/aesxx/include/aesxx/box.hpp b/aesxx/include/aesxx/box.hpp index e34c241..870b3a7 100644 --- a/aesxx/include/aesxx/box.hpp +++ b/aesxx/include/aesxx/box.hpp @@ -43,12 +43,11 @@ public: aes_box_parse_key(&dest, algorithm, src.data(), ErrorDetailsThrowsInDestructor{}); } - Box(Algorithm algorithm, const Key& key) : algorithm{algorithm}, mode{AES_ECB} { - aes_box_init(&impl, algorithm, &key, mode, nullptr, ErrorDetailsThrowsInDestructor{}); + Box(Algorithm algorithm, const Key& key) { + aes_box_init(&impl, algorithm, &key, AES_ECB, nullptr, ErrorDetailsThrowsInDestructor{}); } - Box(Algorithm algorithm, const Key& key, Mode mode, const Block& iv) - : algorithm{algorithm}, mode{mode} { + Box(Algorithm algorithm, const Key& key, Mode mode, const Block& iv) { aes_box_init(&impl, algorithm, &key, mode, &iv, ErrorDetailsThrowsInDestructor{}); } @@ -115,19 +114,16 @@ public: } Algorithm get_algorithm() const { - return algorithm; + return impl.algorithm; } Mode get_mode() const { - return mode; + return impl.mode; } private: Key key; - Algorithm algorithm; - Mode mode; - AES_Box impl; }; |
