| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef ZIP7_INC_AES_H |
| 5 |
#define ZIP7_INC_AES_H |
| 6 |
|
| 7 |
#include "7zTypes.h" |
| 8 |
|
| 9 |
EXTERN_C_BEGIN |
| 10 |
|
| 11 |
#define AES_BLOCK_SIZE 16 |
| 12 |
|
| 13 |
|
| 14 |
void AesGenTables(void); |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4) |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
typedef void (Z7_FASTCALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize); |
| 24 |
void Z7_FASTCALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize); |
| 25 |
void Z7_FASTCALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize); |
| 26 |
|
| 27 |
|
| 28 |
void AesCbc_Init(UInt32 *ivAes, const Byte *iv); |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
typedef void (Z7_FASTCALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks); |
| 33 |
|
| 34 |
extern AES_CODE_FUNC g_AesCbc_Decode; |
| 35 |
#ifndef Z7_SFX |
| 36 |
extern AES_CODE_FUNC g_AesCbc_Encode; |
| 37 |
extern AES_CODE_FUNC g_AesCtr_Code; |
| 38 |
#define k_Aes_SupportedFunctions_HW (1 << 2) |
| 39 |
#define k_Aes_SupportedFunctions_HW_256 (1 << 3) |
| 40 |
extern UInt32 g_Aes_SupportedFunctions_Flags; |
| 41 |
#endif |
| 42 |
|
| 43 |
|
| 44 |
#define Z7_DECLARE_AES_CODE_FUNC(funcName) \ |
| 45 |
void Z7_FASTCALL funcName(UInt32 *ivAes, Byte *data, size_t numBlocks); |
| 46 |
|
| 47 |
Z7_DECLARE_AES_CODE_FUNC (AesCbc_Encode) |
| 48 |
Z7_DECLARE_AES_CODE_FUNC (AesCbc_Decode) |
| 49 |
Z7_DECLARE_AES_CODE_FUNC (AesCtr_Code) |
| 50 |
|
| 51 |
Z7_DECLARE_AES_CODE_FUNC (AesCbc_Encode_HW) |
| 52 |
Z7_DECLARE_AES_CODE_FUNC (AesCbc_Decode_HW) |
| 53 |
Z7_DECLARE_AES_CODE_FUNC (AesCtr_Code_HW) |
| 54 |
|
| 55 |
Z7_DECLARE_AES_CODE_FUNC (AesCbc_Decode_HW_256) |
| 56 |
Z7_DECLARE_AES_CODE_FUNC (AesCtr_Code_HW_256) |
| 57 |
|
| 58 |
EXTERN_C_END |
| 59 |
|
| 60 |
#endif |