From 13ee55a8267963c9b39486a6a22646fbdd770742 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 14 Mar 2016 15:56:00 -0400 Subject: Move fx_crypto.h and fpdf_text.h out of core/include. This CL moves the two files and breaks fpdf_text.h apart into individual pieces. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1801973002 . --- core/fdrm/crypto/fx_crypt.cpp | 2 +- core/fdrm/crypto/fx_crypt_aes.cpp | 2 +- core/fdrm/crypto/fx_crypt_sha.cpp | 2 +- core/fdrm/crypto/include/fx_crypt.h | 71 +++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 core/fdrm/crypto/include/fx_crypt.h (limited to 'core/fdrm') diff --git a/core/fdrm/crypto/fx_crypt.cpp b/core/fdrm/crypto/fx_crypt.cpp index c1016cdcd9..d5cbdb5a82 100644 --- a/core/fdrm/crypto/fx_crypt.cpp +++ b/core/fdrm/crypto/fx_crypt.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/include/fdrm/fx_crypt.h" +#include "core/fdrm/crypto/include/fx_crypt.h" #ifdef __cplusplus extern "C" { diff --git a/core/fdrm/crypto/fx_crypt_aes.cpp b/core/fdrm/crypto/fx_crypt_aes.cpp index d27783f820..b56d8fe33c 100644 --- a/core/fdrm/crypto/fx_crypt_aes.cpp +++ b/core/fdrm/crypto/fx_crypt_aes.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/include/fdrm/fx_crypt.h" +#include "core/fdrm/crypto/include/fx_crypt.h" #ifdef __cplusplus extern "C" { diff --git a/core/fdrm/crypto/fx_crypt_sha.cpp b/core/fdrm/crypto/fx_crypt_sha.cpp index c7d171098b..5f1558943d 100644 --- a/core/fdrm/crypto/fx_crypt_sha.cpp +++ b/core/fdrm/crypto/fx_crypt_sha.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/include/fdrm/fx_crypt.h" +#include "core/fdrm/crypto/include/fx_crypt.h" #ifdef __cplusplus extern "C" { diff --git a/core/fdrm/crypto/include/fx_crypt.h b/core/fdrm/crypto/include/fx_crypt.h new file mode 100644 index 0000000000..fdba0e7164 --- /dev/null +++ b/core/fdrm/crypto/include/fx_crypt.h @@ -0,0 +1,71 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FDRM_CRYPTO_INCLUDE_FX_CRYPT_H_ +#define CORE_FDRM_CRYPTO_INCLUDE_FX_CRYPT_H_ + +#include "core/include/fxcrt/fx_system.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void CRYPT_ArcFourCryptBlock(uint8_t* data, + FX_DWORD size, + const uint8_t* key, + FX_DWORD keylen); +void CRYPT_ArcFourSetup(void* context, const uint8_t* key, FX_DWORD length); +void CRYPT_ArcFourCrypt(void* context, uint8_t* data, FX_DWORD size); +void CRYPT_AESSetKey(void* context, + FX_DWORD blocklen, + const uint8_t* key, + FX_DWORD keylen, + FX_BOOL bEncrypt); +void CRYPT_AESSetIV(void* context, const uint8_t* iv); +void CRYPT_AESDecrypt(void* context, + uint8_t* dest, + const uint8_t* src, + FX_DWORD size); +void CRYPT_AESEncrypt(void* context, + uint8_t* dest, + const uint8_t* src, + FX_DWORD size); +void CRYPT_MD5Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[16]); +void CRYPT_MD5Start(void* context); +void CRYPT_MD5Update(void* context, const uint8_t* data, FX_DWORD size); +void CRYPT_MD5Finish(void* context, uint8_t digest[16]); +void CRYPT_SHA1Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[20]); +void CRYPT_SHA1Start(void* context); +void CRYPT_SHA1Update(void* context, const uint8_t* data, FX_DWORD size); +void CRYPT_SHA1Finish(void* context, uint8_t digest[20]); +void CRYPT_SHA256Generate(const uint8_t* data, + FX_DWORD size, + uint8_t digest[32]); +void CRYPT_SHA256Start(void* context); +void CRYPT_SHA256Update(void* context, const uint8_t* data, FX_DWORD size); +void CRYPT_SHA256Finish(void* context, uint8_t digest[32]); +void CRYPT_SHA384Start(void* context); +void CRYPT_SHA384Update(void* context, const uint8_t* data, FX_DWORD size); +void CRYPT_SHA384Finish(void* context, uint8_t digest[48]); +void CRYPT_SHA384Generate(const uint8_t* data, + FX_DWORD size, + uint8_t digest[48]); +void CRYPT_SHA512Start(void* context); +void CRYPT_SHA512Update(void* context, const uint8_t* data, FX_DWORD size); +void CRYPT_SHA512Finish(void* context, uint8_t digest[64]); +void CRYPT_SHA512Generate(const uint8_t* data, + FX_DWORD size, + uint8_t digest[64]); +void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, + FX_DWORD size, + uint8_t* data_buf, + FX_DWORD& data_len)); + +#ifdef __cplusplus +}; +#endif + +#endif // CORE_FDRM_CRYPTO_INCLUDE_FX_CRYPT_H_ -- cgit v1.2.3