I have a few questions about the SHA function and the implementation in the FSL drivers fsl_hashcrypt.c.
I need the SHA checksum to check the firmware in the internal flash memory
I am currently using version 11 of the LPC55S28 SDK and the HASHCRYPT_SHA() function there
1. Is it possible to use a flash memory area directly as a source in register MEMADDR, according to the LPC manual only SRAM0 or SRAMX can be used, but the version with direct flash access is also suggested here in the forum, or does the flash data have to be copied to the RAM first? .
The calculation with the flash memory actually worked without any problems and also generated correct SHA checksums.
2. There seems to be a bug in the FSL drivers in the fsl_hashcrypt.c module. The functions of the SHA calculation, e.g. hashcrypt_sha_process_message_data, only evaluate the HASHCRYPT_STATUS_DIGEST_MASK but not HASHCRYPT_STATUS_ERROR_MASK in the event of an error, the drivers never come back and the watchdog strikes. This happens when trying to calculate the SHA of a deleted Flashpage, where the HASHCRYPT_STATUS_ERROR_MASK flag is set.
We are currently using the SDK version 11, but the query is also identical in version 12. The start address of the flash memory is aligned. (0x20000)
3. The SHA drivers do not check the length of the data, if more than the possible 2047 blocks 131008 bytes are specified, there is no error message but an incorrect SHA
It would be great if someone could help me with the issues.