diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/aesni/box.h | 24 | ||||
-rw-r--r-- | include/aesni/box_data.h | 39 |
2 files changed, 59 insertions, 4 deletions
diff --git a/include/aesni/box.h b/include/aesni/box.h index 04c2b6c..58517e1 100644 --- a/include/aesni/box.h +++ b/include/aesni/box.h @@ -27,6 +27,30 @@ AesNI_StatusCode aesni_box_init( const AesNI_BoxBlock* iv, AesNI_ErrorDetails* err_details); +AesNI_StatusCode aesni_box_parse_key( + AesNI_BoxKey* dest, + AesNI_Algorithm algorithm, + const char* src, + AesNI_ErrorDetails* err_details); + +AesNI_StatusCode aesni_box_parse_block( + AesNI_BoxBlock* dest, + AesNI_Algorithm algorithm, + const char* src, + AesNI_ErrorDetails* err_details); + +AesNI_StatusCode aesni_box_format_key( + AesNI_BoxKeyString* dest, + AesNI_Algorithm algorithm, + const AesNI_BoxKey* src, + AesNI_ErrorDetails* err_details); + +AesNI_StatusCode aesni_box_format_block( + AesNI_BoxBlockString* dest, + AesNI_Algorithm algorithm, + const AesNI_BoxBlock* src, + AesNI_ErrorDetails* err_details); + AesNI_StatusCode aesni_box_encrypt_block( AesNI_Box* box, const AesNI_BoxBlock* plaintext, 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; |