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

Side by Side Diff: core/fdrm/crypto/fx_crypt_aes.cpp

Issue 1832173003: Remove FX_DWORD from core/ and delete definition (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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/fdrm/crypto/fx_crypt.cpp ('k') | core/fdrm/crypto/fx_crypt_sha.cpp » ('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/fdrm/crypto/include/fx_crypt.h" 7 #include "core/fdrm/crypto/include/fx_crypt.h"
8 8
9 #ifdef __cplusplus 9 #ifdef __cplusplus
10 extern "C" { 10 extern "C" {
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 for (i = 0; i < 4; i++) { 797 for (i = 0; i < 4; i++) {
798 PUT_32BIT_MSB_FIRST(dest + 4 * i, iv[i]); 798 PUT_32BIT_MSB_FIRST(dest + 4 * i, iv[i]);
799 } 799 }
800 dest += 16; 800 dest += 16;
801 src += 16; 801 src += 16;
802 len -= 16; 802 len -= 16;
803 } 803 }
804 FXSYS_memcpy(ctx->iv, iv, sizeof(iv)); 804 FXSYS_memcpy(ctx->iv, iv, sizeof(iv));
805 } 805 }
806 void CRYPT_AESSetKey(void* context, 806 void CRYPT_AESSetKey(void* context,
807 FX_DWORD blocklen, 807 uint32_t blocklen,
808 const uint8_t* key, 808 const uint8_t* key,
809 FX_DWORD keylen, 809 uint32_t keylen,
810 FX_BOOL bEncrypt) { 810 FX_BOOL bEncrypt) {
811 aes_setup((AESContext*)context, blocklen, key, keylen); 811 aes_setup((AESContext*)context, blocklen, key, keylen);
812 } 812 }
813 void CRYPT_AESSetIV(void* context, const uint8_t* iv) { 813 void CRYPT_AESSetIV(void* context, const uint8_t* iv) {
814 int i; 814 int i;
815 for (i = 0; i < ((AESContext*)context)->Nb; i++) { 815 for (i = 0; i < ((AESContext*)context)->Nb; i++) {
816 ((AESContext*)context)->iv[i] = GET_32BIT_MSB_FIRST(iv + 4 * i); 816 ((AESContext*)context)->iv[i] = GET_32BIT_MSB_FIRST(iv + 4 * i);
817 } 817 }
818 } 818 }
819 void CRYPT_AESDecrypt(void* context, 819 void CRYPT_AESDecrypt(void* context,
820 uint8_t* dest, 820 uint8_t* dest,
821 const uint8_t* src, 821 const uint8_t* src,
822 FX_DWORD len) { 822 uint32_t len) {
823 aes_decrypt_cbc(dest, src, len, (AESContext*)context); 823 aes_decrypt_cbc(dest, src, len, (AESContext*)context);
824 } 824 }
825 void CRYPT_AESEncrypt(void* context, 825 void CRYPT_AESEncrypt(void* context,
826 uint8_t* dest, 826 uint8_t* dest,
827 const uint8_t* src, 827 const uint8_t* src,
828 FX_DWORD len) { 828 uint32_t len) {
829 aes_encrypt_cbc(dest, src, len, (AESContext*)context); 829 aes_encrypt_cbc(dest, src, len, (AESContext*)context);
830 } 830 }
831 #ifdef __cplusplus 831 #ifdef __cplusplus
832 }; 832 };
833 #endif 833 #endif
OLDNEW
« no previous file with comments | « core/fdrm/crypto/fx_crypt.cpp ('k') | core/fdrm/crypto/fx_crypt_sha.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698