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