Skip to content

Commit 3362cbb

Browse files
nickzoicdpgeorge
authored andcommitted
esp32: Call initialization function on sha1 and sha256.
Add in calls to mbedtls_sha1_starts() and mbedtls_sha256_starts().
1 parent 6a8dad6 commit 3362cbb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ports/esp32/moduhashlib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ STATIC mp_obj_t sha256_make_new(const mp_obj_type_t *type,
4646
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(union sha_ctxs));
4747
o->base.type = type;
4848
mbedtls_sha256_init(&o->state.sha256);
49+
mbedtls_sha256_starts(&o->state.sha256, 0);
4950
if (n_args == 1) {
5051
sha256_update(MP_OBJ_FROM_PTR(o), args[0]);
5152
}
@@ -58,6 +59,7 @@ STATIC mp_obj_t sha1_make_new(const mp_obj_type_t *type,
5859
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(union sha_ctxs));
5960
o->base.type = type;
6061
mbedtls_sha1_init(&o->state.sha1);
62+
mbedtls_sha1_starts(&o->state.sha1);
6163
if (n_args == 1) {
6264
sha1_update(MP_OBJ_FROM_PTR(o), args[0]);
6365
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy