summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Modules/sha1module.c
diff options
context:
space:
mode:
authorshadchin <[email protected]>2024-04-28 21:17:44 +0300
committershadchin <[email protected]>2024-04-28 21:25:54 +0300
commita55d99a3eb72f90355bc146baeda18aa7eb97352 (patch)
treeb17cfed786effe8b81bba022239d6729f716fbeb /contrib/tools/python3/Modules/sha1module.c
parent67bf49d08acf1277eff4c336021ac22d964bb4c4 (diff)
Update Python 3 to 3.12.3
7d09de7d8b99ea2be554ef0fc61276942ca9c2e1
Diffstat (limited to 'contrib/tools/python3/Modules/sha1module.c')
-rw-r--r--contrib/tools/python3/Modules/sha1module.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/tools/python3/Modules/sha1module.c b/contrib/tools/python3/Modules/sha1module.c
index c66269b5f5c..624dc57b0a3 100644
--- a/contrib/tools/python3/Modules/sha1module.c
+++ b/contrib/tools/python3/Modules/sha1module.c
@@ -51,7 +51,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_SHA1_state *hash_state;
+ Hacl_Hash_SHA1_state_t *hash_state;
} SHA1object;
#include "clinic/sha1module.c.h"
@@ -90,7 +90,7 @@ SHA1_traverse(PyObject *ptr, visitproc visit, void *arg)
static void
SHA1_dealloc(SHA1object *ptr)
{
- Hacl_Streaming_SHA1_legacy_free(ptr->hash_state);
+ Hacl_Hash_SHA1_free(ptr->hash_state);
if (ptr->lock != NULL) {
PyThread_free_lock(ptr->lock);
}
@@ -122,7 +122,7 @@ SHA1Type_copy_impl(SHA1object *self, PyTypeObject *cls)
return NULL;
ENTER_HASHLIB(self);
- newobj->hash_state = Hacl_Streaming_SHA1_legacy_copy(self->hash_state);
+ newobj->hash_state = Hacl_Hash_SHA1_copy(self->hash_state);
LEAVE_HASHLIB(self);
return (PyObject *)newobj;
}
@@ -139,7 +139,7 @@ SHA1Type_digest_impl(SHA1object *self)
{
unsigned char digest[SHA1_DIGESTSIZE];
ENTER_HASHLIB(self);
- Hacl_Streaming_SHA1_legacy_finish(self->hash_state, digest);
+ Hacl_Hash_SHA1_digest(self->hash_state, digest);
LEAVE_HASHLIB(self);
return PyBytes_FromStringAndSize((const char *)digest, SHA1_DIGESTSIZE);
}
@@ -156,20 +156,20 @@ SHA1Type_hexdigest_impl(SHA1object *self)
{
unsigned char digest[SHA1_DIGESTSIZE];
ENTER_HASHLIB(self);
- Hacl_Streaming_SHA1_legacy_finish(self->hash_state, digest);
+ Hacl_Hash_SHA1_digest(self->hash_state, digest);
LEAVE_HASHLIB(self);
return _Py_strhex((const char *)digest, SHA1_DIGESTSIZE);
}
-static void update(Hacl_Streaming_SHA1_state *state, uint8_t *buf, Py_ssize_t len) {
+static void update(Hacl_Hash_SHA1_state_t *state, uint8_t *buf, Py_ssize_t len) {
#if PY_SSIZE_T_MAX > UINT32_MAX
while (len > UINT32_MAX) {
- Hacl_Streaming_SHA1_legacy_update(state, buf, UINT32_MAX);
+ Hacl_Hash_SHA1_update(state, buf, UINT32_MAX);
len -= UINT32_MAX;
buf += UINT32_MAX;
}
#endif
- Hacl_Streaming_SHA1_legacy_update(state, buf, (uint32_t) len);
+ Hacl_Hash_SHA1_update(state, buf, (uint32_t) len);
}
/*[clinic input]
@@ -293,7 +293,7 @@ _sha1_sha1_impl(PyObject *module, PyObject *string, int usedforsecurity)
return NULL;
}
- new->hash_state = Hacl_Streaming_SHA1_legacy_create_in();
+ new->hash_state = Hacl_Hash_SHA1_malloc();
if (PyErr_Occurred()) {
Py_DECREF(new);