Skip to content

Commit

Permalink
SHA-256 Stream Clear API to call lower level mbedtls free (#31607)
Browse files Browse the repository at this point in the history
* Update MBEDTLS SHA-256 Clear to call lower level HW implementation

* Enable Power maangement for SHA-256 HW accel on TI platforms

* Revert "Enable Power maangement for SHA-256 HW accel on TI platforms"

This reverts commit db270a3.
  • Loading branch information
adabreuti authored and pull[bot] committed Apr 16, 2024
1 parent dc3cb25 commit 1007740
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/crypto/CHIPCryptoPALmbedTLS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ Hash_SHA256_stream::Hash_SHA256_stream()

Hash_SHA256_stream::~Hash_SHA256_stream()
{
mbedtls_sha256_context * context = to_inner_hash_sha256_context(&mContext);
mbedtls_sha256_free(context);
Clear();
}

Expand Down Expand Up @@ -272,6 +270,9 @@ CHIP_ERROR Hash_SHA256_stream::Finish(MutableByteSpan & out_buffer)

void Hash_SHA256_stream::Clear()
{
mbedtls_sha256_context * context = to_inner_hash_sha256_context(&mContext);
mbedtls_sha256_free(context);

mbedtls_platform_zeroize(this, sizeof(*this));
}

Expand Down

0 comments on commit 1007740

Please sign in to comment.