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

Side by Side Diff: core/src/fdrm/crypto/fx_crypt_sha.cpp

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 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/src/fdrm/crypto/fx_crypt_aes.cpp ('k') | core/src/fpdfapi/fpdf_basic_module.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 "../../../include/fdrm/fx_crypt.h" 7 #include "../../../include/fdrm/fx_crypt.h"
8 #ifdef __cplusplus 8 #ifdef __cplusplus
9 extern "C" { 9 extern "C" {
10 #endif 10 #endif
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 if (i) { 398 if (i) {
399 ret <<= 4; 399 ret <<= 4;
400 } 400 }
401 if (str[i] >= '0' && str[i] <= '9') { 401 if (str[i] >= '0' && str[i] <= '9') {
402 ret |= (str[i] - '0') & 0xFF; 402 ret |= (str[i] - '0') & 0xFF;
403 } else if (str[i] >= 'a' && str[i] <= 'f') { 403 } else if (str[i] >= 'a' && str[i] <= 'f') {
404 ret |= (str[i] - 'a' + 10) & 0xFF; 404 ret |= (str[i] - 'a' + 10) & 0xFF;
405 } else if (str[i] >= 'A' && str[i] <= 'F') { 405 } else if (str[i] >= 'A' && str[i] <= 'F') {
406 ret |= (str[i] - 'A' + 10) & 0xFF; 406 ret |= (str[i] - 'A' + 10) & 0xFF;
407 } else { 407 } else {
408 FXSYS_assert(FALSE); 408 FXSYS_assert(false);
409 } 409 }
410 } 410 }
411 return ret; 411 return ret;
412 } 412 }
413 void CRYPT_SHA384Start(void* context) 413 void CRYPT_SHA384Start(void* context)
414 { 414 {
415 if (context == NULL) { 415 if (context == NULL) {
416 return; 416 return;
417 } 417 }
418 sha384_context *ctx = (sha384_context *)context; 418 sha384_context *ctx = (sha384_context *)context;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 void CRYPT_SHA512Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[64] ) 732 void CRYPT_SHA512Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[64] )
733 { 733 {
734 sha384_context context; 734 sha384_context context;
735 CRYPT_SHA512Start(&context); 735 CRYPT_SHA512Start(&context);
736 CRYPT_SHA512Update(&context, data, size); 736 CRYPT_SHA512Update(&context, data, size);
737 CRYPT_SHA512Finish(&context, digest); 737 CRYPT_SHA512Finish(&context, digest);
738 } 738 }
739 #ifdef __cplusplus 739 #ifdef __cplusplus
740 }; 740 };
741 #endif 741 #endif
OLDNEW
« no previous file with comments | « core/src/fdrm/crypto/fx_crypt_aes.cpp ('k') | core/src/fpdfapi/fpdf_basic_module.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698