blob: c308739d44836bf28ccd03da208d253f6ea3421b [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 *
96_sha512_sha512_impl(PyModuleDef *module, PyObject *string);
97
98static PyObject *
99_sha512_sha512(PyModuleDef *module, PyObject *args, PyObject *kwargs)
100{
101 PyObject *return_value = NULL;
102 static char *_keywords[] = {"string", NULL};
103 PyObject *string = NULL;
104
Serhiy Storchaka247789c2015-04-24 00:40:51 +0300105 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha512", _keywords,
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300106 &string))
107 goto exit;
108 return_value = _sha512_sha512_impl(module, string);
109
110exit:
111 return return_value;
112}
113
114#endif /* defined(PY_LONG_LONG) */
115
116#if defined(PY_LONG_LONG)
117
118PyDoc_STRVAR(_sha512_sha384__doc__,
119"sha384($module, /, string=b\'\')\n"
120"--\n"
121"\n"
122"Return a new SHA-384 hash object; optionally initialized with a string.");
123
124#define _SHA512_SHA384_METHODDEF \
125 {"sha384", (PyCFunction)_sha512_sha384, METH_VARARGS|METH_KEYWORDS, _sha512_sha384__doc__},
126
127static PyObject *
128_sha512_sha384_impl(PyModuleDef *module, PyObject *string);
129
130static PyObject *
131_sha512_sha384(PyModuleDef *module, PyObject *args, PyObject *kwargs)
132{
133 PyObject *return_value = NULL;
134 static char *_keywords[] = {"string", NULL};
135 PyObject *string = NULL;
136
Serhiy Storchaka247789c2015-04-24 00:40:51 +0300137 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha384", _keywords,
Serhiy Storchaka1009bf12015-04-03 23:53:51 +0300138 &string))
139 goto exit;
140 return_value = _sha512_sha384_impl(module, string);
141
142exit:
143 return return_value;
144}
145
146#endif /* defined(PY_LONG_LONG) */
147
148#ifndef SHA512TYPE_COPY_METHODDEF
149 #define SHA512TYPE_COPY_METHODDEF
150#endif /* !defined(SHA512TYPE_COPY_METHODDEF) */
151
152#ifndef SHA512TYPE_DIGEST_METHODDEF
153 #define SHA512TYPE_DIGEST_METHODDEF
154#endif /* !defined(SHA512TYPE_DIGEST_METHODDEF) */
155
156#ifndef SHA512TYPE_HEXDIGEST_METHODDEF
157 #define SHA512TYPE_HEXDIGEST_METHODDEF
158#endif /* !defined(SHA512TYPE_HEXDIGEST_METHODDEF) */
159
160#ifndef SHA512TYPE_UPDATE_METHODDEF
161 #define SHA512TYPE_UPDATE_METHODDEF
162#endif /* !defined(SHA512TYPE_UPDATE_METHODDEF) */
163
164#ifndef _SHA512_SHA512_METHODDEF
165 #define _SHA512_SHA512_METHODDEF
166#endif /* !defined(_SHA512_SHA512_METHODDEF) */
167
168#ifndef _SHA512_SHA384_METHODDEF
169 #define _SHA512_SHA384_METHODDEF
170#endif /* !defined(_SHA512_SHA384_METHODDEF) */
Serhiy Storchaka247789c2015-04-24 00:40:51 +0300171/*[clinic end generated code: output=1c7d385731fee7c0 input=a9049054013a1b77]*/