diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Modules/sha256module.c | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/sha256module.c')
-rw-r--r-- | contrib/tools/python3/src/Modules/sha256module.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/contrib/tools/python3/src/Modules/sha256module.c b/contrib/tools/python3/src/Modules/sha256module.c index 9b885c7255..c3ab835ee0 100644 --- a/contrib/tools/python3/src/Modules/sha256module.c +++ b/contrib/tools/python3/src/Modules/sha256module.c @@ -17,8 +17,8 @@ /* SHA objects */ #include "Python.h" -#include "pycore_byteswap.h" // _Py_bswap32() -#include "structmember.h" // PyMemberDef +#include "pycore_byteswap.h" // _Py_bswap32() +#include "structmember.h" // PyMemberDef #include "hashlib.h" #include "pystrhex.h" @@ -31,7 +31,7 @@ class SHA256Type "SHAobject *" "&PyType_Type" /* Some useful types */ typedef unsigned char SHA_BYTE; -typedef uint32_t SHA_INT32; /* 32-bit integer */ +typedef uint32_t SHA_INT32; /* 32-bit integer */ /* The SHA block size and message digest sizes, in bytes */ @@ -58,8 +58,8 @@ typedef struct { static void longReverse(SHA_INT32 *buffer, int byteCount) { byteCount /= sizeof(*buffer); - for (; byteCount--; buffer++) { - *buffer = _Py_bswap32(*buffer); + for (; byteCount--; buffer++) { + *buffer = _Py_bswap32(*buffer); } } #endif @@ -93,7 +93,7 @@ static void SHAcopy(SHAobject *src, SHAobject *dest) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@iahu.ca, https://www.libtom.net + * Tom St Denis, tomstdenis@iahu.ca, https://www.libtom.net */ @@ -404,7 +404,7 @@ SHA256Type_copy_impl(SHAobject *self) { SHAobject *newobj; - if (Py_IS_TYPE(self, &SHA256type)) { + if (Py_IS_TYPE(self, &SHA256type)) { if ( (newobj = newSHA256object())==NULL) return NULL; } else { @@ -524,10 +524,10 @@ static PyTypeObject SHA224type = { 0, /*tp_itemsize*/ /* methods */ SHA_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ + 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_as_async*/ + 0, /*tp_as_async*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -558,10 +558,10 @@ static PyTypeObject SHA256type = { 0, /*tp_itemsize*/ /* methods */ SHA_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ + 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_as_async*/ + 0, /*tp_as_async*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -592,15 +592,15 @@ static PyTypeObject SHA256type = { _sha256.sha256 string: object(c_default="NULL") = b'' - * - usedforsecurity: bool = True + * + usedforsecurity: bool = True Return a new SHA-256 hash object; optionally initialized with a string. [clinic start generated code]*/ static PyObject * -_sha256_sha256_impl(PyObject *module, PyObject *string, int usedforsecurity) -/*[clinic end generated code: output=a1de327e8e1185cf input=9be86301aeb14ea5]*/ +_sha256_sha256_impl(PyObject *module, PyObject *string, int usedforsecurity) +/*[clinic end generated code: output=a1de327e8e1185cf input=9be86301aeb14ea5]*/ { SHAobject *new; Py_buffer buf; @@ -634,15 +634,15 @@ _sha256_sha256_impl(PyObject *module, PyObject *string, int usedforsecurity) _sha256.sha224 string: object(c_default="NULL") = b'' - * - usedforsecurity: bool = True + * + usedforsecurity: bool = True Return a new SHA-224 hash object; optionally initialized with a string. [clinic start generated code]*/ static PyObject * -_sha256_sha224_impl(PyObject *module, PyObject *string, int usedforsecurity) -/*[clinic end generated code: output=08be6b36569bc69c input=9fcfb46e460860ac]*/ +_sha256_sha224_impl(PyObject *module, PyObject *string, int usedforsecurity) +/*[clinic end generated code: output=08be6b36569bc69c input=9fcfb46e460860ac]*/ { SHAobject *new; Py_buffer buf; @@ -701,14 +701,14 @@ PyInit__sha256(void) { PyObject *m; - Py_SET_TYPE(&SHA224type, &PyType_Type); - if (PyType_Ready(&SHA224type) < 0) { + Py_SET_TYPE(&SHA224type, &PyType_Type); + if (PyType_Ready(&SHA224type) < 0) { return NULL; - } - Py_SET_TYPE(&SHA256type, &PyType_Type); - if (PyType_Ready(&SHA256type) < 0) { + } + Py_SET_TYPE(&SHA256type, &PyType_Type); + if (PyType_Ready(&SHA256type) < 0) { return NULL; - } + } m = PyModule_Create(&_sha256module); if (m == NULL) |