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

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

Issue 1574005: VBoot Reference: Refactor Part 2 - Crypto Libraries (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
« no previous file with comments | « src/platform/vboot_reference/crypto/rsa_utility.c ('k') | src/platform/vboot_reference/crypto/sha2.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5844eccd7b04ffbec919505c81945a11aec72197..41b729b18cd2d5b9a9508d483b56761c7b030110 100644
--- a/src/platform/vboot_reference/crypto/sha1.c
+++ b/src/platform/vboot_reference/crypto/sha1.c
@@ -1,13 +1,14 @@
/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
- */
-
-/* SHA-1 implementation largely based on libmincrypt in the the Android
+ *
+ * SHA-1 implementation largely based on libmincrypt in the the Android
* Open Source Project (platorm/system/core.git/libmincrypt/sha.c
*/
-#include "sha.h"
+#include "cryptolib.h"
+#include "utility.h"
+
/* Some machines lack byteswap.h and endian.h. These have to use the
* slower code, even if they're little-endian.
@@ -134,7 +135,7 @@ void SHA1_update(SHA1_CTX* ctx, const uint8_t* data, uint64_t len) {
ctx->count += len;
while (len > sizeof(ctx->buf) - i) {
- memcpy(&ctx->buf.b[i], p, sizeof(ctx->buf) - i);
+ Memcpy(&ctx->buf.b[i], p, sizeof(ctx->buf) - i);
len -= sizeof(ctx->buf) - i;
p += sizeof(ctx->buf) - i;
SHA1_Transform(ctx);
« no previous file with comments | « src/platform/vboot_reference/crypto/rsa_utility.c ('k') | src/platform/vboot_reference/crypto/sha2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698