Azure IoT common library
Fork of azure_c_shared_utility by
Diff: sha384-512.c
- Revision:
- 15:956c6d205aa7
- Parent:
- 0:fa2de1b79154
- Child:
- 19:2e0811512ceb
--- a/sha384-512.c Fri Oct 21 22:11:02 2016 +0000 +++ b/sha384-512.c Wed Nov 16 21:38:39 2016 -0800 @@ -52,6 +52,7 @@ #include "azure_c_shared_utility/sha-private.h" #ifdef USE_32BIT_ONLY +#error IoTHubClient does not support USE_32BIT_ONLY flag /* * Define 64-bit arithmetic in terms of 32-bit arithmetic. * Each 64-bit number is represented in a 2-word array. @@ -297,7 +298,6 @@ /* * add "length" to the length */ -static uint64_t addTemp; #define SHA384_512AddLength(context, length) \ (addTemp = context->Length_Low, context->Corrupted = \ ((context->Length_Low += length) < addTemp) && \ @@ -468,6 +468,7 @@ const uint8_t *message_array, unsigned int length) { + uint64_t addTemp; if (!length) return shaSuccess; @@ -519,6 +520,7 @@ int SHA512FinalBits(SHA512Context *context, const uint8_t message_bits, unsigned int length) { + uint64_t addTemp; uint8_t masks[8] = { /* 0 0b00000000 */ 0x00, /* 1 0b10000000 */ 0x80, /* 2 0b11000000 */ 0xC0, /* 3 0b11100000 */ 0xE0,