Acquire exclusive access to the SHA shared memory block at SHA_TEXT_BASE This memory block is shared across all the SHA algorithm types. Caller should have already locked a SHA engine before calling this function. Note that it is possible to obtain exclusive access to the memory block even while it is in use by the SHA engine. Caller should use esp_sha_wait_idle() to ensure the SHA engine is not reading from the memory block in hardware. Call esp_sha_unlock_memory_block() when done.
This function enters a critical section. Do not block while holding this lock. You do not need to lock the memory block before calling esp_sha_block() or esp_sha_read_digest_state(), these functions handle memory block locking internally.