diff options
| author | shadchin <[email protected]> | 2024-04-28 21:17:44 +0300 |
|---|---|---|
| committer | shadchin <[email protected]> | 2024-04-28 21:25:54 +0300 |
| commit | a55d99a3eb72f90355bc146baeda18aa7eb97352 (patch) | |
| tree | b17cfed786effe8b81bba022239d6729f716fbeb /contrib/tools/python3/Modules/md5module.c | |
| parent | 67bf49d08acf1277eff4c336021ac22d964bb4c4 (diff) | |
Update Python 3 to 3.12.3
7d09de7d8b99ea2be554ef0fc61276942ca9c2e1
Diffstat (limited to 'contrib/tools/python3/Modules/md5module.c')
| -rw-r--r-- | contrib/tools/python3/Modules/md5module.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/contrib/tools/python3/Modules/md5module.c b/contrib/tools/python3/Modules/md5module.c index 2122f8b18ba..dcc9da38d75 100644 --- a/contrib/tools/python3/Modules/md5module.c +++ b/contrib/tools/python3/Modules/md5module.c @@ -52,7 +52,7 @@ typedef struct { // Prevents undefined behavior via multiple threads entering the C API. // The lock will be NULL before threaded access has been enabled. PyThread_type_lock lock; - Hacl_Streaming_MD5_state *hash_state; + Hacl_Hash_MD5_state_t *hash_state; } MD5object; #include "clinic/md5module.c.h" @@ -90,11 +90,11 @@ MD5_traverse(PyObject *ptr, visitproc visit, void *arg) static void MD5_dealloc(MD5object *ptr) { - Hacl_Streaming_MD5_legacy_free(ptr->hash_state); + Hacl_Hash_MD5_free(ptr->hash_state); if (ptr->lock != NULL) { PyThread_free_lock(ptr->lock); } - PyTypeObject *tp = Py_TYPE(ptr); + PyTypeObject *tp = Py_TYPE((PyObject*)ptr); PyObject_GC_UnTrack(ptr); PyObject_GC_Del(ptr); Py_DECREF(tp); @@ -122,7 +122,7 @@ MD5Type_copy_impl(MD5object *self, PyTypeObject *cls) return NULL; ENTER_HASHLIB(self); - newobj->hash_state = Hacl_Streaming_MD5_legacy_copy(self->hash_state); + newobj->hash_state = Hacl_Hash_MD5_copy(self->hash_state); LEAVE_HASHLIB(self); return (PyObject *)newobj; } @@ -139,7 +139,7 @@ MD5Type_digest_impl(MD5object *self) { unsigned char digest[MD5_DIGESTSIZE]; ENTER_HASHLIB(self); - Hacl_Streaming_MD5_legacy_finish(self->hash_state, digest); + Hacl_Hash_MD5_digest(self->hash_state, digest); LEAVE_HASHLIB(self); return PyBytes_FromStringAndSize((const char *)digest, MD5_DIGESTSIZE); } @@ -156,20 +156,20 @@ MD5Type_hexdigest_impl(MD5object *self) { unsigned char digest[MD5_DIGESTSIZE]; ENTER_HASHLIB(self); - Hacl_Streaming_MD5_legacy_finish(self->hash_state, digest); + Hacl_Hash_MD5_digest(self->hash_state, digest); LEAVE_HASHLIB(self); return _Py_strhex((const char*)digest, MD5_DIGESTSIZE); } -static void update(Hacl_Streaming_MD5_state *state, uint8_t *buf, Py_ssize_t len) { +static void update(Hacl_Hash_MD5_state_t *state, uint8_t *buf, Py_ssize_t len) { #if PY_SSIZE_T_MAX > UINT32_MAX while (len > UINT32_MAX) { - Hacl_Streaming_MD5_legacy_update(state, buf, UINT32_MAX); + Hacl_Hash_MD5_update(state, buf, UINT32_MAX); len -= UINT32_MAX; buf += UINT32_MAX; } #endif - Hacl_Streaming_MD5_legacy_update(state, buf, (uint32_t) len); + Hacl_Hash_MD5_update(state, buf, (uint32_t) len); } /*[clinic input] @@ -293,7 +293,7 @@ _md5_md5_impl(PyObject *module, PyObject *string, int usedforsecurity) return NULL; } - new->hash_state = Hacl_Streaming_MD5_legacy_create_in(); + new->hash_state = Hacl_Hash_MD5_malloc(); if (PyErr_Occurred()) { Py_DECREF(new); |
