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

Unified Diff: src/platform/vboot_reference/crypto/sha1.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/sha1.c
diff --git a/src/platform/vboot_reference/crypto/sha1.c b/src/platform/vboot_reference/crypto/sha1.c
index 50f6bf6d58248732736849c81c9ba7298a834702..ca45911e02cdc9960cd060f3dffbc333ac422f76 100644
--- a/src/platform/vboot_reference/crypto/sha1.c
+++ b/src/platform/vboot_reference/crypto/sha1.c
@@ -127,7 +127,7 @@ static void SHA1_Transform(SHA_CTX* ctx) {
ctx->state[4] += E;
}
-void SHA1_update(SHA1_CTX* ctx, const uint8_t* data, size_t len) {
+void SHA1_update(SHA1_CTX* ctx, const uint8_t* data, uint64_t len) {
int i = ctx->count % sizeof(ctx->buf);
const uint8_t* p = (const uint8_t*)data;
@@ -151,7 +151,7 @@ void SHA1_update(SHA1_CTX* ctx, const uint8_t* data, size_t len) {
}
-uint8_t* SHA1_final(SHA_CTX* ctx) {
+uint8_t* SHA1_final(SHA1_CTX* ctx) {
uint64_t cnt = ctx->count * 8;
int i;
@@ -225,7 +225,7 @@ static void SHA1_transform(SHA1_CTX *ctx) {
ctx->state[4] += E;
}
-void SHA1_update(SHA1_CTX *ctx, const uint8_t *data, int len) {
+void SHA1_update(SHA1_CTX *ctx, const uint8_t *data, uint64_t len) {
int i = ctx->count % sizeof(ctx->buf);
const uint8_t* p = (const uint8_t*) data;
@@ -275,7 +275,7 @@ void SHA1_init(SHA1_CTX* ctx) {
ctx->count = 0;
}
-uint8_t* SHA1(const uint8_t *data, int len, uint8_t *digest) {
+uint8_t* SHA1(const uint8_t *data, uint64_t len, uint8_t *digest) {
const uint8_t *p;
int i;
SHA1_CTX ctx;

Powered by Google App Engine
This is Rietveld 408576698