From 27d80744b46b6476ce4761a6199e6293d41c91ab Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 21 Jul 2026 18:57:25 +0200 Subject: minor refactoring --- aes/include/aes/box_aes.h | 6 +++--- aes/include/aes/box_data.h | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'aes/include') diff --git a/aes/include/aes/box_aes.h b/aes/include/aes/box_aes.h index 476f692..c9b9b67 100644 --- a/aes/include/aes/box_aes.h +++ b/aes/include/aes/box_aes.h @@ -11,9 +11,9 @@ extern "C" { #endif -extern AES_BoxInterface aes128_box_interface; -extern AES_BoxInterface aes192_box_interface; -extern AES_BoxInterface aes256_box_interface; +extern AES_BoxOps aes128_box_ops; +extern AES_BoxOps aes192_box_ops; +extern AES_BoxOps aes256_box_ops; #ifdef __cplusplus } diff --git a/aes/include/aes/box_data.h b/aes/include/aes/box_data.h index b0a82a5..3e49fa0 100644 --- a/aes/include/aes/box_data.h +++ b/aes/include/aes/box_data.h @@ -6,6 +6,7 @@ #pragma once #include "aes.h" +#include "algorithm.h" #include "error.h" #include "mode.h" @@ -78,14 +79,15 @@ typedef struct { AES_BoxFormatKey format_key; AES_BoxEncryptBlock encrypt_block; AES_BoxDecryptBlock decrypt_block; -} AES_BoxInterface; +} AES_BoxOps; typedef struct { - const AES_BoxInterface* algorithm; - AES_BoxEncryptionRoundKeys encryption_keys; - AES_BoxDecryptionRoundKeys decryption_keys; + AES_Algorithm algorithm; AES_Mode mode; AES_Block iv; + AES_BoxEncryptionRoundKeys encryption_keys; + AES_BoxDecryptionRoundKeys decryption_keys; + const AES_BoxOps* ops; } AES_Box; #ifdef __cplusplus -- cgit v1.3