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

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

Issue 1585007: combined patch for: (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/sha1.c ('k') | src/platform/vboot_reference/crypto/sha_utility.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 320bccbc439bcfd22f750749ed9a4ebaa79eb74f..7f476567649d118235d4c03b7fbadb21eb3cc911 100644
--- a/src/platform/vboot_reference/crypto/sha2.c
+++ b/src/platform/vboot_reference/crypto/sha2.c
@@ -35,8 +35,8 @@
* SUCH DAMAGE.
*/
-#include "sha.h"
-#include <string.h>
+#include "cryptolib.h"
+#include "utility.h"
#define SHFR(x, n) (x >> n)
#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
@@ -340,7 +340,7 @@ void SHA256_update(SHA256_CTX* ctx, const uint8_t* data, uint64_t len) {
tmp_len = SHA256_BLOCK_SIZE - ctx->len;
rem_len = len < tmp_len ? len : tmp_len;
- memcpy(&ctx->block[ctx->len], data, rem_len);
+ Memcpy(&ctx->block[ctx->len], data, rem_len);
if (ctx->len + len < SHA256_BLOCK_SIZE) {
ctx->len += len;
@@ -357,7 +357,7 @@ void SHA256_update(SHA256_CTX* ctx, const uint8_t* data, uint64_t len) {
rem_len = new_len % SHA256_BLOCK_SIZE;
- memcpy(ctx->block, &shifted_data[block_nb << 6],
+ Memcpy(ctx->block, &shifted_data[block_nb << 6],
rem_len);
ctx->len = rem_len;
@@ -528,7 +528,7 @@ void SHA512_update(SHA512_CTX* ctx, const uint8_t* data,
tmp_len = SHA512_BLOCK_SIZE - ctx->len;
rem_len = len < tmp_len ? len : tmp_len;
- memcpy(&ctx->block[ctx->len], data, rem_len);
+ Memcpy(&ctx->block[ctx->len], data, rem_len);
if (ctx->len + len < SHA512_BLOCK_SIZE) {
ctx->len += len;
@@ -545,7 +545,7 @@ void SHA512_update(SHA512_CTX* ctx, const uint8_t* data,
rem_len = new_len % SHA512_BLOCK_SIZE;
- memcpy(ctx->block, &shifted_data[block_nb << 7],
+ Memcpy(ctx->block, &shifted_data[block_nb << 7],
rem_len);
ctx->len = rem_len;
« no previous file with comments | « src/platform/vboot_reference/crypto/sha1.c ('k') | src/platform/vboot_reference/crypto/sha_utility.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698