Trust the compiler to eliminate unnecessary conversions.

This commit is contained in:
Dag-Erling Smørgrav 2014-07-11 10:07:24 +00:00 committed by des
parent fd77c1c38e
commit 8f42136d40
2 changed files with 0 additions and 4 deletions

View file

@ -117,10 +117,8 @@ md5_compute(md5_ctx *ctx, const uint8_t *block)
int i;
memcpy(w, block, 64);
#if WORDS_BIGENDIAN
for (i = 0; i < 16; ++i)
w[i] = le32toh(w[i]);
#endif
a = ctx->h[0];
b = ctx->h[1];
c = ctx->h[2];

View file

@ -85,10 +85,8 @@ sha1_compute(sha1_ctx *ctx, const uint8_t *block)
uint32_t w[80], a, b, c, d, e;
memcpy(w, block, 64);
#if !WORDS_BIGENDIAN
for (int i = 0; i < 16; ++i)
w[i] = be32toh(w[i]);
#endif
for (int i = 16; i < 80; ++i) {
w[i] = w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16];
w[i] = rol(w[i], 1);