diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-10-20 03:11:50 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-10-20 03:11:50 +0300 |
commit | f9665896e3deb6c449c764ba8b30f700abe36cd5 (patch) | |
tree | 4203b64ccf2fb8ad4d40f20edad8aeff9448ab63 /include/aesni/box_data.h | |
parent | add missing `assert`s (diff) | |
download | aes-tools-f9665896e3deb6c449c764ba8b30f700abe36cd5.tar.gz aes-tools-f9665896e3deb6c449c764ba8b30f700abe36cd5.zip |
cxx: implement "boxes"
Diffstat (limited to '')
-rw-r--r-- | include/aesni/box_data.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/include/aesni/box_data.h b/include/aesni/box_data.h index d184c30..888c7c0 100644 --- a/include/aesni/box_data.h +++ b/include/aesni/box_data.h @@ -45,20 +45,49 @@ AesNI_BoxDecryptionRoundKeys; typedef union { + AesNI_AES128_KeyString aes128; + AesNI_AES192_KeyString aes192; + AesNI_AES256_KeyString aes256; +} +AesNI_BoxKeyString; + +typedef union +{ AesNI_AES_Block aes_block; } AesNI_BoxBlock; +typedef union +{ + AesNI_AES_BlockString aes; +} +AesNI_BoxBlockString; + typedef AesNI_StatusCode (*AesNI_BoxCalculateRoundKeys)( const AesNI_BoxKey* params, AesNI_BoxEncryptionRoundKeys*, AesNI_BoxDecryptionRoundKeys*, AesNI_ErrorDetails* err_details); -/* typedef AesNI_StatusCode (*AesNI_BoxParseBlock)( +typedef AesNI_StatusCode (*AesNI_BoxParseBlock)( AesNI_BoxBlock* dest, const char* src, - AesNI_ErrorDetails* err_details); */ + AesNI_ErrorDetails* err_details); + +typedef AesNI_StatusCode (*AesNI_BoxParseKey)( + AesNI_BoxKey* dest, + const char* src, + AesNI_ErrorDetails* err_details); + +typedef AesNI_StatusCode (*AesNI_BoxFormatBlock)( + AesNI_BoxBlockString* dest, + const AesNI_BoxBlock* src, + AesNI_ErrorDetails* err_details); + +typedef AesNI_StatusCode (*AesNI_BoxFormatKey)( + AesNI_BoxKeyString* dest, + const AesNI_BoxKey* src, + AesNI_ErrorDetails* err_details); typedef AesNI_StatusCode (*AesNI_BoxEncryptBlock)( const AesNI_BoxBlock* plaintext, @@ -98,8 +127,10 @@ typedef AesNI_StatusCode (*AesNI_BoxLoadBlock)( typedef struct { AesNI_BoxCalculateRoundKeys calc_round_keys; - //AesNI_BoxParseBlock parse_block; - //AesNI_BoxParseKey parse_key; + AesNI_BoxParseBlock parse_block; + AesNI_BoxParseKey parse_key; + AesNI_BoxFormatBlock format_block; + AesNI_BoxFormatKey format_key; AesNI_BoxEncryptBlock encrypt_block; AesNI_BoxDecryptBlock decrypt_block; AesNI_BoxXorBlock xor_block; |