blob: 78f7743480eced71b622101c20b7584e87944fbb [file] [log] [blame]
Serhiy Storchaka1009bf12015-04-03 23:53:51 +03001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5#if defined(PY_LONG_LONG)
6
7PyDoc_STRVAR(SHA512Type_copy__doc__,
8"copy($self, /)\n"
9"--\n"
10"\n"
11"Return a copy of the hash object.");
12
13#define SHA512TYPE_COPY_METHODDEF \
14 {"copy", (PyCFunction)SHA512Type_copy, METH_NOARGS, SHA512Type_copy__doc__},
15
16static PyObject *
17SHA512Type_copy_impl(SHAobject *self);
18
19static PyObject *
20SHA512Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored))
21{
22 return SHA512Type_copy_impl(self);
23}
24
25#endif /* defined(PY_LONG_LONG) */
26
27#if defined(PY_LONG_LONG)
28
29PyDoc_STRVAR(SHA512Type_digest__doc__,
30"digest($self, /)\n"
31"--\n"
32"\n"
33"Return the digest value as a string of binary data.");
34
35#define SHA512TYPE_DIGEST_METHODDEF \
36 {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__},
37
38static PyObject *
39SHA512Type_digest_impl(SHAobject *self);
40
41static PyObject *
42SHA512Type_digest(SHAobject *self, PyObject *Py_UNUSED(ignored))
43{
44 return SHA512Type_digest_impl(self);
45}
46
47#endif /* defined(PY_LONG_LONG) */
48
49#if defined(PY_LONG_LONG)
50
51PyDoc_STRVAR(SHA512Type_hexdigest__doc__,
52"hexdigest($self, /)\n"
53"--\n"
54"\n"
55"Return the digest value as a string of hexadecimal digits.");
56
57#define SHA512TYPE_HEXDIGEST_METHODDEF \
58 {"hexdigest", (PyCFunction)SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__},
59
60static PyObject *
61SHA512Type_hexdigest_impl(SHAobject *self);
62
63static PyObject *
64SHA512Type_hexdigest(SHAobject *self, PyObject *Py_UNUSED(ignored))
65{
66 return SHA512Type_hexdigest_impl(self);
67}
68
69#endif /* defined(PY_LONG_LONG) */
70
71#if defined(PY_LONG_LONG)
72
73PyDoc_STRVAR(SHA512Type_update__doc__,
74"update($self, obj, /)\n"
75"--\n"
76"\n"
77"Update this hash object\'s state with the provided string.");
78
79#define SHA512TYPE_UPDATE_METHODDEF \
80 {"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__},
81
82#endif /* defined(PY_LONG_LONG) */
83
84#if defined(PY_LONG_LONG)
85
86PyDoc_STRVAR(_sha512_sha512__doc__,
87"sha512($module, /, string=b\'\')\n"
88"--\n"
89"\n"
90"Return a new SHA-512 hash object; optionally initialized with a string.");
91
92#define _SHA512_SHA512_METHODDEF \
93 {"sha512", (PyCFunction)_sha512_sha512, METH_VARARGS|METH_KEYWORDS, _sha512_sha512__doc__},
94
95static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030096_sha512_sha512_impl(PyObject *module, PyObject *string);
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030097
98static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030099_sha512_sha512(PyObject *module, PyObject *args, PyObject *kwargs)
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300100{
101 PyObject *return_value = NULL;
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300102 static const char * const _keywords[] = {"string", NULL};
103 static _PyArg_Parser _parser = {"|O:sha512", _keywords, 0};
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300104 PyObject *string = NULL;
105
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300106 if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300107 &string)) {
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300108 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300109 }
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300110 return_value = _sha512_sha512_impl(module, string);
111
112exit:
113 return return_value;
114}
115
116#endif /* defined(PY_LONG_LONG) */
117
118#if defined(PY_LONG_LONG)
119
120PyDoc_STRVAR(_sha512_sha384__doc__,
121"sha384($module, /, string=b\'\')\n"
122"--\n"
123"\n"
124"Return a new SHA-384 hash object; optionally initialized with a string.");
125
126#define _SHA512_SHA384_METHODDEF \
127 {"sha384", (PyCFunction)_sha512_sha384, METH_VARARGS|METH_KEYWORDS, _sha512_sha384__doc__},
128
129static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300130_sha512_sha384_impl(PyObject *module, PyObject *string);
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300131
132static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300133_sha512_sha384(PyObject *module, PyObject *args, PyObject *kwargs)
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300134{
135 PyObject *return_value = NULL;
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300136 static const char * const _keywords[] = {"string", NULL};
137 static _PyArg_Parser _parser = {"|O:sha384", _keywords, 0};
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300138 PyObject *string = NULL;
139
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300140 if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300141 &string)) {
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300142 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300143 }
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300144 return_value = _sha512_sha384_impl(module, string);
145
146exit:
147 return return_value;
148}
149
150#endif /* defined(PY_LONG_LONG) */
151
152#ifndef SHA512TYPE_COPY_METHODDEF
153 #define SHA512TYPE_COPY_METHODDEF
154#endif /* !defined(SHA512TYPE_COPY_METHODDEF) */
155
156#ifndef SHA512TYPE_DIGEST_METHODDEF
157 #define SHA512TYPE_DIGEST_METHODDEF
158#endif /* !defined(SHA512TYPE_DIGEST_METHODDEF) */
159
160#ifndef SHA512TYPE_HEXDIGEST_METHODDEF
161 #define SHA512TYPE_HEXDIGEST_METHODDEF
162#endif /* !defined(SHA512TYPE_HEXDIGEST_METHODDEF) */
163
164#ifndef SHA512TYPE_UPDATE_METHODDEF
165 #define SHA512TYPE_UPDATE_METHODDEF
166#endif /* !defined(SHA512TYPE_UPDATE_METHODDEF) */
167
168#ifndef _SHA512_SHA512_METHODDEF
169 #define _SHA512_SHA512_METHODDEF
170#endif /* !defined(_SHA512_SHA512_METHODDEF) */
171
172#ifndef _SHA512_SHA384_METHODDEF
173 #define _SHA512_SHA384_METHODDEF
174#endif /* !defined(_SHA512_SHA384_METHODDEF) */
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300175/*[clinic end generated code: output=cf0da76cb603d1bf input=a9049054013a1b77]*/