File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ void mbedtls_sha256_init(__unused mbedtls_sha256_context *ctx) {
3636}
3737
3838void mbedtls_sha256_free (__unused mbedtls_sha256_context * ctx ) {
39+ if (ctx -> locked ) {
40+ pico_sha256_unlock (ctx );
41+ }
3942}
4043
4144int mbedtls_sha256_starts_ret (mbedtls_sha256_context * ctx , int is224 ) {
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ typedef struct pico_sha256_state {
5858 size_t total_data_size ;
5959} pico_sha256_state_t ;
6060
61+ /*! \brief Release the internal lock on the SHA256 hardware
62+ * \ingroup pico_sha256
63+ *
64+ * Release the internal lock on the hardware.
65+ * Fails if the internal lock was not claimed.
66+ *
67+ * @param state A pointer to a pico_sha256_state_t instance
68+ */
69+ void __weak pico_sha256_unlock (pico_sha256_state_t * state );
70+
6171/*! \brief Start a SHA-256 calculation returning immediately with an error if the SHA-256 hardware is not available
6272 * \ingroup pico_sha256
6373 *
You can’t perform that action at this time.
0 commit comments