| 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 #include "../../../include/fxcrt/fx_basic.h" | 7 #include "../../../include/fxcrt/fx_basic.h" |
| 8 #include "../../../include/fdrm/fx_crypt.h" | 8 #include "../../../include/fdrm/fx_crypt.h" |
| 9 #include "../../../src/fxcrt/fx_safe_types.h" |
| 10 |
| 9 #ifdef __cplusplus | 11 #ifdef __cplusplus |
| 10 extern "C" { | 12 extern "C" { |
| 11 #endif | 13 #endif |
| 12 struct rc4_state { | 14 struct rc4_state { |
| 13 int x, y, m[256]; | 15 int x, y, m[256]; |
| 14 }; | 16 }; |
| 15 void CRYPT_ArcFourSetup(void* context, FX_LPCBYTE key, FX_DWORD length ) | 17 void CRYPT_ArcFourSetup(void* context, FX_LPCBYTE key, FX_DWORD length ) |
| 16 { | 18 { |
| 17 rc4_state *s = (rc4_state*)context; | 19 rc4_state *s = (rc4_state*)context; |
| 18 int i, j, k, *m, a; | 20 int i, j, k, *m, a; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 CRYPT_MD5Finish(&ctx, digest); | 252 CRYPT_MD5Finish(&ctx, digest); |
| 251 } | 253 } |
| 252 static FX_BOOL (*g_PubKeyDecryptor)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE d
ata_buf, FX_DWORD& data_len) = NULL; | 254 static FX_BOOL (*g_PubKeyDecryptor)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE d
ata_buf, FX_DWORD& data_len) = NULL; |
| 253 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, F
X_LPBYTE data_buf, FX_DWORD& data_len)) | 255 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, F
X_LPBYTE data_buf, FX_DWORD& data_len)) |
| 254 { | 256 { |
| 255 g_PubKeyDecryptor = func; | 257 g_PubKeyDecryptor = func; |
| 256 } | 258 } |
| 257 #ifdef __cplusplus | 259 #ifdef __cplusplus |
| 258 }; | 260 }; |
| 259 #endif | 261 #endif |
| OLD | NEW |