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/fdrm/fx_crypt.h" | 7 #include "../../../include/fdrm/fx_crypt.h" |
8 | 8 |
9 #ifdef __cplusplus | 9 #ifdef __cplusplus |
10 extern "C" { | 10 extern "C" { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 PUT_FX_DWORD( ctx->state[2], digest, 8 ); | 242 PUT_FX_DWORD( ctx->state[2], digest, 8 ); |
243 PUT_FX_DWORD( ctx->state[3], digest, 12 ); | 243 PUT_FX_DWORD( ctx->state[3], digest, 12 ); |
244 } | 244 } |
245 void CRYPT_MD5Generate(const uint8_t* input, FX_DWORD length, uint8_t digest[16]
) | 245 void CRYPT_MD5Generate(const uint8_t* input, FX_DWORD length, uint8_t digest[16]
) |
246 { | 246 { |
247 md5_context ctx; | 247 md5_context ctx; |
248 CRYPT_MD5Start(&ctx); | 248 CRYPT_MD5Start(&ctx); |
249 CRYPT_MD5Update(&ctx, input, length); | 249 CRYPT_MD5Update(&ctx, input, length); |
250 CRYPT_MD5Finish(&ctx, digest); | 250 CRYPT_MD5Finish(&ctx, digest); |
251 } | 251 } |
252 static FX_BOOL (*g_PubKeyDecryptor)(const uint8_t* pData, FX_DWORD size, uint8_t
* data_buf, FX_DWORD& data_len) = NULL; | 252 static bool (*g_PubKeyDecryptor)(const uint8_t* pData, FX_DWORD size, uint8_t* d
ata_buf, FX_DWORD& data_len) = NULL; |
253 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, FX_DWORD siz
e, uint8_t* data_buf, FX_DWORD& data_len)) | 253 void CRYPT_SetPubKeyDecryptor(bool (*func)(const uint8_t* pData, FX_DWORD size,
uint8_t* data_buf, FX_DWORD& data_len)) |
254 { | 254 { |
255 g_PubKeyDecryptor = func; | 255 g_PubKeyDecryptor = func; |
256 } | 256 } |
257 #ifdef __cplusplus | 257 #ifdef __cplusplus |
258 }; | 258 }; |
259 #endif | 259 #endif |
OLD | NEW |