Hello,
when I am calculating a SHA256 hash via hashcrypt functions for messages longer than 120000 Bytes I get wrong hash results (see screenshot). You can see the python results on the left and the NXP MCU calculated values on the right.

I am caluclating the hash for byte arrays filled with "0xAB". Is there some limitation to the message size that can be hashed by the hashcrypt periphery?
I am using a LPC55S28 MCU. I am testing this with following function based on the hashcrypt example:
void TestSha256(void)
{
static uint8_t message[MESSAGE_SIZE];
for (int i = 0; i < MESSAGE_SIZE; i++)
{
message[i] = 0xab;
}
status_t status;
size_t outLength;
unsigned int length;
unsigned char output[32];
length = sizeof(message);
outLength = sizeof(output);
memset(&output, 0, outLength);
/************************ SHA-256 **************************/
status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, 100000, output, &outLength);
TEST_ASSERT(kStatus_Success == status);
TEST_ASSERT(outLength == 32u);
PRINTF("100kiB: ");
for (int i = 0; i < 32; i++)
{
PRINTF("%x", output[i]);
}
PRINTF("\n");
status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, 120000, output, &outLength);
TEST_ASSERT(kStatus_Success == status);
TEST_ASSERT(outLength == 32u);
PRINTF("120kiB: ");
for (int i = 0; i < 32; i++)
{
PRINTF("%x", output[i]);
}
PRINTF("\n");
status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, 130000, output, &outLength);
TEST_ASSERT(kStatus_Success == status);
TEST_ASSERT(outLength == 32u);
PRINTF("130kiB: ");
for (int i = 0; i < 32; i++)
{
PRINTF("%x", output[i]);
}
PRINTF("\n");
status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, 140000, output, &outLength);
TEST_ASSERT(kStatus_Success == status);
TEST_ASSERT(outLength == 32u);
PRINTF("140kiB: ");
for (int i = 0; i < 32; i++)
{
PRINTF("%x", output[i]);
}
PRINTF("\n");
status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, 150000, output, &outLength);
TEST_ASSERT(kStatus_Success == status);
TEST_ASSERT(outLength == 32u);
PRINTF("150kiB: ");
for (int i = 0; i < 32; i++)
{
PRINTF("%x", output[i]);
}
PRINTF("\n");
}