Skip to content
Snippets Groups Projects
Commit 68a5b0d7 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#8000 silence warnings

parent b5c0bc26
No related branches found
No related tags found
No related merge requests found
...@@ -568,6 +568,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { ...@@ -568,6 +568,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
sha2_word32 *d = (sha2_word32*)digest; sha2_word32 *d = (sha2_word32*)digest;
sha2_word64 *p;
unsigned int usedspace; unsigned int usedspace;
/* Sanity check: */ /* Sanity check: */
...@@ -605,7 +606,8 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { ...@@ -605,7 +606,8 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
*context->buffer = 0x80; *context->buffer = 0x80;
} }
/* Set the bit count: */ /* Set the bit count: */
*(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; p = (sha2_word64 *)&context->buffer[SHA256_SHORT_BLOCK_LENGTH];
*p = context->bitcount;
/* Final transform: */ /* Final transform: */
SHA256_Transform(context, (sha2_word32*)context->buffer); SHA256_Transform(context, (sha2_word32*)context->buffer);
...@@ -889,6 +891,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { ...@@ -889,6 +891,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
} }
void SHA512_Last(SHA512_CTX* context) { void SHA512_Last(SHA512_CTX* context) {
sha2_word64 *p;
unsigned int usedspace; unsigned int usedspace;
usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
...@@ -922,8 +925,9 @@ void SHA512_Last(SHA512_CTX* context) { ...@@ -922,8 +925,9 @@ void SHA512_Last(SHA512_CTX* context) {
*context->buffer = 0x80; *context->buffer = 0x80;
} }
/* Store the length of input data (in bits): */ /* Store the length of input data (in bits): */
*(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; p = (sha2_word64 *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH];
*(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; p[0] = context->bitcount[1];
p[1] = context->bitcount[0];
/* Final transform: */ /* Final transform: */
SHA512_Transform(context, (sha2_word64*)context->buffer); SHA512_Transform(context, (sha2_word64*)context->buffer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment