aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/aesxx/include
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-07-21 14:44:58 +0200
committerEgor Tensin <egor@tensin.name>2026-07-21 15:03:00 +0200
commit31b275f8c201570af8a22dfe8c5ceaa9624b638c (patch)
tree8e11af31ec04c7c91b512a548bf23a61bc752d8b /aesxx/include
parentaes: minor refactoring (diff)
downloadaes-tools-31b275f8c201570af8a22dfe8c5ceaa9624b638c.tar.gz
aes-tools-31b275f8c201570af8a22dfe8c5ceaa9624b638c.zip
blocks are the same for every variant
Diffstat (limited to 'aesxx/include')
-rw-r--r--aesxx/include/aesxx/box.hpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/aesxx/include/aesxx/box.hpp b/aesxx/include/aesxx/box.hpp
index 72e3be2..5bd17de 100644
--- a/aesxx/include/aesxx/box.hpp
+++ b/aesxx/include/aesxx/box.hpp
@@ -20,7 +20,7 @@ namespace aes {
class Box {
public:
- typedef AES_BoxBlock Block;
+ typedef AES_Block Block;
typedef AES_BoxKey Key;
static std::string format_key(const Key& src, Algorithm algorithm) {
@@ -29,14 +29,14 @@ public:
return reinterpret_cast<const char*>(&str);
}
- static std::string format_block(const Block& src, Algorithm algorithm) {
- AES_BoxBlockString str;
- aes_box_format_block(&str, algorithm, &src, ErrorDetailsThrowsInDestructor{});
+ static std::string format_block(const Block& src) {
+ AES_BlockString str;
+ aes_AES_format_block(&str, &src, ErrorDetailsThrowsInDestructor{});
return reinterpret_cast<const char*>(&str);
}
- static void parse_block(Block& dest, Algorithm algorithm, std::string_view src) {
- aes_box_parse_block(&dest, algorithm, src.data(), ErrorDetailsThrowsInDestructor{});
+ static void parse_block(Block& dest, std::string_view src) {
+ aes_AES_parse_block(&dest, src.data(), ErrorDetailsThrowsInDestructor{});
}
static void parse_key(Key& dest, Algorithm algorithm, std::string_view src) {
@@ -106,18 +106,10 @@ public:
return dest_buf;
}
- std::string format_block(const Block& src) {
- return format_block(src, get_algorithm());
- }
-
std::string format_key(const Key& src) {
return format_key(src, get_algorithm());
}
- void parse_block(Block& dest, std::string_view src) {
- parse_block(dest, get_algorithm(), src);
- }
-
void parse_key(Key& dest, std::string_view src) {
parse_key(dest, get_algorithm(), src);
}