OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FDRM_FX_CRYPT_H_ | 7 #ifndef CORE_INCLUDE_FDRM_FX_CRYPT_H_ |
8 #define CORE_INCLUDE_FDRM_FX_CRYPT_H_ | 8 #define CORE_INCLUDE_FDRM_FX_CRYPT_H_ |
9 | 9 |
10 #include "../fxcrt/fx_basic.h" | 10 #include "../fxcrt/fx_basic.h" |
11 | 11 |
12 #ifdef __cplusplus | 12 #ifdef __cplusplus |
13 extern "C" { | 13 extern "C" { |
14 #endif | 14 #endif |
15 | 15 |
16 void CRYPT_ArcFourCryptBlock(FX_LPBYTE data, FX_DWORD size, FX_LPCBYTE key, FX_D
WORD keylen); | 16 void CRYPT_ArcFourCryptBlock(uint8_t* data, FX_DWORD size, const uint8_t* key, F
X_DWORD keylen); |
17 void CRYPT_ArcFourSetup(FX_LPVOID context, FX_LPCBYTE key, FX_DWORD length); | 17 void CRYPT_ArcFourSetup(void* context, const uint8_t* key, FX_DWORD length); |
18 void CRYPT_ArcFourCrypt(FX_LPVOID context, FX_LPBYTE data, FX_DWORD size); | 18 void CRYPT_ArcFourCrypt(void* context, uint8_t* data, FX_DWORD size); |
19 void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DW
ORD keylen, FX_BOOL bEncrypt); | 19 void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DW
ORD keylen, FX_BOOL bEncrypt); |
20 void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv); | 20 void CRYPT_AESSetIV(void* context, const uint8_t* iv); |
21 void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWOR
D size); | 21 void CRYPT_AESDecrypt(void* context, uint8_t* dest, const uint8_t* src, FX_DWORD
size); |
22 void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWOR
D size); | 22 void CRYPT_AESEncrypt(void* context, uint8_t* dest, const uint8_t* src, FX_DWORD
size); |
23 void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[16]); | 23 void CRYPT_MD5Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[16]); |
24 void CRYPT_MD5Start(FX_LPVOID context); | 24 void CRYPT_MD5Start(void* context); |
25 void CRYPT_MD5Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); | 25 void CRYPT_MD5Update(void* context, const uint8_t* data, FX_DWORD size); |
26 void CRYPT_MD5Finish(FX_LPVOID context, uint8_t digest[16]); | 26 void CRYPT_MD5Finish(void* context, uint8_t digest[16]); |
27 void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[20]); | 27 void CRYPT_SHA1Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[20]); |
28 void CRYPT_SHA1Start(FX_LPVOID context); | 28 void CRYPT_SHA1Start(void* context); |
29 void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); | 29 void CRYPT_SHA1Update(void* context, const uint8_t* data, FX_DWORD size); |
30 void CRYPT_SHA1Finish(FX_LPVOID context, uint8_t digest[20]); | 30 void CRYPT_SHA1Finish(void* context, uint8_t digest[20]); |
31 void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[32]); | 31 void CRYPT_SHA256Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[32]
); |
32 void CRYPT_SHA256Start(FX_LPVOID context); | 32 void CRYPT_SHA256Start(void* context); |
33 void CRYPT_SHA256Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); | 33 void CRYPT_SHA256Update(void* context, const uint8_t* data, FX_DWORD size); |
34 void CRYPT_SHA256Finish(FX_LPVOID context, uint8_t digest[32]); | 34 void CRYPT_SHA256Finish(void* context, uint8_t digest[32]); |
35 void CRYPT_SHA384Start(FX_LPVOID context); | 35 void CRYPT_SHA384Start(void* context); |
36 void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); | 36 void CRYPT_SHA384Update(void* context, const uint8_t* data, FX_DWORD size); |
37 void CRYPT_SHA384Finish(FX_LPVOID context, uint8_t digest[48]); | 37 void CRYPT_SHA384Finish(void* context, uint8_t digest[48]); |
38 void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[48]); | 38 void CRYPT_SHA384Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[48]
); |
39 void CRYPT_SHA512Start(FX_LPVOID context); | 39 void CRYPT_SHA512Start(void* context); |
40 void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); | 40 void CRYPT_SHA512Update(void* context, const uint8_t* data, FX_DWORD size); |
41 void CRYPT_SHA512Finish(FX_LPVOID context, uint8_t digest[64]); | 41 void CRYPT_SHA512Finish(void* context, uint8_t digest[64]); |
42 void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[64]); | 42 void CRYPT_SHA512Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[64]
); |
43 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, F
X_LPBYTE data_buf, FX_DWORD& data_len)); | 43 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, FX_DWORD siz
e, uint8_t* data_buf, FX_DWORD& data_len)); |
44 | 44 |
45 #ifdef __cplusplus | 45 #ifdef __cplusplus |
46 }; | 46 }; |
47 #endif | 47 #endif |
48 | 48 |
49 #endif // CORE_INCLUDE_FDRM_FX_CRYPT_H_ | 49 #endif // CORE_INCLUDE_FDRM_FX_CRYPT_H_ |
OLD | NEW |