Debian Codegraph @

Modules/clinic/hmacmodule.c.h

raw
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 # include "pycore_gc.h" // PyGC_Head
7 # include "pycore_runtime.h" // _Py_ID()
8 #endif
9 #include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
10
11 PyDoc_STRVAR(_hmac_new__doc__,
12 "new($module, /, key, msg=None, digestmod=None)\n"
13 "--\n"
14 "\n"
15 "Return a new HMAC object.");
16
17 #define _HMAC_NEW_METHODDEF \
18 {"new", _PyCFunction_CAST(_hmac_new), METH_FASTCALL|METH_KEYWORDS, _hmac_new__doc__},
19
20 static PyObject *
21 _hmac_new_impl(PyObject *module, PyObject *keyobj, PyObject *msgobj,
22 PyObject *hash_info_ref);
23
24 static PyObject *
25 _hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
26 {
27 PyObject *return_value = NULL;
28 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
29
30 #define NUM_KEYWORDS 3
31 static struct {
32 PyGC_Head _this_is_not_used;
33 PyObject_VAR_HEAD
34 Py_hash_t ob_hash;
35 PyObject *ob_item[NUM_KEYWORDS];
36 } _kwtuple = {
37 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
38 .ob_hash = -1,
39 .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digestmod), },
40 };
41 #undef NUM_KEYWORDS
42 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
43
44 #else // !Py_BUILD_CORE
45 # define KWTUPLE NULL
46 #endif // !Py_BUILD_CORE
47
48 static const char * const _keywords[] = {"key", "msg", "digestmod", NULL};
49 static _PyArg_Parser _parser = {
50 .keywords = _keywords,
51 .fname = "new",
52 .kwtuple = KWTUPLE,
53 };
54 #undef KWTUPLE
55 PyObject *argsbuf[3];
56 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
57 PyObject *keyobj;
58 PyObject *msgobj = NULL;
59 PyObject *hash_info_ref = NULL;
60
61 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
62 /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
63 if (!args) {
64 goto exit;
65 }
66 keyobj = args[0];
67 if (!noptargs) {
68 goto skip_optional_pos;
69 }
70 if (args[1]) {
71 msgobj = args[1];
72 if (!--noptargs) {
73 goto skip_optional_pos;
74 }
75 }
76 hash_info_ref = args[2];
77 skip_optional_pos:
78 return_value = _hmac_new_impl(module, keyobj, msgobj, hash_info_ref);
79
80 exit:
81 return return_value;
82 }
83
84 PyDoc_STRVAR(_hmac_HMAC_copy__doc__,
85 "copy($self, /)\n"
86 "--\n"
87 "\n"
88 "Return a copy (\"clone\") of the HMAC object.");
89
90 #define _HMAC_HMAC_COPY_METHODDEF \
91 {"copy", _PyCFunction_CAST(_hmac_HMAC_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _hmac_HMAC_copy__doc__},
92
93 static PyObject *
94 _hmac_HMAC_copy_impl(HMACObject *self, PyTypeObject *cls);
95
96 static PyObject *
97 _hmac_HMAC_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
98 {
99 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
100 PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
101 return NULL;
102 }
103 return _hmac_HMAC_copy_impl((HMACObject *)self, cls);
104 }
105
106 PyDoc_STRVAR(_hmac_HMAC_update__doc__,
107 "update($self, /, msg)\n"
108 "--\n"
109 "\n"
110 "Update the HMAC object with the given message.");
111
112 #define _HMAC_HMAC_UPDATE_METHODDEF \
113 {"update", _PyCFunction_CAST(_hmac_HMAC_update), METH_FASTCALL|METH_KEYWORDS, _hmac_HMAC_update__doc__},
114
115 static PyObject *
116 _hmac_HMAC_update_impl(HMACObject *self, PyObject *msgobj);
117
118 static PyObject *
119 _hmac_HMAC_update(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
120 {
121 PyObject *return_value = NULL;
122 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
123
124 #define NUM_KEYWORDS 1
125 static struct {
126 PyGC_Head _this_is_not_used;
127 PyObject_VAR_HEAD
128 Py_hash_t ob_hash;
129 PyObject *ob_item[NUM_KEYWORDS];
130 } _kwtuple = {
131 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
132 .ob_hash = -1,
133 .ob_item = { &_Py_ID(msg), },
134 };
135 #undef NUM_KEYWORDS
136 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
137
138 #else // !Py_BUILD_CORE
139 # define KWTUPLE NULL
140 #endif // !Py_BUILD_CORE
141
142 static const char * const _keywords[] = {"msg", NULL};
143 static _PyArg_Parser _parser = {
144 .keywords = _keywords,
145 .fname = "update",
146 .kwtuple = KWTUPLE,
147 };
148 #undef KWTUPLE
149 PyObject *argsbuf[1];
150 PyObject *msgobj;
151
152 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
153 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
154 if (!args) {
155 goto exit;
156 }
157 msgobj = args[0];
158 return_value = _hmac_HMAC_update_impl((HMACObject *)self, msgobj);
159
160 exit:
161 return return_value;
162 }
163
164 PyDoc_STRVAR(_hmac_HMAC_digest__doc__,
165 "digest($self, /)\n"
166 "--\n"
167 "\n"
168 "Return the digest of the bytes passed to the update() method so far.\n"
169 "\n"
170 "This method may raise a MemoryError.");
171
172 #define _HMAC_HMAC_DIGEST_METHODDEF \
173 {"digest", (PyCFunction)_hmac_HMAC_digest, METH_NOARGS, _hmac_HMAC_digest__doc__},
174
175 static PyObject *
176 _hmac_HMAC_digest_impl(HMACObject *self);
177
178 static PyObject *
179 _hmac_HMAC_digest(PyObject *self, PyObject *Py_UNUSED(ignored))
180 {
181 return _hmac_HMAC_digest_impl((HMACObject *)self);
182 }
183
184 PyDoc_STRVAR(_hmac_HMAC_hexdigest__doc__,
185 "hexdigest($self, /)\n"
186 "--\n"
187 "\n"
188 "Return hexadecimal digest of the bytes passed to the update() method so far.\n"
189 "\n"
190 "This may be used to exchange the value safely in email or other\n"
191 "non-binary environments.\n"
192 "\n"
193 "This method may raise a MemoryError.");
194
195 #define _HMAC_HMAC_HEXDIGEST_METHODDEF \
196 {"hexdigest", (PyCFunction)_hmac_HMAC_hexdigest, METH_NOARGS, _hmac_HMAC_hexdigest__doc__},
197
198 static PyObject *
199 _hmac_HMAC_hexdigest_impl(HMACObject *self);
200
201 static PyObject *
202 _hmac_HMAC_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored))
203 {
204 return _hmac_HMAC_hexdigest_impl((HMACObject *)self);
205 }
206
207 #if !defined(_hmac_HMAC_name_DOCSTR)
208 # define _hmac_HMAC_name_DOCSTR NULL
209 #endif
210 #if defined(_HMAC_HMAC_NAME_GETSETDEF)
211 # undef _HMAC_HMAC_NAME_GETSETDEF
212 # define _HMAC_HMAC_NAME_GETSETDEF {"name", (getter)_hmac_HMAC_name_get, (setter)_hmac_HMAC_name_set, _hmac_HMAC_name_DOCSTR},
213 #else
214 # define _HMAC_HMAC_NAME_GETSETDEF {"name", (getter)_hmac_HMAC_name_get, NULL, _hmac_HMAC_name_DOCSTR},
215 #endif
216
217 static PyObject *
218 _hmac_HMAC_name_get_impl(HMACObject *self);
219
220 static PyObject *
221 _hmac_HMAC_name_get(PyObject *self, void *Py_UNUSED(context))
222 {
223 return _hmac_HMAC_name_get_impl((HMACObject *)self);
224 }
225
226 #if !defined(_hmac_HMAC_block_size_DOCSTR)
227 # define _hmac_HMAC_block_size_DOCSTR NULL
228 #endif
229 #if defined(_HMAC_HMAC_BLOCK_SIZE_GETSETDEF)
230 # undef _HMAC_HMAC_BLOCK_SIZE_GETSETDEF
231 # define _HMAC_HMAC_BLOCK_SIZE_GETSETDEF {"block_size", (getter)_hmac_HMAC_block_size_get, (setter)_hmac_HMAC_block_size_set, _hmac_HMAC_block_size_DOCSTR},
232 #else
233 # define _HMAC_HMAC_BLOCK_SIZE_GETSETDEF {"block_size", (getter)_hmac_HMAC_block_size_get, NULL, _hmac_HMAC_block_size_DOCSTR},
234 #endif
235
236 static PyObject *
237 _hmac_HMAC_block_size_get_impl(HMACObject *self);
238
239 static PyObject *
240 _hmac_HMAC_block_size_get(PyObject *self, void *Py_UNUSED(context))
241 {
242 return _hmac_HMAC_block_size_get_impl((HMACObject *)self);
243 }
244
245 #if !defined(_hmac_HMAC_digest_size_DOCSTR)
246 # define _hmac_HMAC_digest_size_DOCSTR NULL
247 #endif
248 #if defined(_HMAC_HMAC_DIGEST_SIZE_GETSETDEF)
249 # undef _HMAC_HMAC_DIGEST_SIZE_GETSETDEF
250 # define _HMAC_HMAC_DIGEST_SIZE_GETSETDEF {"digest_size", (getter)_hmac_HMAC_digest_size_get, (setter)_hmac_HMAC_digest_size_set, _hmac_HMAC_digest_size_DOCSTR},
251 #else
252 # define _HMAC_HMAC_DIGEST_SIZE_GETSETDEF {"digest_size", (getter)_hmac_HMAC_digest_size_get, NULL, _hmac_HMAC_digest_size_DOCSTR},
253 #endif
254
255 static PyObject *
256 _hmac_HMAC_digest_size_get_impl(HMACObject *self);
257
258 static PyObject *
259 _hmac_HMAC_digest_size_get(PyObject *self, void *Py_UNUSED(context))
260 {
261 return _hmac_HMAC_digest_size_get_impl((HMACObject *)self);
262 }
263
264 PyDoc_STRVAR(_hmac_compute_digest__doc__,
265 "compute_digest($module, /, key, msg, digest)\n"
266 "--\n"
267 "\n");
268
269 #define _HMAC_COMPUTE_DIGEST_METHODDEF \
270 {"compute_digest", _PyCFunction_CAST(_hmac_compute_digest), METH_FASTCALL|METH_KEYWORDS, _hmac_compute_digest__doc__},
271
272 static PyObject *
273 _hmac_compute_digest_impl(PyObject *module, PyObject *key, PyObject *msg,
274 PyObject *digest);
275
276 static PyObject *
277 _hmac_compute_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
278 {
279 PyObject *return_value = NULL;
280 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
281
282 #define NUM_KEYWORDS 3
283 static struct {
284 PyGC_Head _this_is_not_used;
285 PyObject_VAR_HEAD
286 Py_hash_t ob_hash;
287 PyObject *ob_item[NUM_KEYWORDS];
288 } _kwtuple = {
289 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
290 .ob_hash = -1,
291 .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digest), },
292 };
293 #undef NUM_KEYWORDS
294 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
295
296 #else // !Py_BUILD_CORE
297 # define KWTUPLE NULL
298 #endif // !Py_BUILD_CORE
299
300 static const char * const _keywords[] = {"key", "msg", "digest", NULL};
301 static _PyArg_Parser _parser = {
302 .keywords = _keywords,
303 .fname = "compute_digest",
304 .kwtuple = KWTUPLE,
305 };
306 #undef KWTUPLE
307 PyObject *argsbuf[3];
308 PyObject *key;
309 PyObject *msg;
310 PyObject *digest;
311
312 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
313 /*minpos*/ 3, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
314 if (!args) {
315 goto exit;
316 }
317 key = args[0];
318 msg = args[1];
319 digest = args[2];
320 return_value = _hmac_compute_digest_impl(module, key, msg, digest);
321
322 exit:
323 return return_value;
324 }
325
326 PyDoc_STRVAR(_hmac_compute_md5__doc__,
327 "compute_md5($module, key, msg, /)\n"
328 "--\n"
329 "\n");
330
331 #define _HMAC_COMPUTE_MD5_METHODDEF \
332 {"compute_md5", _PyCFunction_CAST(_hmac_compute_md5), METH_FASTCALL, _hmac_compute_md5__doc__},
333
334 static PyObject *
335 _hmac_compute_md5_impl(PyObject *module, PyObject *key, PyObject *msg);
336
337 static PyObject *
338 _hmac_compute_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
339 {
340 PyObject *return_value = NULL;
341 PyObject *key;
342 PyObject *msg;
343
344 if (!_PyArg_CheckPositional("compute_md5", nargs, 2, 2)) {
345 goto exit;
346 }
347 key = args[0];
348 msg = args[1];
349 return_value = _hmac_compute_md5_impl(module, key, msg);
350
351 exit:
352 return return_value;
353 }
354
355 PyDoc_STRVAR(_hmac_compute_sha1__doc__,
356 "compute_sha1($module, key, msg, /)\n"
357 "--\n"
358 "\n");
359
360 #define _HMAC_COMPUTE_SHA1_METHODDEF \
361 {"compute_sha1", _PyCFunction_CAST(_hmac_compute_sha1), METH_FASTCALL, _hmac_compute_sha1__doc__},
362
363 static PyObject *
364 _hmac_compute_sha1_impl(PyObject *module, PyObject *key, PyObject *msg);
365
366 static PyObject *
367 _hmac_compute_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
368 {
369 PyObject *return_value = NULL;
370 PyObject *key;
371 PyObject *msg;
372
373 if (!_PyArg_CheckPositional("compute_sha1", nargs, 2, 2)) {
374 goto exit;
375 }
376 key = args[0];
377 msg = args[1];
378 return_value = _hmac_compute_sha1_impl(module, key, msg);
379
380 exit:
381 return return_value;
382 }
383
384 PyDoc_STRVAR(_hmac_compute_sha2_224__doc__,
385 "compute_sha224($module, key, msg, /)\n"
386 "--\n"
387 "\n");
388
389 #define _HMAC_COMPUTE_SHA2_224_METHODDEF \
390 {"compute_sha224", _PyCFunction_CAST(_hmac_compute_sha2_224), METH_FASTCALL, _hmac_compute_sha2_224__doc__},
391
392 static PyObject *
393 _hmac_compute_sha2_224_impl(PyObject *module, PyObject *key, PyObject *msg);
394
395 static PyObject *
396 _hmac_compute_sha2_224(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
397 {
398 PyObject *return_value = NULL;
399 PyObject *key;
400 PyObject *msg;
401
402 if (!_PyArg_CheckPositional("compute_sha224", nargs, 2, 2)) {
403 goto exit;
404 }
405 key = args[0];
406 msg = args[1];
407 return_value = _hmac_compute_sha2_224_impl(module, key, msg);
408
409 exit:
410 return return_value;
411 }
412
413 PyDoc_STRVAR(_hmac_compute_sha2_256__doc__,
414 "compute_sha256($module, key, msg, /)\n"
415 "--\n"
416 "\n");
417
418 #define _HMAC_COMPUTE_SHA2_256_METHODDEF \
419 {"compute_sha256", _PyCFunction_CAST(_hmac_compute_sha2_256), METH_FASTCALL, _hmac_compute_sha2_256__doc__},
420
421 static PyObject *
422 _hmac_compute_sha2_256_impl(PyObject *module, PyObject *key, PyObject *msg);
423
424 static PyObject *
425 _hmac_compute_sha2_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
426 {
427 PyObject *return_value = NULL;
428 PyObject *key;
429 PyObject *msg;
430
431 if (!_PyArg_CheckPositional("compute_sha256", nargs, 2, 2)) {
432 goto exit;
433 }
434 key = args[0];
435 msg = args[1];
436 return_value = _hmac_compute_sha2_256_impl(module, key, msg);
437
438 exit:
439 return return_value;
440 }
441
442 PyDoc_STRVAR(_hmac_compute_sha2_384__doc__,
443 "compute_sha384($module, key, msg, /)\n"
444 "--\n"
445 "\n");
446
447 #define _HMAC_COMPUTE_SHA2_384_METHODDEF \
448 {"compute_sha384", _PyCFunction_CAST(_hmac_compute_sha2_384), METH_FASTCALL, _hmac_compute_sha2_384__doc__},
449
450 static PyObject *
451 _hmac_compute_sha2_384_impl(PyObject *module, PyObject *key, PyObject *msg);
452
453 static PyObject *
454 _hmac_compute_sha2_384(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
455 {
456 PyObject *return_value = NULL;
457 PyObject *key;
458 PyObject *msg;
459
460 if (!_PyArg_CheckPositional("compute_sha384", nargs, 2, 2)) {
461 goto exit;
462 }
463 key = args[0];
464 msg = args[1];
465 return_value = _hmac_compute_sha2_384_impl(module, key, msg);
466
467 exit:
468 return return_value;
469 }
470
471 PyDoc_STRVAR(_hmac_compute_sha2_512__doc__,
472 "compute_sha512($module, key, msg, /)\n"
473 "--\n"
474 "\n");
475
476 #define _HMAC_COMPUTE_SHA2_512_METHODDEF \
477 {"compute_sha512", _PyCFunction_CAST(_hmac_compute_sha2_512), METH_FASTCALL, _hmac_compute_sha2_512__doc__},
478
479 static PyObject *
480 _hmac_compute_sha2_512_impl(PyObject *module, PyObject *key, PyObject *msg);
481
482 static PyObject *
483 _hmac_compute_sha2_512(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
484 {
485 PyObject *return_value = NULL;
486 PyObject *key;
487 PyObject *msg;
488
489 if (!_PyArg_CheckPositional("compute_sha512", nargs, 2, 2)) {
490 goto exit;
491 }
492 key = args[0];
493 msg = args[1];
494 return_value = _hmac_compute_sha2_512_impl(module, key, msg);
495
496 exit:
497 return return_value;
498 }
499
500 PyDoc_STRVAR(_hmac_compute_sha3_224__doc__,
501 "compute_sha3_224($module, key, msg, /)\n"
502 "--\n"
503 "\n");
504
505 #define _HMAC_COMPUTE_SHA3_224_METHODDEF \
506 {"compute_sha3_224", _PyCFunction_CAST(_hmac_compute_sha3_224), METH_FASTCALL, _hmac_compute_sha3_224__doc__},
507
508 static PyObject *
509 _hmac_compute_sha3_224_impl(PyObject *module, PyObject *key, PyObject *msg);
510
511 static PyObject *
512 _hmac_compute_sha3_224(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
513 {
514 PyObject *return_value = NULL;
515 PyObject *key;
516 PyObject *msg;
517
518 if (!_PyArg_CheckPositional("compute_sha3_224", nargs, 2, 2)) {
519 goto exit;
520 }
521 key = args[0];
522 msg = args[1];
523 return_value = _hmac_compute_sha3_224_impl(module, key, msg);
524
525 exit:
526 return return_value;
527 }
528
529 PyDoc_STRVAR(_hmac_compute_sha3_256__doc__,
530 "compute_sha3_256($module, key, msg, /)\n"
531 "--\n"
532 "\n");
533
534 #define _HMAC_COMPUTE_SHA3_256_METHODDEF \
535 {"compute_sha3_256", _PyCFunction_CAST(_hmac_compute_sha3_256), METH_FASTCALL, _hmac_compute_sha3_256__doc__},
536
537 static PyObject *
538 _hmac_compute_sha3_256_impl(PyObject *module, PyObject *key, PyObject *msg);
539
540 static PyObject *
541 _hmac_compute_sha3_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
542 {
543 PyObject *return_value = NULL;
544 PyObject *key;
545 PyObject *msg;
546
547 if (!_PyArg_CheckPositional("compute_sha3_256", nargs, 2, 2)) {
548 goto exit;
549 }
550 key = args[0];
551 msg = args[1];
552 return_value = _hmac_compute_sha3_256_impl(module, key, msg);
553
554 exit:
555 return return_value;
556 }
557
558 PyDoc_STRVAR(_hmac_compute_sha3_384__doc__,
559 "compute_sha3_384($module, key, msg, /)\n"
560 "--\n"
561 "\n");
562
563 #define _HMAC_COMPUTE_SHA3_384_METHODDEF \
564 {"compute_sha3_384", _PyCFunction_CAST(_hmac_compute_sha3_384), METH_FASTCALL, _hmac_compute_sha3_384__doc__},
565
566 static PyObject *
567 _hmac_compute_sha3_384_impl(PyObject *module, PyObject *key, PyObject *msg);
568
569 static PyObject *
570 _hmac_compute_sha3_384(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
571 {
572 PyObject *return_value = NULL;
573 PyObject *key;
574 PyObject *msg;
575
576 if (!_PyArg_CheckPositional("compute_sha3_384", nargs, 2, 2)) {
577 goto exit;
578 }
579 key = args[0];
580 msg = args[1];
581 return_value = _hmac_compute_sha3_384_impl(module, key, msg);
582
583 exit:
584 return return_value;
585 }
586
587 PyDoc_STRVAR(_hmac_compute_sha3_512__doc__,
588 "compute_sha3_512($module, key, msg, /)\n"
589 "--\n"
590 "\n");
591
592 #define _HMAC_COMPUTE_SHA3_512_METHODDEF \
593 {"compute_sha3_512", _PyCFunction_CAST(_hmac_compute_sha3_512), METH_FASTCALL, _hmac_compute_sha3_512__doc__},
594
595 static PyObject *
596 _hmac_compute_sha3_512_impl(PyObject *module, PyObject *key, PyObject *msg);
597
598 static PyObject *
599 _hmac_compute_sha3_512(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
600 {
601 PyObject *return_value = NULL;
602 PyObject *key;
603 PyObject *msg;
604
605 if (!_PyArg_CheckPositional("compute_sha3_512", nargs, 2, 2)) {
606 goto exit;
607 }
608 key = args[0];
609 msg = args[1];
610 return_value = _hmac_compute_sha3_512_impl(module, key, msg);
611
612 exit:
613 return return_value;
614 }
615
616 PyDoc_STRVAR(_hmac_compute_blake2s_32__doc__,
617 "compute_blake2s_32($module, key, msg, /)\n"
618 "--\n"
619 "\n");
620
621 #define _HMAC_COMPUTE_BLAKE2S_32_METHODDEF \
622 {"compute_blake2s_32", _PyCFunction_CAST(_hmac_compute_blake2s_32), METH_FASTCALL, _hmac_compute_blake2s_32__doc__},
623
624 static PyObject *
625 _hmac_compute_blake2s_32_impl(PyObject *module, PyObject *key, PyObject *msg);
626
627 static PyObject *
628 _hmac_compute_blake2s_32(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
629 {
630 PyObject *return_value = NULL;
631 PyObject *key;
632 PyObject *msg;
633
634 if (!_PyArg_CheckPositional("compute_blake2s_32", nargs, 2, 2)) {
635 goto exit;
636 }
637 key = args[0];
638 msg = args[1];
639 return_value = _hmac_compute_blake2s_32_impl(module, key, msg);
640
641 exit:
642 return return_value;
643 }
644
645 PyDoc_STRVAR(_hmac_compute_blake2b_32__doc__,
646 "compute_blake2b_32($module, key, msg, /)\n"
647 "--\n"
648 "\n");
649
650 #define _HMAC_COMPUTE_BLAKE2B_32_METHODDEF \
651 {"compute_blake2b_32", _PyCFunction_CAST(_hmac_compute_blake2b_32), METH_FASTCALL, _hmac_compute_blake2b_32__doc__},
652
653 static PyObject *
654 _hmac_compute_blake2b_32_impl(PyObject *module, PyObject *key, PyObject *msg);
655
656 static PyObject *
657 _hmac_compute_blake2b_32(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
658 {
659 PyObject *return_value = NULL;
660 PyObject *key;
661 PyObject *msg;
662
663 if (!_PyArg_CheckPositional("compute_blake2b_32", nargs, 2, 2)) {
664 goto exit;
665 }
666 key = args[0];
667 msg = args[1];
668 return_value = _hmac_compute_blake2b_32_impl(module, key, msg);
669
670 exit:
671 return return_value;
672 }
673 /*[clinic end generated code: output=6ec5948df1c5569a input=a9049054013a1b77]*/