1 | n/a | /* |
---|
2 | n/a | * Written in 2013 by Dmitry Chestnykh <dmitry@codingrobots.com> |
---|
3 | n/a | * Modified for CPython by Christian Heimes <christian@python.org> |
---|
4 | n/a | * |
---|
5 | n/a | * To the extent possible under law, the author have dedicated all |
---|
6 | n/a | * copyright and related and neighboring rights to this software to |
---|
7 | n/a | * the public domain worldwide. This software is distributed without |
---|
8 | n/a | * any warranty. http://creativecommons.org/publicdomain/zero/1.0/ |
---|
9 | n/a | */ |
---|
10 | n/a | |
---|
11 | n/a | /* WARNING: autogenerated file! |
---|
12 | n/a | * |
---|
13 | n/a | * The blake2s_impl.c is autogenerated from blake2s_impl.c. |
---|
14 | n/a | */ |
---|
15 | n/a | |
---|
16 | n/a | #include "Python.h" |
---|
17 | n/a | #include "pystrhex.h" |
---|
18 | n/a | #ifdef WITH_THREAD |
---|
19 | n/a | #include "pythread.h" |
---|
20 | n/a | #endif |
---|
21 | n/a | |
---|
22 | n/a | #include "../hashlib.h" |
---|
23 | n/a | #include "blake2ns.h" |
---|
24 | n/a | |
---|
25 | n/a | #define HAVE_BLAKE2S 1 |
---|
26 | n/a | #define BLAKE2_LOCAL_INLINE(type) Py_LOCAL_INLINE(type) |
---|
27 | n/a | |
---|
28 | n/a | #include "impl/blake2.h" |
---|
29 | n/a | #include "impl/blake2-impl.h" /* for secure_zero_memory() and store48() */ |
---|
30 | n/a | |
---|
31 | n/a | #ifdef BLAKE2_USE_SSE |
---|
32 | n/a | #include "impl/blake2s.c" |
---|
33 | n/a | #else |
---|
34 | n/a | #include "impl/blake2s-ref.c" |
---|
35 | n/a | #endif |
---|
36 | n/a | |
---|
37 | n/a | |
---|
38 | n/a | extern PyTypeObject PyBlake2_BLAKE2sType; |
---|
39 | n/a | |
---|
40 | n/a | typedef struct { |
---|
41 | n/a | PyObject_HEAD |
---|
42 | n/a | blake2s_param param; |
---|
43 | n/a | blake2s_state state; |
---|
44 | n/a | #ifdef WITH_THREAD |
---|
45 | n/a | PyThread_type_lock lock; |
---|
46 | n/a | #endif |
---|
47 | n/a | } BLAKE2sObject; |
---|
48 | n/a | |
---|
49 | n/a | #include "clinic/blake2s_impl.c.h" |
---|
50 | n/a | |
---|
51 | n/a | /*[clinic input] |
---|
52 | n/a | module _blake2s |
---|
53 | n/a | class _blake2s.blake2s "BLAKE2sObject *" "&PyBlake2_BLAKE2sType" |
---|
54 | n/a | [clinic start generated code]*/ |
---|
55 | n/a | /*[clinic end generated code: output=da39a3ee5e6b4b0d input=edbfcf7557a685a7]*/ |
---|
56 | n/a | |
---|
57 | n/a | |
---|
58 | n/a | static BLAKE2sObject * |
---|
59 | n/a | new_BLAKE2sObject(PyTypeObject *type) |
---|
60 | n/a | { |
---|
61 | n/a | BLAKE2sObject *self; |
---|
62 | n/a | self = (BLAKE2sObject *)type->tp_alloc(type, 0); |
---|
63 | n/a | #ifdef WITH_THREAD |
---|
64 | n/a | if (self != NULL) { |
---|
65 | n/a | self->lock = NULL; |
---|
66 | n/a | } |
---|
67 | n/a | #endif |
---|
68 | n/a | return self; |
---|
69 | n/a | } |
---|
70 | n/a | |
---|
71 | n/a | /*[clinic input] |
---|
72 | n/a | @classmethod |
---|
73 | n/a | _blake2s.blake2s.__new__ as py_blake2s_new |
---|
74 | n/a | string as data: object = NULL |
---|
75 | n/a | * |
---|
76 | n/a | digest_size: int(c_default="BLAKE2S_OUTBYTES") = _blake2s.blake2s.MAX_DIGEST_SIZE |
---|
77 | n/a | key: Py_buffer = None |
---|
78 | n/a | salt: Py_buffer = None |
---|
79 | n/a | person: Py_buffer = None |
---|
80 | n/a | fanout: int = 1 |
---|
81 | n/a | depth: int = 1 |
---|
82 | n/a | leaf_size as leaf_size_obj: object = NULL |
---|
83 | n/a | node_offset as node_offset_obj: object = NULL |
---|
84 | n/a | node_depth: int = 0 |
---|
85 | n/a | inner_size: int = 0 |
---|
86 | n/a | last_node: bool = False |
---|
87 | n/a | |
---|
88 | n/a | Return a new BLAKE2s hash object. |
---|
89 | n/a | [clinic start generated code]*/ |
---|
90 | n/a | |
---|
91 | n/a | static PyObject * |
---|
92 | n/a | py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size, |
---|
93 | n/a | Py_buffer *key, Py_buffer *salt, Py_buffer *person, |
---|
94 | n/a | int fanout, int depth, PyObject *leaf_size_obj, |
---|
95 | n/a | PyObject *node_offset_obj, int node_depth, |
---|
96 | n/a | int inner_size, int last_node) |
---|
97 | n/a | /*[clinic end generated code: output=fe060b258a8cbfc6 input=458cfdcb3d0d47ff]*/ |
---|
98 | n/a | { |
---|
99 | n/a | BLAKE2sObject *self = NULL; |
---|
100 | n/a | Py_buffer buf; |
---|
101 | n/a | |
---|
102 | n/a | unsigned long leaf_size = 0; |
---|
103 | n/a | unsigned long long node_offset = 0; |
---|
104 | n/a | |
---|
105 | n/a | self = new_BLAKE2sObject(type); |
---|
106 | n/a | if (self == NULL) { |
---|
107 | n/a | goto error; |
---|
108 | n/a | } |
---|
109 | n/a | |
---|
110 | n/a | /* Zero parameter block. */ |
---|
111 | n/a | memset(&self->param, 0, sizeof(self->param)); |
---|
112 | n/a | |
---|
113 | n/a | /* Set digest size. */ |
---|
114 | n/a | if (digest_size <= 0 || digest_size > BLAKE2S_OUTBYTES) { |
---|
115 | n/a | PyErr_Format(PyExc_ValueError, |
---|
116 | n/a | "digest_size must be between 1 and %d bytes", |
---|
117 | n/a | BLAKE2S_OUTBYTES); |
---|
118 | n/a | goto error; |
---|
119 | n/a | } |
---|
120 | n/a | self->param.digest_length = digest_size; |
---|
121 | n/a | |
---|
122 | n/a | /* Set salt parameter. */ |
---|
123 | n/a | if ((salt->obj != NULL) && salt->len) { |
---|
124 | n/a | if (salt->len > BLAKE2S_SALTBYTES) { |
---|
125 | n/a | PyErr_Format(PyExc_ValueError, |
---|
126 | n/a | "maximum salt length is %d bytes", |
---|
127 | n/a | BLAKE2S_SALTBYTES); |
---|
128 | n/a | goto error; |
---|
129 | n/a | } |
---|
130 | n/a | memcpy(self->param.salt, salt->buf, salt->len); |
---|
131 | n/a | } |
---|
132 | n/a | |
---|
133 | n/a | /* Set personalization parameter. */ |
---|
134 | n/a | if ((person->obj != NULL) && person->len) { |
---|
135 | n/a | if (person->len > BLAKE2S_PERSONALBYTES) { |
---|
136 | n/a | PyErr_Format(PyExc_ValueError, |
---|
137 | n/a | "maximum person length is %d bytes", |
---|
138 | n/a | BLAKE2S_PERSONALBYTES); |
---|
139 | n/a | goto error; |
---|
140 | n/a | } |
---|
141 | n/a | memcpy(self->param.personal, person->buf, person->len); |
---|
142 | n/a | } |
---|
143 | n/a | |
---|
144 | n/a | /* Set tree parameters. */ |
---|
145 | n/a | if (fanout < 0 || fanout > 255) { |
---|
146 | n/a | PyErr_SetString(PyExc_ValueError, |
---|
147 | n/a | "fanout must be between 0 and 255"); |
---|
148 | n/a | goto error; |
---|
149 | n/a | } |
---|
150 | n/a | self->param.fanout = (uint8_t)fanout; |
---|
151 | n/a | |
---|
152 | n/a | if (depth <= 0 || depth > 255) { |
---|
153 | n/a | PyErr_SetString(PyExc_ValueError, |
---|
154 | n/a | "depth must be between 1 and 255"); |
---|
155 | n/a | goto error; |
---|
156 | n/a | } |
---|
157 | n/a | self->param.depth = (uint8_t)depth; |
---|
158 | n/a | |
---|
159 | n/a | if (leaf_size_obj != NULL) { |
---|
160 | n/a | leaf_size = PyLong_AsUnsignedLong(leaf_size_obj); |
---|
161 | n/a | if (leaf_size == (unsigned long) -1 && PyErr_Occurred()) { |
---|
162 | n/a | goto error; |
---|
163 | n/a | } |
---|
164 | n/a | if (leaf_size > 0xFFFFFFFFU) { |
---|
165 | n/a | PyErr_SetString(PyExc_OverflowError, "leaf_size is too large"); |
---|
166 | n/a | goto error; |
---|
167 | n/a | } |
---|
168 | n/a | } |
---|
169 | n/a | self->param.leaf_length = (unsigned int)leaf_size; |
---|
170 | n/a | |
---|
171 | n/a | if (node_offset_obj != NULL) { |
---|
172 | n/a | node_offset = PyLong_AsUnsignedLongLong(node_offset_obj); |
---|
173 | n/a | if (node_offset == (unsigned long long) -1 && PyErr_Occurred()) { |
---|
174 | n/a | goto error; |
---|
175 | n/a | } |
---|
176 | n/a | } |
---|
177 | n/a | #ifdef HAVE_BLAKE2S |
---|
178 | n/a | if (node_offset > 0xFFFFFFFFFFFFULL) { |
---|
179 | n/a | /* maximum 2**48 - 1 */ |
---|
180 | n/a | PyErr_SetString(PyExc_OverflowError, "node_offset is too large"); |
---|
181 | n/a | goto error; |
---|
182 | n/a | } |
---|
183 | n/a | store48(&(self->param.node_offset), node_offset); |
---|
184 | n/a | #else |
---|
185 | n/a | self->param.node_offset = node_offset; |
---|
186 | n/a | #endif |
---|
187 | n/a | |
---|
188 | n/a | if (node_depth < 0 || node_depth > 255) { |
---|
189 | n/a | PyErr_SetString(PyExc_ValueError, |
---|
190 | n/a | "node_depth must be between 0 and 255"); |
---|
191 | n/a | goto error; |
---|
192 | n/a | } |
---|
193 | n/a | self->param.node_depth = node_depth; |
---|
194 | n/a | |
---|
195 | n/a | if (inner_size < 0 || inner_size > BLAKE2S_OUTBYTES) { |
---|
196 | n/a | PyErr_Format(PyExc_ValueError, |
---|
197 | n/a | "inner_size must be between 0 and is %d", |
---|
198 | n/a | BLAKE2S_OUTBYTES); |
---|
199 | n/a | goto error; |
---|
200 | n/a | } |
---|
201 | n/a | self->param.inner_length = inner_size; |
---|
202 | n/a | |
---|
203 | n/a | /* Set key length. */ |
---|
204 | n/a | if ((key->obj != NULL) && key->len) { |
---|
205 | n/a | if (key->len > BLAKE2S_KEYBYTES) { |
---|
206 | n/a | PyErr_Format(PyExc_ValueError, |
---|
207 | n/a | "maximum key length is %d bytes", |
---|
208 | n/a | BLAKE2S_KEYBYTES); |
---|
209 | n/a | goto error; |
---|
210 | n/a | } |
---|
211 | n/a | self->param.key_length = (uint8_t)key->len; |
---|
212 | n/a | } |
---|
213 | n/a | |
---|
214 | n/a | /* Initialize hash state. */ |
---|
215 | n/a | if (blake2s_init_param(&self->state, &self->param) < 0) { |
---|
216 | n/a | PyErr_SetString(PyExc_RuntimeError, |
---|
217 | n/a | "error initializing hash state"); |
---|
218 | n/a | goto error; |
---|
219 | n/a | } |
---|
220 | n/a | |
---|
221 | n/a | /* Set last node flag (must come after initialization). */ |
---|
222 | n/a | self->state.last_node = last_node; |
---|
223 | n/a | |
---|
224 | n/a | /* Process key block if any. */ |
---|
225 | n/a | if (self->param.key_length) { |
---|
226 | n/a | uint8_t block[BLAKE2S_BLOCKBYTES]; |
---|
227 | n/a | memset(block, 0, sizeof(block)); |
---|
228 | n/a | memcpy(block, key->buf, key->len); |
---|
229 | n/a | blake2s_update(&self->state, block, sizeof(block)); |
---|
230 | n/a | secure_zero_memory(block, sizeof(block)); |
---|
231 | n/a | } |
---|
232 | n/a | |
---|
233 | n/a | /* Process initial data if any. */ |
---|
234 | n/a | if (data != NULL) { |
---|
235 | n/a | GET_BUFFER_VIEW_OR_ERROR(data, &buf, goto error); |
---|
236 | n/a | |
---|
237 | n/a | if (buf.len >= HASHLIB_GIL_MINSIZE) { |
---|
238 | n/a | Py_BEGIN_ALLOW_THREADS |
---|
239 | n/a | blake2s_update(&self->state, buf.buf, buf.len); |
---|
240 | n/a | Py_END_ALLOW_THREADS |
---|
241 | n/a | } else { |
---|
242 | n/a | blake2s_update(&self->state, buf.buf, buf.len); |
---|
243 | n/a | } |
---|
244 | n/a | PyBuffer_Release(&buf); |
---|
245 | n/a | } |
---|
246 | n/a | |
---|
247 | n/a | return (PyObject *)self; |
---|
248 | n/a | |
---|
249 | n/a | error: |
---|
250 | n/a | if (self != NULL) { |
---|
251 | n/a | Py_DECREF(self); |
---|
252 | n/a | } |
---|
253 | n/a | return NULL; |
---|
254 | n/a | } |
---|
255 | n/a | |
---|
256 | n/a | /*[clinic input] |
---|
257 | n/a | _blake2s.blake2s.copy |
---|
258 | n/a | |
---|
259 | n/a | Return a copy of the hash object. |
---|
260 | n/a | [clinic start generated code]*/ |
---|
261 | n/a | |
---|
262 | n/a | static PyObject * |
---|
263 | n/a | _blake2s_blake2s_copy_impl(BLAKE2sObject *self) |
---|
264 | n/a | /*[clinic end generated code: output=6c5bada404b7aed7 input=c8858e887ae4a07a]*/ |
---|
265 | n/a | { |
---|
266 | n/a | BLAKE2sObject *cpy; |
---|
267 | n/a | |
---|
268 | n/a | if ((cpy = new_BLAKE2sObject(Py_TYPE(self))) == NULL) |
---|
269 | n/a | return NULL; |
---|
270 | n/a | |
---|
271 | n/a | ENTER_HASHLIB(self); |
---|
272 | n/a | cpy->param = self->param; |
---|
273 | n/a | cpy->state = self->state; |
---|
274 | n/a | LEAVE_HASHLIB(self); |
---|
275 | n/a | return (PyObject *)cpy; |
---|
276 | n/a | } |
---|
277 | n/a | |
---|
278 | n/a | /*[clinic input] |
---|
279 | n/a | _blake2s.blake2s.update |
---|
280 | n/a | |
---|
281 | n/a | obj: object |
---|
282 | n/a | / |
---|
283 | n/a | |
---|
284 | n/a | Update this hash object's state with the provided string. |
---|
285 | n/a | [clinic start generated code]*/ |
---|
286 | n/a | |
---|
287 | n/a | static PyObject * |
---|
288 | n/a | _blake2s_blake2s_update(BLAKE2sObject *self, PyObject *obj) |
---|
289 | n/a | /*[clinic end generated code: output=fe8438a1d3cede87 input=47a408b9a3cc05c5]*/ |
---|
290 | n/a | { |
---|
291 | n/a | Py_buffer buf; |
---|
292 | n/a | |
---|
293 | n/a | GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); |
---|
294 | n/a | |
---|
295 | n/a | #ifdef WITH_THREAD |
---|
296 | n/a | if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) |
---|
297 | n/a | self->lock = PyThread_allocate_lock(); |
---|
298 | n/a | |
---|
299 | n/a | if (self->lock != NULL) { |
---|
300 | n/a | Py_BEGIN_ALLOW_THREADS |
---|
301 | n/a | PyThread_acquire_lock(self->lock, 1); |
---|
302 | n/a | blake2s_update(&self->state, buf.buf, buf.len); |
---|
303 | n/a | PyThread_release_lock(self->lock); |
---|
304 | n/a | Py_END_ALLOW_THREADS |
---|
305 | n/a | } else { |
---|
306 | n/a | blake2s_update(&self->state, buf.buf, buf.len); |
---|
307 | n/a | } |
---|
308 | n/a | #else |
---|
309 | n/a | blake2s_update(&self->state, buf.buf, buf.len); |
---|
310 | n/a | #endif /* !WITH_THREAD */ |
---|
311 | n/a | PyBuffer_Release(&buf); |
---|
312 | n/a | |
---|
313 | n/a | Py_RETURN_NONE; |
---|
314 | n/a | } |
---|
315 | n/a | |
---|
316 | n/a | /*[clinic input] |
---|
317 | n/a | _blake2s.blake2s.digest |
---|
318 | n/a | |
---|
319 | n/a | Return the digest value as a string of binary data. |
---|
320 | n/a | [clinic start generated code]*/ |
---|
321 | n/a | |
---|
322 | n/a | static PyObject * |
---|
323 | n/a | _blake2s_blake2s_digest_impl(BLAKE2sObject *self) |
---|
324 | n/a | /*[clinic end generated code: output=80e81a48c6f79cf9 input=feb9a220135bdeba]*/ |
---|
325 | n/a | { |
---|
326 | n/a | uint8_t digest[BLAKE2S_OUTBYTES]; |
---|
327 | n/a | blake2s_state state_cpy; |
---|
328 | n/a | |
---|
329 | n/a | ENTER_HASHLIB(self); |
---|
330 | n/a | state_cpy = self->state; |
---|
331 | n/a | blake2s_final(&state_cpy, digest, self->param.digest_length); |
---|
332 | n/a | LEAVE_HASHLIB(self); |
---|
333 | n/a | return PyBytes_FromStringAndSize((const char *)digest, |
---|
334 | n/a | self->param.digest_length); |
---|
335 | n/a | } |
---|
336 | n/a | |
---|
337 | n/a | /*[clinic input] |
---|
338 | n/a | _blake2s.blake2s.hexdigest |
---|
339 | n/a | |
---|
340 | n/a | Return the digest value as a string of hexadecimal digits. |
---|
341 | n/a | [clinic start generated code]*/ |
---|
342 | n/a | |
---|
343 | n/a | static PyObject * |
---|
344 | n/a | _blake2s_blake2s_hexdigest_impl(BLAKE2sObject *self) |
---|
345 | n/a | /*[clinic end generated code: output=db6c5028c0a3c2e5 input=4e4877b8bd7aea91]*/ |
---|
346 | n/a | { |
---|
347 | n/a | uint8_t digest[BLAKE2S_OUTBYTES]; |
---|
348 | n/a | blake2s_state state_cpy; |
---|
349 | n/a | |
---|
350 | n/a | ENTER_HASHLIB(self); |
---|
351 | n/a | state_cpy = self->state; |
---|
352 | n/a | blake2s_final(&state_cpy, digest, self->param.digest_length); |
---|
353 | n/a | LEAVE_HASHLIB(self); |
---|
354 | n/a | return _Py_strhex((const char *)digest, self->param.digest_length); |
---|
355 | n/a | } |
---|
356 | n/a | |
---|
357 | n/a | |
---|
358 | n/a | static PyMethodDef py_blake2s_methods[] = { |
---|
359 | n/a | _BLAKE2S_BLAKE2S_COPY_METHODDEF |
---|
360 | n/a | _BLAKE2S_BLAKE2S_DIGEST_METHODDEF |
---|
361 | n/a | _BLAKE2S_BLAKE2S_HEXDIGEST_METHODDEF |
---|
362 | n/a | _BLAKE2S_BLAKE2S_UPDATE_METHODDEF |
---|
363 | n/a | {NULL, NULL} |
---|
364 | n/a | }; |
---|
365 | n/a | |
---|
366 | n/a | |
---|
367 | n/a | |
---|
368 | n/a | static PyObject * |
---|
369 | n/a | py_blake2s_get_name(BLAKE2sObject *self, void *closure) |
---|
370 | n/a | { |
---|
371 | n/a | return PyUnicode_FromString("blake2s"); |
---|
372 | n/a | } |
---|
373 | n/a | |
---|
374 | n/a | |
---|
375 | n/a | |
---|
376 | n/a | static PyObject * |
---|
377 | n/a | py_blake2s_get_block_size(BLAKE2sObject *self, void *closure) |
---|
378 | n/a | { |
---|
379 | n/a | return PyLong_FromLong(BLAKE2S_BLOCKBYTES); |
---|
380 | n/a | } |
---|
381 | n/a | |
---|
382 | n/a | |
---|
383 | n/a | |
---|
384 | n/a | static PyObject * |
---|
385 | n/a | py_blake2s_get_digest_size(BLAKE2sObject *self, void *closure) |
---|
386 | n/a | { |
---|
387 | n/a | return PyLong_FromLong(self->param.digest_length); |
---|
388 | n/a | } |
---|
389 | n/a | |
---|
390 | n/a | |
---|
391 | n/a | static PyGetSetDef py_blake2s_getsetters[] = { |
---|
392 | n/a | {"name", (getter)py_blake2s_get_name, |
---|
393 | n/a | NULL, NULL, NULL}, |
---|
394 | n/a | {"block_size", (getter)py_blake2s_get_block_size, |
---|
395 | n/a | NULL, NULL, NULL}, |
---|
396 | n/a | {"digest_size", (getter)py_blake2s_get_digest_size, |
---|
397 | n/a | NULL, NULL, NULL}, |
---|
398 | n/a | {NULL} |
---|
399 | n/a | }; |
---|
400 | n/a | |
---|
401 | n/a | |
---|
402 | n/a | static void |
---|
403 | n/a | py_blake2s_dealloc(PyObject *self) |
---|
404 | n/a | { |
---|
405 | n/a | BLAKE2sObject *obj = (BLAKE2sObject *)self; |
---|
406 | n/a | |
---|
407 | n/a | /* Try not to leave state in memory. */ |
---|
408 | n/a | secure_zero_memory(&obj->param, sizeof(obj->param)); |
---|
409 | n/a | secure_zero_memory(&obj->state, sizeof(obj->state)); |
---|
410 | n/a | #ifdef WITH_THREAD |
---|
411 | n/a | if (obj->lock) { |
---|
412 | n/a | PyThread_free_lock(obj->lock); |
---|
413 | n/a | obj->lock = NULL; |
---|
414 | n/a | } |
---|
415 | n/a | #endif |
---|
416 | n/a | PyObject_Del(self); |
---|
417 | n/a | } |
---|
418 | n/a | |
---|
419 | n/a | |
---|
420 | n/a | PyTypeObject PyBlake2_BLAKE2sType = { |
---|
421 | n/a | PyVarObject_HEAD_INIT(NULL, 0) |
---|
422 | n/a | "_blake2.blake2s", /* tp_name */ |
---|
423 | n/a | sizeof(BLAKE2sObject), /* tp_size */ |
---|
424 | n/a | 0, /* tp_itemsize */ |
---|
425 | n/a | py_blake2s_dealloc, /* tp_dealloc */ |
---|
426 | n/a | 0, /* tp_print */ |
---|
427 | n/a | 0, /* tp_getattr */ |
---|
428 | n/a | 0, /* tp_setattr */ |
---|
429 | n/a | 0, /* tp_compare */ |
---|
430 | n/a | 0, /* tp_repr */ |
---|
431 | n/a | 0, /* tp_as_number */ |
---|
432 | n/a | 0, /* tp_as_sequence */ |
---|
433 | n/a | 0, /* tp_as_mapping */ |
---|
434 | n/a | 0, /* tp_hash */ |
---|
435 | n/a | 0, /* tp_call */ |
---|
436 | n/a | 0, /* tp_str */ |
---|
437 | n/a | 0, /* tp_getattro */ |
---|
438 | n/a | 0, /* tp_setattro */ |
---|
439 | n/a | 0, /* tp_as_buffer */ |
---|
440 | n/a | Py_TPFLAGS_DEFAULT, /* tp_flags */ |
---|
441 | n/a | py_blake2s_new__doc__, /* tp_doc */ |
---|
442 | n/a | 0, /* tp_traverse */ |
---|
443 | n/a | 0, /* tp_clear */ |
---|
444 | n/a | 0, /* tp_richcompare */ |
---|
445 | n/a | 0, /* tp_weaklistoffset */ |
---|
446 | n/a | 0, /* tp_iter */ |
---|
447 | n/a | 0, /* tp_iternext */ |
---|
448 | n/a | py_blake2s_methods, /* tp_methods */ |
---|
449 | n/a | 0, /* tp_members */ |
---|
450 | n/a | py_blake2s_getsetters, /* tp_getset */ |
---|
451 | n/a | 0, /* tp_base */ |
---|
452 | n/a | 0, /* tp_dict */ |
---|
453 | n/a | 0, /* tp_descr_get */ |
---|
454 | n/a | 0, /* tp_descr_set */ |
---|
455 | n/a | 0, /* tp_dictoffset */ |
---|
456 | n/a | 0, /* tp_init */ |
---|
457 | n/a | 0, /* tp_alloc */ |
---|
458 | n/a | py_blake2s_new, /* tp_new */ |
---|
459 | n/a | }; |
---|