summaryrefslogtreecommitdiff
path: root/core/fdrm/crypto
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-03 15:05:11 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 20:39:56 +0000
commit1c5d0b48ec7a6443ba72fec2a58a65fc6d694aca (patch)
tree315955cce6b29093dcddfc48c0811957a172bedf /core/fdrm/crypto
parent2ae80f52cec81c080515724f99deb06b2fee3cc9 (diff)
downloadpdfium-1c5d0b48ec7a6443ba72fec2a58a65fc6d694aca.tar.xz
Drop FXSYS_ from mem methods
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fdrm/crypto')
-rw-r--r--core/fdrm/crypto/fx_crypt.cpp4
-rw-r--r--core/fdrm/crypto/fx_crypt_aes.cpp8
-rw-r--r--core/fdrm/crypto/fx_crypt_sha.cpp24
3 files changed, 18 insertions, 18 deletions
diff --git a/core/fdrm/crypto/fx_crypt.cpp b/core/fdrm/crypto/fx_crypt.cpp
index 4010ff49ee..d1a1aae471 100644
--- a/core/fdrm/crypto/fx_crypt.cpp
+++ b/core/fdrm/crypto/fx_crypt.cpp
@@ -204,7 +204,7 @@ void CRYPT_MD5Update(CRYPT_md5_context* ctx,
ctx->total[0] &= 0xFFFFFFFF;
ctx->total[1] += ctx->total[0] < length << 3;
if (left && length >= fill) {
- FXSYS_memcpy((void*)(ctx->buffer + left), (void*)input, fill);
+ memcpy((void*)(ctx->buffer + left), (void*)input, fill);
md5_process(ctx, ctx->buffer);
length -= fill;
input += fill;
@@ -216,7 +216,7 @@ void CRYPT_MD5Update(CRYPT_md5_context* ctx,
input += 64;
}
if (length) {
- FXSYS_memcpy((void*)(ctx->buffer + left), (void*)input, length);
+ memcpy((void*)(ctx->buffer + left), (void*)input, length);
}
}
diff --git a/core/fdrm/crypto/fx_crypt_aes.cpp b/core/fdrm/crypto/fx_crypt_aes.cpp
index 8484b6f4a5..e900dbd3e4 100644
--- a/core/fdrm/crypto/fx_crypt_aes.cpp
+++ b/core/fdrm/crypto/fx_crypt_aes.cpp
@@ -762,7 +762,7 @@ static void aes_decrypt_cbc(unsigned char* dest,
unsigned int iv[4], x[4], ct[4];
int i;
ASSERT((len & 15) == 0);
- FXSYS_memcpy(iv, ctx->iv, sizeof(iv));
+ memcpy(iv, ctx->iv, sizeof(iv));
while (len > 0) {
for (i = 0; i < 4; i++) {
x[i] = ct[i] = GET_32BIT_MSB_FIRST(src + 4 * i);
@@ -776,7 +776,7 @@ static void aes_decrypt_cbc(unsigned char* dest,
src += 16;
len -= 16;
}
- FXSYS_memcpy(ctx->iv, iv, sizeof(iv));
+ memcpy(ctx->iv, iv, sizeof(iv));
}
static void aes_encrypt(AESContext* ctx, unsigned int* block) {
ctx->encrypt(ctx, block);
@@ -788,7 +788,7 @@ static void aes_encrypt_cbc(unsigned char* dest,
unsigned int iv[4];
int i;
ASSERT((len & 15) == 0);
- FXSYS_memcpy(iv, ctx->iv, sizeof(iv));
+ memcpy(iv, ctx->iv, sizeof(iv));
while (len > 0) {
for (i = 0; i < 4; i++) {
iv[i] ^= GET_32BIT_MSB_FIRST(src + 4 * i);
@@ -801,7 +801,7 @@ static void aes_encrypt_cbc(unsigned char* dest,
src += 16;
len -= 16;
}
- FXSYS_memcpy(ctx->iv, iv, sizeof(iv));
+ memcpy(ctx->iv, iv, sizeof(iv));
}
void CRYPT_AESSetKey(void* context,
uint32_t blocklen,
diff --git a/core/fdrm/crypto/fx_crypt_sha.cpp b/core/fdrm/crypto/fx_crypt_sha.cpp
index 51f9588e04..f79b831277 100644
--- a/core/fdrm/crypto/fx_crypt_sha.cpp
+++ b/core/fdrm/crypto/fx_crypt_sha.cpp
@@ -90,11 +90,11 @@ void CRYPT_SHA1Update(CRYPT_sha1_context* s,
s->lenlo += lenw;
s->lenhi += (s->lenlo < lenw);
if (s->blkused && s->blkused + len < 64) {
- FXSYS_memcpy(s->block + s->blkused, q, len);
+ memcpy(s->block + s->blkused, q, len);
s->blkused += len;
} else {
while (s->blkused + len >= 64) {
- FXSYS_memcpy(s->block + s->blkused, q, 64 - s->blkused);
+ memcpy(s->block + s->blkused, q, 64 - s->blkused);
q += 64 - s->blkused;
len -= 64 - s->blkused;
for (i = 0; i < 16; i++) {
@@ -106,7 +106,7 @@ void CRYPT_SHA1Update(CRYPT_sha1_context* s,
SHATransform(s->h, wordblock);
s->blkused = 0;
}
- FXSYS_memcpy(s->block, q, len);
+ memcpy(s->block, q, len);
s->blkused = len;
}
}
@@ -123,7 +123,7 @@ void CRYPT_SHA1Finish(CRYPT_sha1_context* s, uint8_t digest[20]) {
}
lenhi = (s->lenhi << 3) | (s->lenlo >> (32 - 3));
lenlo = (s->lenlo << 3);
- FXSYS_memset(c, 0, pad);
+ memset(c, 0, pad);
c[0] = 0x80;
CRYPT_SHA1Update(s, c, pad);
c[0] = (lenhi >> 24) & 0xFF;
@@ -307,7 +307,7 @@ void CRYPT_SHA256Update(CRYPT_sha256_context* ctx,
ctx->total[1]++;
}
if (left && length >= fill) {
- FXSYS_memcpy((void*)(ctx->buffer + left), (void*)input, fill);
+ memcpy((void*)(ctx->buffer + left), (void*)input, fill);
sha256_process(ctx, ctx->buffer);
length -= fill;
input += fill;
@@ -319,7 +319,7 @@ void CRYPT_SHA256Update(CRYPT_sha256_context* ctx,
input += 64;
}
if (length) {
- FXSYS_memcpy((void*)(ctx->buffer + left), (void*)input, length);
+ memcpy((void*)(ctx->buffer + left), (void*)input, length);
}
}
@@ -385,7 +385,7 @@ void CRYPT_SHA384Start(CRYPT_sha384_context* ctx) {
if (!ctx)
return;
- FXSYS_memset(ctx, 0, sizeof(CRYPT_sha384_context));
+ memset(ctx, 0, sizeof(CRYPT_sha384_context));
ctx->state[0] = FX_ato64i("cbbb9d5dc1059ed8");
ctx->state[1] = FX_ato64i("629a292a367cd507");
ctx->state[2] = FX_ato64i("9159015a3070dd17");
@@ -556,7 +556,7 @@ void CRYPT_SHA384Update(CRYPT_sha384_context* ctx,
ctx->total[1]++;
}
if (left && length >= fill) {
- FXSYS_memcpy((void*)(ctx->buffer + left), (void*)input, fill);
+ memcpy((void*)(ctx->buffer + left), (void*)input, fill);
sha384_process(ctx, ctx->buffer);
length -= fill;
input += fill;
@@ -568,14 +568,14 @@ void CRYPT_SHA384Update(CRYPT_sha384_context* ctx,
input += 128;
}
if (length) {
- FXSYS_memcpy((void*)(ctx->buffer + left), (void*)input, length);
+ memcpy((void*)(ctx->buffer + left), (void*)input, length);
}
}
void CRYPT_SHA384Finish(CRYPT_sha384_context* ctx, uint8_t digest[48]) {
uint32_t last, padn;
uint8_t msglen[16];
- FXSYS_memset(msglen, 0, 16);
+ memset(msglen, 0, 16);
uint64_t high, low;
high = (ctx->total[0] >> 29) | (ctx->total[1] << 3);
low = (ctx->total[0] << 3);
@@ -607,7 +607,7 @@ void CRYPT_SHA512Start(void* context) {
return;
}
CRYPT_sha384_context* ctx = (CRYPT_sha384_context*)context;
- FXSYS_memset(ctx, 0, sizeof(CRYPT_sha384_context));
+ memset(ctx, 0, sizeof(CRYPT_sha384_context));
ctx->state[0] = FX_ato64i("6a09e667f3bcc908");
ctx->state[1] = FX_ato64i("bb67ae8584caa73b");
ctx->state[2] = FX_ato64i("3c6ef372fe94f82b");
@@ -627,7 +627,7 @@ void CRYPT_SHA512Finish(void* context, uint8_t digest[64]) {
CRYPT_sha384_context* ctx = (CRYPT_sha384_context*)context;
uint32_t last, padn;
uint8_t msglen[16];
- FXSYS_memset(msglen, 0, 16);
+ memset(msglen, 0, 16);
uint64_t high, low;
high = (ctx->total[0] >> 29) | (ctx->total[1] << 3);
low = (ctx->total[0] << 3);