Other Parts Discussed in Thread: AM2634
Hi, experts,
Customers want to do HASH on sub-set of image for each core in SBL. The multi-core image is read into SRAM, and specific sub-set of image for each core is used for HASH operation.
For example, four R5F cores are needed in the use case, and the combined image for all these four cores are loaded by SBL. The first 256 bytes of image of each R5F core are used for HASH. Not the whole image are used for HASH because of time saving. Correspondingly, the expected HASH digest is generated on PC, where the 4 * 256 bytes (4 R5F cores, 256 bytes from image for each core) is processed continuously as a 1024 bytes data block.
Then, in the AM2634 side, as these four 256 bytes data blocks are not stored in consecutive address space, the DTHE_SHA_compute() API is called four times, and each time it uses a default initial digest. But to get same HASH digest as the expected one, in these four DTHE_SHA_compute() calls, the latter one should use the result digest of the former one as its initial digest.
So, customers are asking if they can specify initial digest when calling DTHE_SHA_compute()? ex. use result digest of previous DTHE_SHA_compute() as initial digest of current DTHE_SHA_compute()
In AM263x Security Hardware Addendum, it is said "When loaded with a data block, and optionally an intermediate digest, it independently performs the hash computation (64 or 80 rounds, depending on the algorithm) on that data block." and "The engine can also start from the specified initial digest values instead of a loaded intermediate.".
Is "algorithm constants" in HASH engine designed for this kind of use case? How to use it in API level to fulfill customers' requirement?
Thanks.