1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 PyDoc_STRVAR(SHA512Type_copy__doc__,
6 "copy($self, /)\n"
7 "--\n"
8 "\n"
9 "Return a copy of the hash object.");
10 
11 #define SHA512TYPE_COPY_METHODDEF    \
12     {"copy", (PyCFunction)SHA512Type_copy, METH_NOARGS, SHA512Type_copy__doc__},
13 
14 static PyObject *
15 SHA512Type_copy_impl(SHAobject *self);
16 
17 static PyObject *
SHA512Type_copy(SHAobject * self,PyObject * Py_UNUSED (ignored))18 SHA512Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored))
19 {
20     return SHA512Type_copy_impl(self);
21 }
22 
23 PyDoc_STRVAR(SHA512Type_digest__doc__,
24 "digest($self, /)\n"
25 "--\n"
26 "\n"
27 "Return the digest value as a bytes object.");
28 
29 #define SHA512TYPE_DIGEST_METHODDEF    \
30     {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__},
31 
32 static PyObject *
33 SHA512Type_digest_impl(SHAobject *self);
34 
35 static PyObject *
SHA512Type_digest(SHAobject * self,PyObject * Py_UNUSED (ignored))36 SHA512Type_digest(SHAobject *self, PyObject *Py_UNUSED(ignored))
37 {
38     return SHA512Type_digest_impl(self);
39 }
40 
41 PyDoc_STRVAR(SHA512Type_hexdigest__doc__,
42 "hexdigest($self, /)\n"
43 "--\n"
44 "\n"
45 "Return the digest value as a string of hexadecimal digits.");
46 
47 #define SHA512TYPE_HEXDIGEST_METHODDEF    \
48     {"hexdigest", (PyCFunction)SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__},
49 
50 static PyObject *
51 SHA512Type_hexdigest_impl(SHAobject *self);
52 
53 static PyObject *
SHA512Type_hexdigest(SHAobject * self,PyObject * Py_UNUSED (ignored))54 SHA512Type_hexdigest(SHAobject *self, PyObject *Py_UNUSED(ignored))
55 {
56     return SHA512Type_hexdigest_impl(self);
57 }
58 
59 PyDoc_STRVAR(SHA512Type_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 SHA512TYPE_UPDATE_METHODDEF    \
66     {"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__},
67 
68 PyDoc_STRVAR(_sha512_sha512__doc__,
69 "sha512($module, /, string=b\'\')\n"
70 "--\n"
71 "\n"
72 "Return a new SHA-512 hash object; optionally initialized with a string.");
73 
74 #define _SHA512_SHA512_METHODDEF    \
75     {"sha512", (PyCFunction)(void(*)(void))_sha512_sha512, METH_FASTCALL|METH_KEYWORDS, _sha512_sha512__doc__},
76 
77 static PyObject *
78 _sha512_sha512_impl(PyObject *module, PyObject *string);
79 
80 static PyObject *
_sha512_sha512(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)81 _sha512_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
82 {
83     PyObject *return_value = NULL;
84     static const char * const _keywords[] = {"string", NULL};
85     static _PyArg_Parser _parser = {NULL, _keywords, "sha512", 0};
86     PyObject *argsbuf[1];
87     Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
88     PyObject *string = NULL;
89 
90     args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
91     if (!args) {
92         goto exit;
93     }
94     if (!noptargs) {
95         goto skip_optional_pos;
96     }
97     string = args[0];
98 skip_optional_pos:
99     return_value = _sha512_sha512_impl(module, string);
100 
101 exit:
102     return return_value;
103 }
104 
105 PyDoc_STRVAR(_sha512_sha384__doc__,
106 "sha384($module, /, string=b\'\')\n"
107 "--\n"
108 "\n"
109 "Return a new SHA-384 hash object; optionally initialized with a string.");
110 
111 #define _SHA512_SHA384_METHODDEF    \
112     {"sha384", (PyCFunction)(void(*)(void))_sha512_sha384, METH_FASTCALL|METH_KEYWORDS, _sha512_sha384__doc__},
113 
114 static PyObject *
115 _sha512_sha384_impl(PyObject *module, PyObject *string);
116 
117 static PyObject *
_sha512_sha384(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)118 _sha512_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
119 {
120     PyObject *return_value = NULL;
121     static const char * const _keywords[] = {"string", NULL};
122     static _PyArg_Parser _parser = {NULL, _keywords, "sha384", 0};
123     PyObject *argsbuf[1];
124     Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
125     PyObject *string = NULL;
126 
127     args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
128     if (!args) {
129         goto exit;
130     }
131     if (!noptargs) {
132         goto skip_optional_pos;
133     }
134     string = args[0];
135 skip_optional_pos:
136     return_value = _sha512_sha384_impl(module, string);
137 
138 exit:
139     return return_value;
140 }
141 /*[clinic end generated code: output=580df4b667084a7e input=a9049054013a1b77]*/
142