Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | PyDoc_STRVAR(SHA256Type_copy__doc__, |
| 6 | "copy($self, /)\n" |
| 7 | "--\n" |
| 8 | "\n" |
| 9 | "Return a copy of the hash object."); |
| 10 | |
| 11 | #define SHA256TYPE_COPY_METHODDEF \ |
| 12 | {"copy", (PyCFunction)SHA256Type_copy, METH_NOARGS, SHA256Type_copy__doc__}, |
| 13 | |
| 14 | static PyObject * |
| 15 | SHA256Type_copy_impl(SHAobject *self); |
| 16 | |
| 17 | static PyObject * |
| 18 | SHA256Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored)) |
| 19 | { |
| 20 | return SHA256Type_copy_impl(self); |
| 21 | } |
| 22 | |
| 23 | PyDoc_STRVAR(SHA256Type_digest__doc__, |
| 24 | "digest($self, /)\n" |
| 25 | "--\n" |
| 26 | "\n" |
| 27 | "Return the digest value as a string of binary data."); |
| 28 | |
| 29 | #define SHA256TYPE_DIGEST_METHODDEF \ |
| 30 | {"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, |
| 31 | |
| 32 | static PyObject * |
| 33 | SHA256Type_digest_impl(SHAobject *self); |
| 34 | |
| 35 | static PyObject * |
| 36 | SHA256Type_digest(SHAobject *self, PyObject *Py_UNUSED(ignored)) |
| 37 | { |
| 38 | return SHA256Type_digest_impl(self); |
| 39 | } |
| 40 | |
| 41 | PyDoc_STRVAR(SHA256Type_hexdigest__doc__, |
| 42 | "hexdigest($self, /)\n" |
| 43 | "--\n" |
| 44 | "\n" |
| 45 | "Return the digest value as a string of hexadecimal digits."); |
| 46 | |
| 47 | #define SHA256TYPE_HEXDIGEST_METHODDEF \ |
| 48 | {"hexdigest", (PyCFunction)SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__}, |
| 49 | |
| 50 | static PyObject * |
| 51 | SHA256Type_hexdigest_impl(SHAobject *self); |
| 52 | |
| 53 | static PyObject * |
| 54 | SHA256Type_hexdigest(SHAobject *self, PyObject *Py_UNUSED(ignored)) |
| 55 | { |
| 56 | return SHA256Type_hexdigest_impl(self); |
| 57 | } |
| 58 | |
| 59 | PyDoc_STRVAR(SHA256Type_update__doc__, |
| 60 | "update($self, obj, /)\n" |
| 61 | "--\n" |
| 62 | "\n" |
| 63 | "Update this hash object\'s state with the provided string."); |
| 64 | |
| 65 | #define SHA256TYPE_UPDATE_METHODDEF \ |
| 66 | {"update", (PyCFunction)SHA256Type_update, METH_O, SHA256Type_update__doc__}, |
| 67 | |
| 68 | PyDoc_STRVAR(_sha256_sha256__doc__, |
| 69 | "sha256($module, /, string=b\'\')\n" |
| 70 | "--\n" |
| 71 | "\n" |
| 72 | "Return a new SHA-256 hash object; optionally initialized with a string."); |
| 73 | |
| 74 | #define _SHA256_SHA256_METHODDEF \ |
| 75 | {"sha256", (PyCFunction)_sha256_sha256, METH_VARARGS|METH_KEYWORDS, _sha256_sha256__doc__}, |
| 76 | |
| 77 | static PyObject * |
| 78 | _sha256_sha256_impl(PyModuleDef *module, PyObject *string); |
| 79 | |
| 80 | static PyObject * |
| 81 | _sha256_sha256(PyModuleDef *module, PyObject *args, PyObject *kwargs) |
| 82 | { |
| 83 | PyObject *return_value = NULL; |
| 84 | static char *_keywords[] = {"string", NULL}; |
| 85 | PyObject *string = NULL; |
| 86 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 87 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha256", _keywords, |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 88 | &string)) |
| 89 | goto exit; |
| 90 | return_value = _sha256_sha256_impl(module, string); |
| 91 | |
| 92 | exit: |
| 93 | return return_value; |
| 94 | } |
| 95 | |
| 96 | PyDoc_STRVAR(_sha256_sha224__doc__, |
| 97 | "sha224($module, /, string=b\'\')\n" |
| 98 | "--\n" |
| 99 | "\n" |
| 100 | "Return a new SHA-224 hash object; optionally initialized with a string."); |
| 101 | |
| 102 | #define _SHA256_SHA224_METHODDEF \ |
| 103 | {"sha224", (PyCFunction)_sha256_sha224, METH_VARARGS|METH_KEYWORDS, _sha256_sha224__doc__}, |
| 104 | |
| 105 | static PyObject * |
| 106 | _sha256_sha224_impl(PyModuleDef *module, PyObject *string); |
| 107 | |
| 108 | static PyObject * |
| 109 | _sha256_sha224(PyModuleDef *module, PyObject *args, PyObject *kwargs) |
| 110 | { |
| 111 | PyObject *return_value = NULL; |
| 112 | static char *_keywords[] = {"string", NULL}; |
| 113 | PyObject *string = NULL; |
| 114 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 115 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha224", _keywords, |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 116 | &string)) |
| 117 | goto exit; |
| 118 | return_value = _sha256_sha224_impl(module, string); |
| 119 | |
| 120 | exit: |
| 121 | return return_value; |
| 122 | } |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 123 | /*[clinic end generated code: output=354cedf3b632c7b2 input=a9049054013a1b77]*/ |