aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/aesni/box.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 20:07:32 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 20:07:32 +0300
commit522a5b906d7620bcebddb5a8f476b022c140ab27 (patch)
tree8b02e4f5b5948da91e4117c6892d850eeeac8445 /include/aesni/box.h
parentrefactoring (diff)
downloadaes-tools-522a5b906d7620bcebddb5a8f476b022c140ab27.tar.gz
aes-tools-522a5b906d7620bcebddb5a8f476b022c140ab27.zip
factoring out AES-specific stuff
Diffstat (limited to 'include/aesni/box.h')
-rw-r--r--include/aesni/box.h60
1 files changed, 9 insertions, 51 deletions
diff --git a/include/aesni/box.h b/include/aesni/box.h
index 70b2787..fd28cf1 100644
--- a/include/aesni/box.h
+++ b/include/aesni/box.h
@@ -8,74 +8,32 @@
#pragma once
-#include "algorithm.h"
-#include "data.h"
+#include "box_data.h"
#include "error.h"
-#include "mode.h"
#ifdef __cplusplus
extern "C"
{
#endif
-typedef union
-{
- AesNI_Aes128_RoundKeys aes128_key_schedule;
- AesNI_Aes192_RoundKeys aes192_key_schedule;
- AesNI_Aes256_RoundKeys aes256_key_schedule;
-}
-AesNI_EncryptionParams;
-
-typedef union
-{
- AesNI_Aes128_RoundKeys aes128_key_schedule;
- AesNI_Aes192_RoundKeys aes192_key_schedule;
- AesNI_Aes256_RoundKeys aes256_key_schedule;
-}
-AesNI_DecryptionParams;
-
-typedef union
-{
- AesNI_Block128 aes_block;
-}
-AesNI_State;
-
-typedef union
-{
- AesNI_Block128 aes128_key;
- AesNI_Block192 aes192_key;
- AesNI_Block256 aes256_key;
-}
-AesNI_AlgorithmParams;
-
-typedef struct
-{
- AesNI_Algorithm algorithm;
- AesNI_EncryptionParams encrypt_params;
- AesNI_DecryptionParams decrypt_params;
- AesNI_Mode mode;
- AesNI_State iv;
-}
-AesNI_Box;
-
AesNI_StatusCode aesni_box_init(
AesNI_Box*,
- AesNI_Algorithm,
- const AesNI_AlgorithmParams*,
- AesNI_Mode,
- const AesNI_State* iv,
+ AesNI_BoxAlgorithm,
+ const AesNI_BoxAlgorithmParams*,
+ AesNI_BoxMode,
+ const AesNI_BoxBlock* iv,
AesNI_ErrorDetails*);
AesNI_StatusCode aesni_box_encrypt(
AesNI_Box*,
- const AesNI_State*,
- AesNI_State*,
+ const AesNI_BoxBlock*,
+ AesNI_BoxBlock*,
AesNI_ErrorDetails*);
AesNI_StatusCode aesni_box_decrypt(
AesNI_Box*,
- const AesNI_State*,
- AesNI_State*,
+ const AesNI_BoxBlock*,
+ AesNI_BoxBlock*,
AesNI_ErrorDetails*);
#ifdef __cplusplus