diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Modules/_sha3/sha3module.c | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/_sha3/sha3module.c')
-rw-r--r-- | contrib/tools/python3/src/Modules/_sha3/sha3module.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/contrib/tools/python3/src/Modules/_sha3/sha3module.c b/contrib/tools/python3/src/Modules/_sha3/sha3module.c index 5c7b9f38dc..b6a7130dd8 100644 --- a/contrib/tools/python3/src/Modules/_sha3/sha3module.c +++ b/contrib/tools/python3/src/Modules/_sha3/sha3module.c @@ -40,7 +40,7 @@ #elif PY_BIG_ENDIAN /* opt64 is not yet supported on big endian platforms */ #define KeccakOpt 32 -#elif SIZEOF_VOID_P == 8 +#elif SIZEOF_VOID_P == 8 /* opt64 works only on little-endian 64bit platforms with unsigned int64 */ #define KeccakOpt 64 #else @@ -48,9 +48,9 @@ #define KeccakOpt 32 #endif -#if KeccakOpt == 64 +#if KeccakOpt == 64 /* 64bit platforms with unsigned int64 */ - typedef uint64_t UINT64; + typedef uint64_t UINT64; typedef unsigned char UINT8; #endif @@ -64,11 +64,11 @@ #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN #endif -/* Prevent bus errors on platforms requiring aligned accesses such ARM. */ -#if HAVE_ALIGNED_REQUIRED && !defined(NO_MISALIGNED_ACCESSES) -#define NO_MISALIGNED_ACCESSES -#endif - +/* Prevent bus errors on platforms requiring aligned accesses such ARM. */ +#if HAVE_ALIGNED_REQUIRED && !defined(NO_MISALIGNED_ACCESSES) +#define NO_MISALIGNED_ACCESSES +#endif + /* mangle names */ #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb #define Keccak_HashFinal _PySHA3_Keccak_HashFinal @@ -174,20 +174,20 @@ newSHA3object(PyTypeObject *type) return newobj; } -/*[clinic input] -@classmethod -_sha3.sha3_224.__new__ as py_sha3_new - data: object(c_default="NULL") = b'' - / - * - usedforsecurity: bool = True - -Return a new BLAKE2b hash object. -[clinic start generated code]*/ - +/*[clinic input] +@classmethod +_sha3.sha3_224.__new__ as py_sha3_new + data: object(c_default="NULL") = b'' + / + * + usedforsecurity: bool = True + +Return a new BLAKE2b hash object. +[clinic start generated code]*/ + static PyObject * -py_sha3_new_impl(PyTypeObject *type, PyObject *data, int usedforsecurity) -/*[clinic end generated code: output=90409addc5d5e8b0 input=bcfcdf2e4368347a]*/ +py_sha3_new_impl(PyTypeObject *type, PyObject *data, int usedforsecurity) +/*[clinic end generated code: output=90409addc5d5e8b0 input=bcfcdf2e4368347a]*/ { SHA3object *self = NULL; Py_buffer buf = {NULL, NULL}; @@ -501,10 +501,10 @@ static PyGetSetDef SHA3_getseters[] = { 0, /* tp_itemsize */ \ /* methods */ \ (destructor)SHA3_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 */ \ @@ -537,22 +537,22 @@ static PyGetSetDef SHA3_getseters[] = { } PyDoc_STRVAR(sha3_224__doc__, -"sha3_224([data], *, usedforsecurity=True) -> SHA3 object\n\ +"sha3_224([data], *, usedforsecurity=True) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 28 bytes."); PyDoc_STRVAR(sha3_256__doc__, -"sha3_256([data], *, usedforsecurity=True) -> SHA3 object\n\ +"sha3_256([data], *, usedforsecurity=True) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 32 bytes."); PyDoc_STRVAR(sha3_384__doc__, -"sha3_384([data], *, usedforsecurity=True) -> SHA3 object\n\ +"sha3_384([data], *, usedforsecurity=True) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 48 bytes."); PyDoc_STRVAR(sha3_512__doc__, -"sha3_512([data], *, usedforsecurity=True) -> SHA3 object\n\ +"sha3_512([data], *, usedforsecurity=True) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 64 bytes."); @@ -563,22 +563,22 @@ SHA3_TYPE(SHA3_512type, "_sha3.sha3_512", sha3_512__doc__, SHA3_methods); #ifdef PY_WITH_KECCAK PyDoc_STRVAR(keccak_224__doc__, -"keccak_224([data], *, usedforsecurity=True) -> Keccak object\n\ +"keccak_224([data], *, usedforsecurity=True) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 28 bytes."); PyDoc_STRVAR(keccak_256__doc__, -"keccak_256([data], *, usedforsecurity=True) -> Keccak object\n\ +"keccak_256([data], *, usedforsecurity=True) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 32 bytes."); PyDoc_STRVAR(keccak_384__doc__, -"keccak_384([data], *, usedforsecurity=True) -> Keccak object\n\ +"keccak_384([data], *, usedforsecurity=True) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 48 bytes."); PyDoc_STRVAR(keccak_512__doc__, -"keccak_512([data], *, usedforsecurity=True) -> Keccak object\n\ +"keccak_512([data], *, usedforsecurity=True) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 64 bytes."); @@ -590,7 +590,7 @@ SHA3_TYPE(Keccak_512type, "_sha3.keccak_512", keccak_512__doc__, SHA3_methods); static PyObject * -_SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex) +_SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex) { unsigned char *digest = NULL; SHA3_state temp; @@ -640,15 +640,15 @@ _SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex) /*[clinic input] _sha3.shake_128.digest - length: unsigned_long + length: unsigned_long / Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * -_sha3_shake_128_digest_impl(SHA3object *self, unsigned long length) -/*[clinic end generated code: output=2313605e2f87bb8f input=418ef6a36d2e6082]*/ +_sha3_shake_128_digest_impl(SHA3object *self, unsigned long length) +/*[clinic end generated code: output=2313605e2f87bb8f input=418ef6a36d2e6082]*/ { return _SHAKE_digest(self, length, 0); } @@ -657,15 +657,15 @@ _sha3_shake_128_digest_impl(SHA3object *self, unsigned long length) /*[clinic input] _sha3.shake_128.hexdigest - length: unsigned_long + length: unsigned_long / Return the digest value as a string of hexadecimal digits. [clinic start generated code]*/ static PyObject * -_sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length) -/*[clinic end generated code: output=bf8e2f1e490944a8 input=69fb29b0926ae321]*/ +_sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length) +/*[clinic end generated code: output=bf8e2f1e490944a8 input=69fb29b0926ae321]*/ { return _SHAKE_digest(self, length, 1); } @@ -680,12 +680,12 @@ static PyMethodDef SHAKE_methods[] = { }; PyDoc_STRVAR(shake_128__doc__, -"shake_128([data], *, usedforsecurity=True) -> SHAKE object\n\ +"shake_128([data], *, usedforsecurity=True) -> SHAKE object\n\ \n\ Return a new SHAKE hash object."); PyDoc_STRVAR(shake_256__doc__, -"shake_256([data], *, usedforsecurity=True) -> SHAKE object\n\ +"shake_256([data], *, usedforsecurity=True) -> SHAKE object\n\ \n\ Return a new SHAKE hash object."); @@ -718,7 +718,7 @@ PyInit__sha3(void) #define init_sha3type(name, type) \ do { \ - Py_SET_TYPE(type, &PyType_Type); \ + Py_SET_TYPE(type, &PyType_Type); \ if (PyType_Ready(type) < 0) { \ goto error; \ } \ |