Merge pull request #7266 from weihanglo/fix

This commit is contained in:
Edward Thomson
2026-05-16 10:48:34 +01:00
committed by GitHub

View File

@@ -83,12 +83,14 @@
* Add "length" to the length.
* Set Corrupted when overflow has occurred.
*/
static uint32_t addTemp;
#define SHA224_256AddLength(context, length) \
(addTemp = (context)->Length_Low, (context)->Corrupted = \
(((context)->Length_Low += (length)) < addTemp) && \
(++(context)->Length_High == 0) ? shaInputTooLong : \
(context)->Corrupted )
static int SHA224_256AddLength(SHA256Context *context, unsigned int length)
{
uint32_t addTemp = context->Length_Low;
context->Length_Low += length;
if (context->Length_Low < addTemp && ++context->Length_High == 0)
context->Corrupted = shaInputTooLong;
return context->Corrupted;
}
/* Local Function Prototypes */
static int SHA224_256Reset(SHA256Context *context, uint32_t *H0);