Merge branch 'bugfix/sha_ownership' into 'master'

hwcrypto sha: Allow SHA contexts to be shared between tasks

See merge request idf/esp-idf!4010
This commit is contained in:
Jiang Jiang Jian
2019-01-24 14:07:23 +08:00
3 changed files with 137 additions and 51 deletions
+4
View File
@@ -166,6 +166,8 @@ void esp_sha_unlock_engine(esp_sha_type sha_type);
* 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.
*
* @note This function enters a critical section. Do not block while holding this lock.
*
* @note 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.
*
* Call esp_sha_unlock_memory_block() when done.
@@ -177,6 +179,8 @@ void esp_sha_lock_memory_block(void);
*
* Caller should have already locked a SHA engine before calling this function.
*
* This function releases the critical section entered by esp_sha_lock_memory_block().
*
* Call following esp_sha_lock_memory_block().
*/
void esp_sha_unlock_memory_block(void);