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

Unified Diff: src/platform/vboot_reference/crypto/sha2.c

Issue 744002: Vboot Reference: Make length types explicitly sized. (Closed)
Patch Set: Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/platform/vboot_reference/crypto/sha2.c
diff --git a/src/platform/vboot_reference/crypto/sha2.c b/src/platform/vboot_reference/crypto/sha2.c
index 47eaaef5c34f5818cead6044a4f00077c06c6047..320bccbc439bcfd22f750749ed9a4ebaa79eb74f 100644
--- a/src/platform/vboot_reference/crypto/sha2.c
+++ b/src/platform/vboot_reference/crypto/sha2.c
@@ -332,7 +332,7 @@ static void SHA256_transform(SHA256_CTX* ctx, const uint8_t* message,
-void SHA256_update(SHA256_CTX* ctx, const uint8_t* data, int len) {
+void SHA256_update(SHA256_CTX* ctx, const uint8_t* data, uint64_t len) {
unsigned int block_nb;
unsigned int new_len, rem_len, tmp_len;
const uint8_t *shifted_data;
@@ -520,7 +520,7 @@ static void SHA512_transform(SHA512_CTX* ctx, const uint8_t* message,
void SHA512_update(SHA512_CTX* ctx, const uint8_t* data,
- int len) {
+ uint64_t len) {
unsigned int block_nb;
unsigned int new_len, rem_len, tmp_len;
const uint8_t* shifted_data;
@@ -595,7 +595,7 @@ uint8_t* SHA512_final(SHA512_CTX* ctx)
/* Convenient functions. */
-uint8_t* SHA256(const uint8_t* data, int len, uint8_t* digest) {
+uint8_t* SHA256(const uint8_t* data, uint64_t len, uint8_t* digest) {
const uint8_t* p;
int i;
SHA256_CTX ctx;
@@ -609,7 +609,7 @@ uint8_t* SHA256(const uint8_t* data, int len, uint8_t* digest) {
}
-uint8_t* SHA512(const uint8_t* data, int len, uint8_t* digest) {
+uint8_t* SHA512(const uint8_t* data, uint64_t len, uint8_t* digest) {
const uint8_t* p;
int i;
SHA512_CTX ctx;

Powered by Google App Engine
This is Rietveld 408576698