diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-06-21 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-12-17 14:59:19 +0500 |
commit | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (patch) | |
tree | fe5e17420300b715021a76328444088d32047963 /C/Aes.h | |
parent | 93be7d4abfd4233228f58ee1fbbcd76d91be66a4 (diff) | |
download | 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.gz 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.bz2 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.zip |
23.0123.01
Diffstat (limited to 'C/Aes.h')
-rw-r--r-- | C/Aes.h | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -1,8 +1,8 @@ | |||
1 | /* Aes.h -- AES encryption / decryption | 1 | /* Aes.h -- AES encryption / decryption |
2 | 2018-04-28 : Igor Pavlov : Public domain */ | 2 | 2023-04-02 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #ifndef __AES_H | 4 | #ifndef ZIP7_INC_AES_H |
5 | #define __AES_H | 5 | #define ZIP7_INC_AES_H |
6 | 6 | ||
7 | #include "7zTypes.h" | 7 | #include "7zTypes.h" |
8 | 8 | ||
@@ -20,19 +20,19 @@ void AesGenTables(void); | |||
20 | 20 | ||
21 | /* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */ | 21 | /* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */ |
22 | /* keySize = 16 or 24 or 32 (bytes) */ | 22 | /* keySize = 16 or 24 or 32 (bytes) */ |
23 | typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize); | 23 | typedef void (Z7_FASTCALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize); |
24 | void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize); | 24 | void Z7_FASTCALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize); |
25 | void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize); | 25 | void Z7_FASTCALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize); |
26 | 26 | ||
27 | /* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */ | 27 | /* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */ |
28 | void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */ | 28 | void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */ |
29 | 29 | ||
30 | /* data - 16-byte aligned pointer to data */ | 30 | /* data - 16-byte aligned pointer to data */ |
31 | /* numBlocks - the number of 16-byte blocks in data array */ | 31 | /* numBlocks - the number of 16-byte blocks in data array */ |
32 | typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks); | 32 | typedef void (Z7_FASTCALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks); |
33 | 33 | ||
34 | extern AES_CODE_FUNC g_AesCbc_Decode; | 34 | extern AES_CODE_FUNC g_AesCbc_Decode; |
35 | #ifndef _SFX | 35 | #ifndef Z7_SFX |
36 | extern AES_CODE_FUNC g_AesCbc_Encode; | 36 | extern AES_CODE_FUNC g_AesCbc_Encode; |
37 | extern AES_CODE_FUNC g_AesCtr_Code; | 37 | extern AES_CODE_FUNC g_AesCtr_Code; |
38 | #define k_Aes_SupportedFunctions_HW (1 << 2) | 38 | #define k_Aes_SupportedFunctions_HW (1 << 2) |
@@ -41,19 +41,19 @@ extern UInt32 g_Aes_SupportedFunctions_Flags; | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | 43 | ||
44 | #define DECLARE__AES_CODE_FUNC(funcName) \ | 44 | #define Z7_DECLARE_AES_CODE_FUNC(funcName) \ |
45 | void MY_FAST_CALL funcName(UInt32 *ivAes, Byte *data, size_t numBlocks); | 45 | void Z7_FASTCALL funcName(UInt32 *ivAes, Byte *data, size_t numBlocks); |
46 | 46 | ||
47 | DECLARE__AES_CODE_FUNC (AesCbc_Encode) | 47 | Z7_DECLARE_AES_CODE_FUNC (AesCbc_Encode) |
48 | DECLARE__AES_CODE_FUNC (AesCbc_Decode) | 48 | Z7_DECLARE_AES_CODE_FUNC (AesCbc_Decode) |
49 | DECLARE__AES_CODE_FUNC (AesCtr_Code) | 49 | Z7_DECLARE_AES_CODE_FUNC (AesCtr_Code) |
50 | 50 | ||
51 | DECLARE__AES_CODE_FUNC (AesCbc_Encode_HW) | 51 | Z7_DECLARE_AES_CODE_FUNC (AesCbc_Encode_HW) |
52 | DECLARE__AES_CODE_FUNC (AesCbc_Decode_HW) | 52 | Z7_DECLARE_AES_CODE_FUNC (AesCbc_Decode_HW) |
53 | DECLARE__AES_CODE_FUNC (AesCtr_Code_HW) | 53 | Z7_DECLARE_AES_CODE_FUNC (AesCtr_Code_HW) |
54 | 54 | ||
55 | DECLARE__AES_CODE_FUNC (AesCbc_Decode_HW_256) | 55 | Z7_DECLARE_AES_CODE_FUNC (AesCbc_Decode_HW_256) |
56 | DECLARE__AES_CODE_FUNC (AesCtr_Code_HW_256) | 56 | Z7_DECLARE_AES_CODE_FUNC (AesCtr_Code_HW_256) |
57 | 57 | ||
58 | EXTERN_C_END | 58 | EXTERN_C_END |
59 | 59 | ||