Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp

Issue 2383543002: Move core/fpdfapi/fpdf_parser/include to core/fpdfapi/fpdf_parser (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_boolean.h ('k') | core/fpdfapi/fpdf_parser/cpdf_data_avail.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "core/fpdfapi/fpdf_parser/cpdf_crypto_handler.h" 7 #include "core/fpdfapi/fpdf_parser/cpdf_crypto_handler.h"
8 8
9 #include <time.h> 9 #include <time.h>
10 10
11 #include "core/fdrm/crypto/fx_crypt.h" 11 #include "core/fdrm/crypto/fx_crypt.h"
12 #include "core/fpdfapi/fpdf_parser/cpdf_parser.h"
12 #include "core/fpdfapi/fpdf_parser/cpdf_security_handler.h" 13 #include "core/fpdfapi/fpdf_parser/cpdf_security_handler.h"
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" 14 #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h"
14 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h"
15 15
16 void CPDF_CryptoHandler::CryptBlock(FX_BOOL bEncrypt, 16 void CPDF_CryptoHandler::CryptBlock(FX_BOOL bEncrypt,
17 uint32_t objnum, 17 uint32_t objnum,
18 uint32_t gennum, 18 uint32_t gennum,
19 const uint8_t* src_buf, 19 const uint8_t* src_buf,
20 uint32_t src_size, 20 uint32_t src_size,
21 uint8_t* dest_buf, 21 uint8_t* dest_buf,
22 uint32_t& dest_size) { 22 uint32_t& dest_size) {
23 if (m_Cipher == FXCIPHER_NONE) { 23 if (m_Cipher == FXCIPHER_NONE) {
24 FXSYS_memcpy(dest_buf, src_buf, src_size); 24 FXSYS_memcpy(dest_buf, src_buf, src_size);
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 void CPDF_CryptoHandler::PopulateKey(uint32_t objnum, 333 void CPDF_CryptoHandler::PopulateKey(uint32_t objnum,
334 uint32_t gennum, 334 uint32_t gennum,
335 uint8_t* key) { 335 uint8_t* key) {
336 FXSYS_memcpy(key, m_EncryptKey, m_KeyLen); 336 FXSYS_memcpy(key, m_EncryptKey, m_KeyLen);
337 key[m_KeyLen + 0] = (uint8_t)objnum; 337 key[m_KeyLen + 0] = (uint8_t)objnum;
338 key[m_KeyLen + 1] = (uint8_t)(objnum >> 8); 338 key[m_KeyLen + 1] = (uint8_t)(objnum >> 8);
339 key[m_KeyLen + 2] = (uint8_t)(objnum >> 16); 339 key[m_KeyLen + 2] = (uint8_t)(objnum >> 16);
340 key[m_KeyLen + 3] = (uint8_t)gennum; 340 key[m_KeyLen + 3] = (uint8_t)gennum;
341 key[m_KeyLen + 4] = (uint8_t)(gennum >> 8); 341 key[m_KeyLen + 4] = (uint8_t)(gennum >> 8);
342 } 342 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_boolean.h ('k') | core/fpdfapi/fpdf_parser/cpdf_data_avail.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698