commit 10bf07a

hovercats  ·  2024-10-26 17:50:22 +0000 UTC
parent 24c37b2
python: import from oasis
15 files changed,  +4346, -0
+3, -0
1@@ -0,0 +1,3 @@
2+/Python-3.10.0.tar.xz
3+/modules.ninja
4+/src
+13, -0
 1@@ -0,0 +1,13 @@
 2+# python
 3+
 4+## config.h
 5+Generated with
 6+
 7+	./configure \
 8+		--without-pymalloc \
 9+		--with-builtin-hashlib-hashes='sha3,blake2' \
10+		--with-ssl-default-suites='TLSv1.3:TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE' \
11+		ax_cv_c_float_words_bigendian=no
12+
13+Use libtls's conversative default set of cipher suites since the
14+python default uses `@SECLEVEL=2`, which is not supported by libressl.
+234, -0
  1@@ -0,0 +1,234 @@
  2+cflags{
  3+	'-D NDEBUG',
  4+	'-I $dir',
  5+	'-I $srcdir/Include',
  6+	'-I $srcdir/Include/internal',
  7+	'-isystem $builddir/pkg/linux-headers/include',
  8+}
  9+
 10+pkg.deps = {'pkg/linux-headers/headers'}
 11+local libs = {}
 12+local modules = load 'modules.lua'
 13+
 14+if modules._ctypes then
 15+	cflags{'-isystem $builddir/pkg/libffi/include'}
 16+	table.insert(pkg.deps, 'pkg/libffi/headers')
 17+	table.insert(libs, 'libffi/libffi.a')
 18+end
 19+if modules._hashlib then
 20+	cflags{'-isystem $builddir/pkg/bearssl/include'}
 21+	table.insert(pkg.deps, 'pkg/bearssl/headers')
 22+	table.insert(libs, 'bearssl/libbearssl.a')
 23+end
 24+if modules._ssl then
 25+	cflags{'-isystem $builddir/pkg/libressl/include'}
 26+	table.insert(pkg.deps, 'pkg/libressl/headers')
 27+	table.insert(libs, {
 28+		'libressl/libssl.a',
 29+		'libressl/libcrypto.a',
 30+	})
 31+end
 32+if modules.pyexpat then
 33+	cflags{'-isystem $builddir/pkg/expat/include'}
 34+	table.insert(pkg.deps, 'pkg/expat/headers')
 35+	table.insert(libs, 'expat/libexpat.a.d')
 36+end
 37+if modules.zlib then
 38+	cflags{'-isystem $builddir/pkg/zlib/include'}
 39+	table.insert(pkg.deps, 'pkg/zlib/headers')
 40+	table.insert(libs, 'zlib/libz.a')
 41+end
 42+
 43+local srcs = {}
 44+sub('modules.ninja', function()
 45+	cflags{'-D Py_BUILD_CORE_BUILTIN'}
 46+
 47+	for _, mod in pairs(modules) do
 48+		for _, src in ipairs(mod) do
 49+			local obj = src..'.o'
 50+			if not srcs[obj] then
 51+				cc('Modules/'..src)
 52+				srcs[obj] = true
 53+			end
 54+		end
 55+	end
 56+end)
 57+srcs = table.keys(srcs)
 58+
 59+cflags{'-D Py_BUILD_CORE'}
 60+
 61+rule('makesetup', 'lua $dir/makesetup.lua $dir/modules.lua <$in >$out')
 62+build('makesetup', '$outdir/config.c', {'$srcdir/Modules/config.c.in', '|', '$dir/makesetup.lua', '$dir/modules.lua'})
 63+
 64+cc('Modules/getbuildinfo.c', nil, {
 65+	cflags=[[$cflags -D 'DATE="Oct 4 2021"' -D 'TIME="18:40:47"']]
 66+})
 67+cc('Modules/getpath.c', nil, {
 68+	cflags={
 69+		'$cflags',
 70+		[[-D 'PYTHONPATH=":plat-linux"']],
 71+		[[-D 'PREFIX="/"']],
 72+		[[-D 'EXEC_PREFIX="/"']],
 73+		[[-D 'VERSION="3.10"']],
 74+		[[-D 'VPATH=""']],
 75+	},
 76+})
 77+
 78+local platform = 'linux'
 79+local abiflags = ''
 80+for line in iterlines('pyconfig.h', 1) do
 81+	if line == '#define WITH_PYMALLOC 1' then
 82+		abiflags = abiflags..'m'
 83+	elseif line == '#define Py_DEBUG 1' then
 84+		abiflags = abiflags..'d'
 85+	end
 86+end
 87+
 88+cc('Python/getplatform.c', nil, {
 89+	cflags=string.format([[$cflags -D 'PLATFORM="%s"']], platform),
 90+})
 91+cc('Python/initconfig.c', nil, {
 92+	cflags=[[$cflags -D 'PLATLIBDIR="lib"']],
 93+})
 94+cc('Python/sysmodule.c', nil, {
 95+	cflags=string.format([[$cflags -D 'ABIFLAGS="%s"']], abiflags),
 96+})
 97+
 98+lib('libpython.a', {expand{'Modules/', srcs}, paths[[
 99+	Modules/(
100+		getbuildinfo.c.o
101+		getpath.c.o
102+		main.c
103+		gcmodule.c
104+	)
105+	Objects/(
106+		abstract.c
107+		accu.c
108+		boolobject.c
109+		bytes_methods.c
110+		bytearrayobject.c
111+		bytesobject.c
112+		call.c
113+		capsule.c
114+		cellobject.c
115+		classobject.c
116+		codeobject.c
117+		complexobject.c
118+		descrobject.c
119+		enumobject.c
120+		exceptions.c
121+		genericaliasobject.c
122+		genobject.c
123+		fileobject.c
124+		floatobject.c
125+		frameobject.c
126+		funcobject.c
127+		interpreteridobject.c
128+		iterobject.c
129+		listobject.c
130+		longobject.c
131+		dictobject.c
132+		odictobject.c
133+		memoryobject.c
134+		methodobject.c
135+		moduleobject.c
136+		namespaceobject.c
137+		object.c
138+		obmalloc.c
139+		picklebufobject.c
140+		rangeobject.c
141+		setobject.c
142+		sliceobject.c
143+		structseq.c
144+		tupleobject.c
145+		typeobject.c
146+		unicodeobject.c
147+		unicodectype.c
148+		unionobject.c
149+		weakrefobject.c
150+	)
151+	Parser/(
152+		token.c
153+		pegen.c
154+		parser.c
155+		string_parser.c
156+		peg_api.c
157+		myreadline.c
158+		tokenizer.c
159+	)
160+	Python/(
161+		_warnings.c
162+		Python-ast.c
163+		asdl.c
164+		ast.c
165+		ast_opt.c
166+		ast_unparse.c
167+		bltinmodule.c
168+		ceval.c
169+		codecs.c
170+		compile.c
171+		context.c
172+		errors.c
173+		frozenmain.c
174+		future.c
175+		getargs.c
176+		getcompiler.c
177+		getcopyright.c
178+		getplatform.c.o
179+		getversion.c
180+		hamt.c
181+		hashtable.c
182+		import.c
183+		importdl.c
184+		initconfig.c.o
185+		marshal.c
186+		modsupport.c
187+		mysnprintf.c
188+		mystrtoul.c
189+		pathconfig.c
190+		preconfig.c
191+		pyarena.c
192+		pyctype.c
193+		pyfpe.c
194+		pyhash.c
195+		pylifecycle.c
196+		pymath.c
197+		pystate.c
198+		pythonrun.c
199+		pytime.c
200+		bootstrap_hash.c
201+		structmember.c
202+		symtable.c
203+		sysmodule.c.o
204+		thread.c
205+		traceback.c
206+		getopt.c
207+		pystrcmp.c
208+		pystrtod.c
209+		pystrhex.c
210+		dtoa.c
211+		formatter_unicode.c
212+		fileutils.c
213+		suggestions.c
214+		dynload_stub.c
215+		frozen.c
216+	)
217+	$outdir/config.c
218+]]})
219+
220+exe('python', {'Programs/python.c', 'libpython.a', expand{'$builddir/pkg/', libs}})
221+file('bin/python3', '755', '$outdir/python')
222+sym('bin/python', 'python3')
223+
224+build('copy', '$outdir/python3.1', '$srcdir/Misc/python.man')
225+man{'$outdir/python3.1'}
226+sym('share/man/man1/python.1.gz', 'python3.1.gz')
227+
228+for f in iterlines('pylibs.txt') do
229+	file('lib/python3.10/'..f, '644', '$srcdir/Lib/'..f)
230+end
231+file('lib/python3.10/_sysconfigdata_'..abiflags..'_'..platform..'_.py', '644', '$dir/lib/_sysconfigdata.py')
232+file('lib/python3.10/Makefile', '644', '$dir/lib/Makefile')
233+dir('lib/python3.10/lib-dynload', '755')
234+
235+fetch 'curl'
+1, -0
1@@ -0,0 +1 @@
2+# intentionally empty
+2, -0
1@@ -0,0 +1,2 @@
2+build_time_vars = {
3+}
+19, -0
 1@@ -0,0 +1,19 @@
 2+local modules = {}
 3+for m in pairs(dofile(arg[1])) do
 4+	table.insert(modules, m)
 5+end
 6+table.sort(modules)
 7+
 8+for line in io.lines() do
 9+	if line == '/* -- ADDMODULE MARKER 1 -- */' then
10+		for _, m in ipairs(modules) do
11+			print('extern PyObject *PyInit_'..m..'(void);')
12+		end
13+	elseif line == '/* -- ADDMODULE MARKER 2 -- */' then
14+		for _, m in ipairs(modules) do
15+			print('    {"'..m..'", PyInit_'..m..'},')
16+		end
17+	else
18+		print(line)
19+	end
20+end
+115, -0
  1@@ -0,0 +1,115 @@
  2+return {
  3+	-- Modules/Setup
  4+	posix={'posixmodule.c'},
  5+	errno={'errnomodule.c'},
  6+	pwd={'pwdmodule.c'},
  7+	_sre={'_sre.c'},
  8+	_codecs={'_codecsmodule.c'},
  9+	_weakref={'_weakref.c'},
 10+	_functools={'_functoolsmodule.c'},
 11+	_operator={'_operator.c'},
 12+	_collections={'_collectionsmodule.c'},
 13+	_abc={'_abc.c'},
 14+	itertools={'itertoolsmodule.c'},
 15+	atexit={'atexitmodule.c'},
 16+	_signal={'signalmodule.c'},
 17+	_stat={'_stat.c'},
 18+	time={'timemodule.c'},
 19+	_thread={'_threadmodule.c'},
 20+	_locale={'_localemodule.c'},
 21+	_io={
 22+		'_io/_iomodule.c',
 23+		'_io/iobase.c',
 24+		'_io/fileio.c',
 25+		'_io/bytesio.c',
 26+		'_io/bufferedio.c',
 27+		'_io/textio.c',
 28+		'_io/stringio.c',
 29+	},
 30+	faulthandler={'faulthandler.c'},
 31+	_tracemalloc={'_tracemalloc.c'},
 32+	--_symtable={'symtablemodule.c'},
 33+	--xxsubtype={'xxsubtype.c'},
 34+
 35+	-- setup.py:/Extension
 36+	array={'arraymodule.c'},
 37+	_contextvars={'_contextvarsmodule.c'},
 38+	math={'mathmodule.c', '_math.c'},
 39+	cmath={'cmathmodule.c', '_math.c'},
 40+	-- time defined above
 41+	_datetime={'_datetimemodule.c'},
 42+	_zoneinfo={'_zoneinfo.c'},
 43+	_random={'_randommodule.c'},
 44+	_bisect={'_bisectmodule.c'},
 45+	_heapq={'_heapqmodule.c'},
 46+	_pickle={'_pickle.c'},
 47+	_json={'_json.c'},
 48+	--_lsprof={'_lsprof.c', 'rotatingtree.c'},
 49+	unicodedata={'unicodedata.c'},
 50+	_opcode={'_opcode.c'},
 51+	_asyncio={'_asynciomodule.c'},
 52+	_abc={'_abc.c'},
 53+	_queue={'_queuemodule.c'},
 54+	_statistics={'_statisticsmodule.c'},
 55+	fcntl={'fcntlmodule.c'},
 56+	-- pwd defined above
 57+	grp={'grpmodule.c'},
 58+	spwd={'spwdmodule.c'},
 59+	select={'selectmodule.c'},
 60+	mmap={'mmapmodule.c'},
 61+	--syslog={'syslogmodule.c'},
 62+	--_xxsubinterpreters={'_xxsubinterpretersmodule.c'},
 63+	--audioop={'audioop.c'},
 64+	_csv={'_csv.c'},
 65+	_posixsubprocess={'_posixsubprocess.c'},
 66+	--_testcapi={'_testcapimodule.c'},
 67+	--_testinternalcapi={'_testinternalcapi.c'},
 68+	--_testbuffer={'_testbuffer.c'},
 69+	--_testimportmultiple={'_testimportmultiple.c'},
 70+	--_testmultiphase={'_testmultiphase.c'},
 71+	--_xxtestfuzz={'_xxtestfuzz/_xxtestfuzz.c', '_xxtestfuzz/fuzzer.c'},
 72+	--readline={'readline.c'},
 73+	--_curses={'_cursesmodule.c'},
 74+	--_curses_panel={'_curses_panel.c'},
 75+	_crypt={'_cryptmodule.c'},
 76+	_socket={'socketmodule.c'},
 77+	--_dbm={'_dbmmodule.c'},
 78+	--_gdbm={'_gdbmmodule.c'},
 79+	--_sqlite3={'_sqlite/cache.c', '_sqlite/connection.c', '_sqlite/cursor.c', '_sqlite/microprotocols.c', '_sqlite/module.c', '_sqlite/prepare_protocol.c', '_sqlite/row.c', '_sqlite/statement.c', '_sqlite/util.c'},
 80+	termios={'termios.c'},
 81+	resource={'resource.c'},
 82+	--ossaudiodev={'ossaudiodev.c'},
 83+	--_scproxy={'_scproxy.c'},
 84+	zlib={'zlibmodule.c'},
 85+	binascii={'binascii.c'},
 86+	--_bz2={'_bz2module.c'},
 87+	--_lzma={'_lzmamodule.c'},
 88+	pyexpat={'pyexpat.c'},
 89+	--_elementtree={'_elementtree.c'},
 90+	--_multibytecodec={'cjkcodecs/multibytecodec.c'},
 91+	--_codecs_kr={'cjkcodecs/_codecs_kr.c'},
 92+	--_codecs_jp={'cjkcodecs/_codecs_jp.c'},
 93+	--_codecs_cn={'cjkcodecs/_codecs_cn.c'},
 94+	--_codecs_tw={'cjkcodecs/_codecs_tw.c'},
 95+	--_codecs_hk={'cjkcodecs/_codecs_hk.c'},
 96+	--_codecs_iso2022={'cjkcodecs/_codecs_iso2022.c'},
 97+	_multiprocessing={'_multiprocessing/multiprocessing.c', '_multiprocessing/semaphore.c'},
 98+	_posixshmem={'_multiprocessing/posixshmem.c'},
 99+	--_uuid={'_uuidmodule.c'},
100+	--xxlimited={'xxlimited.c'},
101+	--xxlimited_35={'xxlimited_35.c'},
102+	--_tkinter={'_tkinter.c', 'tkappinit.c'},
103+	--_ctypes={'_ctypes/_ctypes.c', '_ctypes/callbacks.c', '_ctypes/callproc.c', '_ctypes/stgdict.c', '_ctypes/cfield.c'},
104+	--_ctypes_test={'_ctypes/_ctypes_test.c'},
105+	--_decimal={'_decimal/_decimal.c'},
106+	_ssl={'_ssl.c'},
107+	_hashlib={'_hashbearssl.c'},
108+	--_sha256={'sha256module.c'},
109+	--_sha512={'sha512module.c'},
110+	--_md5={'md5module.c'},
111+	--_sha1={'sha1module.c'},
112+	_blake2={'_blake2/blake2module.c', '_blake2/blake2b_impl.c', '_blake2/blake2s_impl.c'},
113+	_sha3={'_sha3/sha3module.c'},
114+	--nis={'nismodule.c'},
115+	_struct={'_struct.c'},
116+}
+2266, -0
   1@@ -0,0 +1,2266 @@
   2+From 61ad7f5ec78d4c80a99ac71820d9bc8b62c3fbae Mon Sep 17 00:00:00 2001
   3+From: Michael Forney <mforney@mforney.org>
   4+Date: Sat, 15 May 2021 22:48:13 -0700
   5+Subject: [PATCH] Add BearSSL implementation of _hashlib
   6+
   7+---
   8+ Modules/_hashbearssl.c          | 1126 +++++++++++++++++++++++++++++++
   9+ Modules/clinic/_hashbearssl.c.h | 1113 ++++++++++++++++++++++++++++++
  10+ 2 files changed, 2239 insertions(+)
  11+ create mode 100644 Modules/_hashbearssl.c
  12+ create mode 100644 Modules/clinic/_hashbearssl.c.h
  13+
  14+diff --git a/Modules/_hashbearssl.c b/Modules/_hashbearssl.c
  15+new file mode 100644
  16+index 0000000000..2d1a76296d
  17+--- /dev/null
  18++++ b/Modules/_hashbearssl.c
  19+@@ -0,0 +1,1126 @@
  20++/* Module that wraps all BearSSL hash algorithms */
  21++#define PY_SSIZE_T_CLEAN
  22++#include "Python.h"
  23++#include "hashlib.h"
  24++#include "pystrhex.h"
  25++
  26++#include <bearssl.h>
  27++
  28++static PyModuleDef _hashlibmodule;
  29++static PyTypeObject Hash_Type;
  30++static PyTypeObject SHAKE_Type;
  31++static PyTypeObject HMAC_Type;
  32++
  33++typedef struct {
  34++    PyObject_HEAD
  35++    br_hash_compat_context ctx;
  36++    PyThread_type_lock lock;
  37++} Hash;
  38++
  39++typedef struct {
  40++    PyObject_HEAD
  41++    br_hmac_context ctx;
  42++    br_hmac_key_context key;
  43++    PyThread_type_lock lock;
  44++} HMAC;
  45++
  46++typedef struct {
  47++    PyObject_HEAD
  48++    br_shake_context ctx;
  49++    int bits;
  50++    PyThread_type_lock lock;
  51++} SHAKE;
  52++
  53++#include "clinic/_hashbearssl.c.h"
  54++/*[clinic input]
  55++module _hashlib
  56++class _hashlib.Hash "Hash *" "Hash_Type"
  57++class _hashlib.HMAC "HMAC *" "HMAC_Type"
  58++class _hashlib.SHAKE "SHAKE *" "SHAKE_Type"
  59++[clinic start generated code]*/
  60++/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7a269412ec77c79a]*/
  61++
  62++static const br_hash_class *
  63++py_hash_by_name(const char *name)
  64++{
  65++    if (strcmp(name, "md5") == 0)
  66++        return &br_md5_vtable;
  67++    else if (strcmp(name, "sha1") == 0)
  68++        return &br_sha1_vtable;
  69++    else if (strcmp(name, "sha224") == 0)
  70++        return &br_sha224_vtable;
  71++    else if (strcmp(name, "sha256") == 0)
  72++        return &br_sha256_vtable;
  73++    else if (strcmp(name, "sha384") == 0)
  74++        return &br_sha384_vtable;
  75++    else if (strcmp(name, "sha512") == 0)
  76++        return &br_sha512_vtable;
  77++    return NULL;
  78++}
  79++
  80++PyDoc_STRVAR(Hash_doc,
  81++"Hash(name, string=b\'\')\n"
  82++"--\n"
  83++"\n"
  84++"A hash is an object used to calculate a checksum of a string of information.\n"
  85++"\n"
  86++"Methods:\n"
  87++"\n"
  88++"update() -- updates the current digest with an additional string\n"
  89++"digest() -- return the current digest value\n"
  90++"hexdigest() -- return the current digest as a string of hexadecimal digits\n"
  91++"copy() -- return a copy of the current hash object\n"
  92++"\n"
  93++"Attributes:\n"
  94++"\n"
  95++"name -- the hash algorithm being used by this object\n"
  96++"digest_size -- number of bytes in this hashes output");
  97++
  98++static void
  99++Hash_dealloc(Hash *self)
 100++{
 101++    if (self->lock)
 102++        PyThread_free_lock(self->lock);
 103++    PyObject_Free(self);
 104++}
 105++
 106++/*[clinic input]
 107++_hashlib.Hash.update as Hash_update
 108++
 109++    data: Py_buffer
 110++    /
 111++
 112++Update this hash object's state with the provided string.
 113++[clinic start generated code]*/
 114++
 115++static PyObject *
 116++Hash_update_impl(Hash *self, Py_buffer *data)
 117++/*[clinic end generated code: output=eed11f7503e289a3 input=0547d16ba3981abf]*/
 118++{
 119++    if (!self->lock && data->len >= HASHLIB_GIL_MINSIZE)
 120++        self->lock = PyThread_allocate_lock();
 121++    if (self->lock) {
 122++        Py_BEGIN_ALLOW_THREADS
 123++        PyThread_acquire_lock(self->lock, 1);
 124++        self->ctx.vtable->update(&self->ctx.vtable, data->buf, data->len);
 125++        PyThread_release_lock(self->lock);
 126++        Py_END_ALLOW_THREADS
 127++    } else {
 128++        self->ctx.vtable->update(&self->ctx.vtable, data->buf, data->len);
 129++    }
 130++    Py_RETURN_NONE;
 131++}
 132++
 133++/*[clinic input]
 134++_hashlib.Hash.digest as Hash_digest
 135++
 136++Return the digest value as a bytes object.
 137++[clinic start generated code]*/
 138++
 139++static PyObject *
 140++Hash_digest_impl(Hash *self)
 141++/*[clinic end generated code: output=b3eafdc9f37cf341 input=6d4afcd832edc55a]*/
 142++{
 143++    char digest[64];
 144++    Py_ssize_t digest_size;
 145++
 146++    ENTER_HASHLIB(self)
 147++    self->ctx.vtable->out(&self->ctx.vtable, digest);
 148++    LEAVE_HASHLIB(self)
 149++    digest_size = (self->ctx.vtable->desc >> BR_HASHDESC_OUT_OFF) & BR_HASHDESC_OUT_MASK;
 150++
 151++    return PyBytes_FromStringAndSize(digest, digest_size);
 152++}
 153++
 154++/*[clinic input]
 155++_hashlib.Hash.hexdigest as Hash_hexdigest
 156++
 157++Return the digest value as a string of hexadecimal digits.
 158++[clinic start generated code]*/
 159++
 160++static PyObject *
 161++Hash_hexdigest_impl(Hash *self)
 162++/*[clinic end generated code: output=eff810494302910a input=6b224236fad6ff65]*/
 163++{
 164++    char digest[64];
 165++    Py_ssize_t digest_size;
 166++
 167++    ENTER_HASHLIB(self)
 168++    self->ctx.vtable->out(&self->ctx.vtable, digest);
 169++    LEAVE_HASHLIB(self)
 170++    digest_size = (self->ctx.vtable->desc >> BR_HASHDESC_OUT_OFF) & BR_HASHDESC_OUT_MASK;
 171++
 172++    return _Py_strhex(digest, digest_size);
 173++}
 174++
 175++/*[clinic input]
 176++_hashlib.Hash.copy as Hash_copy
 177++
 178++Return a copy of the hash object.
 179++[clinic start generated code]*/
 180++
 181++static PyObject *
 182++Hash_copy_impl(Hash *self)
 183++/*[clinic end generated code: output=e97863340f55061b input=b830c9d949d08256]*/
 184++{
 185++    Hash *newobj;
 186++
 187++    newobj = PyObject_New(Hash, &Hash_Type);
 188++    if (!newobj)
 189++        return NULL;
 190++    newobj->lock = NULL;
 191++    ENTER_HASHLIB(self)
 192++    newobj->ctx = self->ctx;
 193++    LEAVE_HASHLIB(self)
 194++
 195++    return (PyObject *)newobj;
 196++}
 197++
 198++static PyMethodDef Hash_methods[] = {
 199++    HASH_UPDATE_METHODDEF
 200++    HASH_DIGEST_METHODDEF
 201++    HASH_HEXDIGEST_METHODDEF
 202++    HASH_COPY_METHODDEF
 203++    {0}
 204++};
 205++
 206++static PyObject *
 207++Hash_get_digest_size(Hash *self, void *closure)
 208++{
 209++    long digest_size;
 210++
 211++    digest_size = self->ctx.vtable->desc >> BR_HASHDESC_OUT_OFF & BR_HASHDESC_OUT_MASK;
 212++    return PyLong_FromLong(digest_size);
 213++}
 214++
 215++static PyObject *
 216++Hash_get_block_size(Hash *self, void *closure)
 217++{
 218++    long block_size;
 219++
 220++    block_size = 1 << (self->ctx.vtable->desc >> BR_HASHDESC_LBLEN_OFF & BR_HASHDESC_LBLEN_MASK);
 221++    return PyLong_FromLong(block_size);
 222++}
 223++
 224++static PyObject *
 225++Hash_get_name(Hash *self, void *closure)
 226++{
 227++    const char *name = NULL;
 228++
 229++    switch (self->ctx.vtable->desc >> BR_HASHDESC_ID_OFF & BR_HASHDESC_ID_MASK) {
 230++    case br_md5_ID:    name = "md5";    break;
 231++    case br_sha1_ID:   name = "sha1";   break;
 232++    case br_sha224_ID: name = "sha224"; break;
 233++    case br_sha256_ID: name = "sha256"; break;
 234++    case br_sha384_ID: name = "sha384"; break;
 235++    case br_sha512_ID: name = "sha512"; break;
 236++    }
 237++
 238++    return PyUnicode_FromString(name);
 239++}
 240++
 241++static PyGetSetDef Hash_getset[] = {
 242++    {"digest_size", (getter)Hash_get_digest_size, NULL, NULL, NULL},
 243++    {"block_size", (getter)Hash_get_block_size, NULL, NULL, NULL},
 244++    {"name", (getter)Hash_get_name, NULL, NULL, NULL},
 245++    {0}
 246++};
 247++
 248++static PyTypeObject Hash_Type = {
 249++    PyVarObject_HEAD_INIT(NULL, 0)
 250++    .tp_name = "_hashlib.Hash",
 251++    .tp_dealloc = (destructor)Hash_dealloc,
 252++    .tp_doc = Hash_doc,
 253++    .tp_basicsize = sizeof(Hash),
 254++    .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
 255++    .tp_methods = Hash_methods,
 256++    .tp_getset = Hash_getset,
 257++};
 258++
 259++PyDoc_STRVAR(SHAKE_doc,
 260++"SHAKE(name, string=b\'\')\n"
 261++"--\n"
 262++"\n"
 263++"A hash is an object used to calculate a checksum of a string of information.\n"
 264++"\n"
 265++"Methods:\n"
 266++"\n"
 267++"update() -- updates the current digest with an additional string\n"
 268++"digest(length) -- return the current digest value\n"
 269++"hexdigest(length) -- return the current digest as a string of hexadecimal digits\n"
 270++"copy() -- return a copy of the current hash object\n"
 271++"\n"
 272++"Attributes:\n"
 273++"\n"
 274++"name -- the hash algorithm being used by this object\n"
 275++"digest_size -- number of bytes in this hashes output");
 276++
 277++static void
 278++SHAKE_dealloc(SHAKE *self)
 279++{
 280++    if (self->lock)
 281++        PyThread_free_lock(self->lock);
 282++    PyObject_Free(self);
 283++}
 284++
 285++/*[clinic input]
 286++_hashlib.SHAKE.update as SHAKE_update
 287++
 288++    data: Py_buffer
 289++    /
 290++
 291++Update this hash object's state with the provided string.
 292++[clinic start generated code]*/
 293++
 294++static PyObject *
 295++SHAKE_update_impl(SHAKE *self, Py_buffer *data)
 296++/*[clinic end generated code: output=b7f5cd67459e2fb3 input=87a80642380b615f]*/
 297++{
 298++    if (!self->lock && data->len >= HASHLIB_GIL_MINSIZE)
 299++        self->lock = PyThread_allocate_lock();
 300++    if (self->lock) {
 301++        Py_BEGIN_ALLOW_THREADS
 302++        PyThread_acquire_lock(self->lock, 1);
 303++        br_shake_inject(&self->ctx, data->buf, data->len);
 304++        PyThread_release_lock(self->lock);
 305++        Py_END_ALLOW_THREADS
 306++    } else {
 307++        br_shake_inject(&self->ctx, data->buf, data->len);
 308++    }
 309++    Py_RETURN_NONE;
 310++}
 311++
 312++/*[clinic input]
 313++_hashlib.SHAKE.digest as SHAKE_digest
 314++
 315++  length: Py_ssize_t
 316++
 317++Return the digest value as a bytes object.
 318++[clinic start generated code]*/
 319++
 320++static PyObject *
 321++SHAKE_digest_impl(SHAKE *self, Py_ssize_t length)
 322++/*[clinic end generated code: output=4235ee593cba0b23 input=9e31587954f5e87a]*/
 323++{
 324++    br_shake_context ctx;
 325++    PyObject *bytes;
 326++
 327++    bytes = PyBytes_FromStringAndSize(NULL, length);
 328++    if (!bytes)
 329++        return NULL;
 330++
 331++    ENTER_HASHLIB(self)
 332++    ctx = self->ctx;
 333++    LEAVE_HASHLIB(self)
 334++    br_shake_flip(&ctx);
 335++    br_shake_produce(&ctx, PyBytes_AS_STRING(bytes), length);
 336++
 337++    return bytes;
 338++}
 339++
 340++/*[clinic input]
 341++_hashlib.SHAKE.hexdigest as SHAKE_hexdigest
 342++
 343++    length: Py_ssize_t
 344++
 345++Return the digest value as a string of hexadecimal digits.
 346++[clinic start generated code]*/
 347++
 348++static PyObject *
 349++SHAKE_hexdigest_impl(SHAKE *self, Py_ssize_t length)
 350++/*[clinic end generated code: output=fd9a7905a89a1509 input=2c43a9638ca1db5e]*/
 351++{
 352++    br_shake_context ctx;
 353++    char *bytes;
 354++    PyObject *str;
 355++
 356++    bytes = PyMem_Malloc(length);
 357++    if (!bytes) {
 358++        PyErr_NoMemory();
 359++        return NULL;
 360++    }
 361++
 362++    ENTER_HASHLIB(self)
 363++    ctx = self->ctx;
 364++    LEAVE_HASHLIB(self)
 365++    br_shake_flip(&ctx);
 366++    br_shake_produce(&ctx, bytes, length);
 367++
 368++    str = _Py_strhex(bytes, length);
 369++    PyMem_Free(bytes);
 370++    return str;
 371++}
 372++
 373++/*[clinic input]
 374++_hashlib.SHAKE.copy as SHAKE_copy
 375++
 376++Return a copy of the SHAKE object.
 377++[clinic start generated code]*/
 378++
 379++static PyObject *
 380++SHAKE_copy_impl(SHAKE *self)
 381++/*[clinic end generated code: output=19cff23538f29dc6 input=34c8368c5c9e910c]*/
 382++{
 383++    SHAKE *newobj;
 384++
 385++    newobj = PyObject_New(SHAKE, &SHAKE_Type);
 386++    if (!newobj)
 387++        return NULL;
 388++    newobj->lock = NULL;
 389++    ENTER_HASHLIB(self)
 390++    newobj->ctx = self->ctx;
 391++    newobj->bits = self->bits;
 392++    LEAVE_HASHLIB(self)
 393++
 394++    return (PyObject *)newobj;
 395++}
 396++
 397++static PyMethodDef SHAKE_methods[] = {
 398++    SHAKE_UPDATE_METHODDEF
 399++    SHAKE_DIGEST_METHODDEF
 400++    SHAKE_HEXDIGEST_METHODDEF
 401++    SHAKE_COPY_METHODDEF
 402++    {0}
 403++};
 404++
 405++static PyObject *
 406++SHAKE_get_digest_size(SHAKE *self, void *closure)
 407++{
 408++    return PyLong_FromLong(0);
 409++}
 410++
 411++static PyObject *
 412++SHAKE_get_block_size(SHAKE *self, void *closure)
 413++{
 414++    return PyLong_FromLong(self->ctx.rate);
 415++}
 416++
 417++static PyObject *
 418++SHAKE_get_name(SHAKE *self, void *closure)
 419++{
 420++    const char *name = NULL;
 421++
 422++    switch (self->bits) {
 423++    case 128: name = "shake_128"; break;
 424++    case 256: name = "shake_256"; break;
 425++    }
 426++
 427++    return PyUnicode_FromString(name);
 428++}
 429++
 430++static PyGetSetDef SHAKE_getset[] = {
 431++    {"digest_size", (getter)SHAKE_get_digest_size, NULL, NULL, NULL},
 432++    {"block_size", (getter)SHAKE_get_block_size, NULL, NULL, NULL},
 433++    {"name", (getter)SHAKE_get_name, NULL, NULL, NULL},
 434++    {0}
 435++};
 436++
 437++static PyTypeObject SHAKE_Type = {
 438++    PyVarObject_HEAD_INIT(NULL, 0)
 439++    .tp_name = "_hashlib.SHAKE",
 440++    .tp_dealloc = (destructor)SHAKE_dealloc,
 441++    .tp_doc = SHAKE_doc,
 442++    .tp_basicsize = sizeof(SHAKE),
 443++    .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
 444++    .tp_methods = SHAKE_methods,
 445++    .tp_getset = SHAKE_getset,
 446++};
 447++
 448++PyDoc_STRVAR(HMAC_doc,
 449++"The object used to calculate HMAC of a message.\n\
 450++\n\
 451++Methods:\n\
 452++\n\
 453++update() -- updates the current digest with an additional string\n\
 454++digest() -- return the current digest value\n\
 455++hexdigest() -- return the current digest as a string of hexadecimal digits\n\
 456++copy() -- return a copy of the current hash object\n\
 457++\n\
 458++Attributes:\n\
 459++\n\
 460++name -- the name, including the hash algorithm used by this object\n\
 461++digest_size -- number of bytes in digest() output\n");
 462++
 463++static void
 464++HMAC_dealloc(HMAC *self)
 465++{
 466++    if (self->lock)
 467++        PyThread_free_lock(self->lock);
 468++    PyObject_Free(self);
 469++}
 470++/*[clinic input]
 471++_hashlib.HMAC.copy as HMAC_copy
 472++
 473++Return a copy of the HMAC object.
 474++[clinic start generated code]*/
 475++
 476++static PyObject *
 477++HMAC_copy_impl(HMAC *self)
 478++/*[clinic end generated code: output=6a3595133ec708a5 input=c471e903458ee9a7]*/
 479++{
 480++    HMAC *newobj;
 481++
 482++    newobj = PyObject_New(HMAC, &HMAC_Type);
 483++    if (!newobj)
 484++        return NULL;
 485++    newobj->lock = NULL;
 486++    ENTER_HASHLIB(self)
 487++    newobj->ctx = self->ctx;
 488++    newobj->key = self->key;
 489++    LEAVE_HASHLIB(self)
 490++
 491++    return (PyObject *)newobj;
 492++}
 493++
 494++/*[clinic input]
 495++_hashlib.HMAC.update as HMAC_update
 496++
 497++    data: Py_buffer
 498++    /
 499++
 500++Update the HMAC object with data.
 501++[clinic start generated code]*/
 502++
 503++static PyObject *
 504++HMAC_update_impl(HMAC *self, Py_buffer *data)
 505++/*[clinic end generated code: output=d3520ecffa6cc3ab input=827e77e990887267]*/
 506++{
 507++    if (!self->lock && data->len >= HASHLIB_GIL_MINSIZE)
 508++        self->lock = PyThread_allocate_lock();
 509++    if (self->lock) {
 510++        Py_BEGIN_ALLOW_THREADS
 511++        PyThread_acquire_lock(self->lock, 1);
 512++        br_hmac_update(&self->ctx, data->buf, data->len);
 513++        PyThread_release_lock(self->lock);
 514++        Py_END_ALLOW_THREADS
 515++    } else {
 516++        br_hmac_update(&self->ctx, data->buf, data->len);
 517++    }
 518++    Py_RETURN_NONE;
 519++}
 520++
 521++/*[clinic input]
 522++_hashlib.HMAC.digest as HMAC_digest
 523++
 524++Return the digest of the bytes passed to the update() method so far.
 525++[clinic start generated code]*/
 526++
 527++static PyObject *
 528++HMAC_digest_impl(HMAC *self)
 529++/*[clinic end generated code: output=9853eeca2bdd96df input=d39cb2285b557318]*/
 530++{
 531++    char digest[64];
 532++    Py_ssize_t digest_size;
 533++
 534++    ENTER_HASHLIB(self)
 535++    digest_size = br_hmac_out(&self->ctx, digest);
 536++    LEAVE_HASHLIB(self)
 537++
 538++    return PyBytes_FromStringAndSize(digest, digest_size);
 539++}
 540++
 541++/*[clinic input]
 542++_hashlib.HMAC.hexdigest as HMAC_hexdigest
 543++
 544++Return hexadecimal digest of the bytes passed to the update() method so far.
 545++
 546++This may be used to exchange the value safely in email or other non-binary
 547++environments.
 548++[clinic start generated code]*/
 549++
 550++static PyObject *
 551++HMAC_hexdigest_impl(HMAC *self)
 552++/*[clinic end generated code: output=9bb0c7abb6940bab input=2471f22b8dba7433]*/
 553++{
 554++    char digest[64];
 555++    Py_ssize_t digest_size;
 556++
 557++    ENTER_HASHLIB(self)
 558++    digest_size = br_hmac_out(&self->ctx, digest);
 559++    LEAVE_HASHLIB(self)
 560++
 561++    return _Py_strhex(digest, digest_size);
 562++}
 563++
 564++static PyMethodDef HMAC_methods[] = {
 565++    HMAC_UPDATE_METHODDEF
 566++    HMAC_DIGEST_METHODDEF
 567++    HMAC_HEXDIGEST_METHODDEF
 568++    HMAC_COPY_METHODDEF
 569++    {0},
 570++};
 571++
 572++static PyObject *
 573++HMAC_get_digest_size(HMAC *self, void *closure)
 574++{
 575++    const br_hash_class *hc;
 576++    long digest_size;
 577++
 578++    hc = br_hmac_get_digest(&self->ctx);
 579++    digest_size = hc->desc >> BR_HASHDESC_OUT_OFF & BR_HASHDESC_OUT_MASK;
 580++    return PyLong_FromLong(digest_size);
 581++}
 582++
 583++static PyObject *
 584++HMAC_get_block_size(HMAC *self, void *closure)
 585++{
 586++    const br_hash_class *hc;
 587++    long block_size;
 588++
 589++    hc = br_hmac_get_digest(&self->ctx);
 590++    block_size = 1 << (hc->desc >> BR_HASHDESC_LBLEN_OFF & BR_HASHDESC_LBLEN_MASK);
 591++    return PyLong_FromLong(block_size);
 592++}
 593++
 594++static PyObject *
 595++HMAC_get_name(HMAC *self, void *closure)
 596++{
 597++    const br_hash_class *hc;
 598++    const char *name = NULL;
 599++
 600++    hc = br_hmac_get_digest(&self->ctx);
 601++    switch (hc->desc >> BR_HASHDESC_ID_OFF & BR_HASHDESC_ID_MASK) {
 602++    case br_md5_ID:    name = "hmac-md5";    break;
 603++    case br_sha1_ID:   name = "hmac-sha1";   break;
 604++    case br_sha224_ID: name = "hmac-sha224"; break;
 605++    case br_sha256_ID: name = "hmac-sha256"; break;
 606++    case br_sha384_ID: name = "hmac-sha384"; break;
 607++    case br_sha512_ID: name = "hmac-sha512"; break;
 608++    }
 609++
 610++    return PyUnicode_FromString(name);
 611++}
 612++
 613++static PyGetSetDef HMAC_getset[] = {
 614++    {"digest_size", (getter)HMAC_get_digest_size, NULL, NULL, NULL},
 615++    {"block_size", (getter)HMAC_get_block_size, NULL, NULL, NULL},
 616++    {"name", (getter)HMAC_get_name, NULL, NULL, NULL},
 617++    {0}
 618++};
 619++
 620++static PyTypeObject HMAC_Type = {
 621++    PyVarObject_HEAD_INIT(NULL, 0)
 622++    .tp_name = "_hashlib.HMAC",
 623++    .tp_dealloc = (destructor)HMAC_dealloc,
 624++    .tp_doc = HMAC_doc,
 625++    .tp_basicsize = sizeof(HMAC),
 626++    .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
 627++    .tp_methods = HMAC_methods,
 628++    .tp_getset = HMAC_getset,
 629++};
 630++
 631++static PyObject *
 632++Hash_new_vtable(PyObject *module, const br_hash_class *hc,
 633++                Py_buffer *string, int usedforsecurity)
 634++{
 635++    Hash *self;
 636++
 637++    self = PyObject_New(Hash, &Hash_Type);
 638++    if (!self)
 639++        return NULL;
 640++    self->lock = NULL;
 641++    hc->init(&self->ctx.vtable);
 642++
 643++    if (string->len >= HASHLIB_GIL_MINSIZE) {
 644++        Py_BEGIN_ALLOW_THREADS
 645++        hc->update(&self->ctx.vtable, string->buf, string->len);
 646++        Py_END_ALLOW_THREADS
 647++    } else {
 648++        hc->update(&self->ctx.vtable, string->buf, string->len);
 649++    }
 650++
 651++    return (PyObject *)self;
 652++}
 653++
 654++static PyObject *
 655++SHAKE_new(PyObject *module, int bits, Py_buffer *string, int usedforsecurity)
 656++{
 657++    SHAKE *self;
 658++
 659++    self = PyObject_New(SHAKE, &SHAKE_Type);
 660++    if (!self)
 661++        return NULL;
 662++    self->lock = NULL;
 663++    self->bits = bits;
 664++    br_shake_init(&self->ctx, bits);
 665++
 666++    if (string->len >= HASHLIB_GIL_MINSIZE) {
 667++        Py_BEGIN_ALLOW_THREADS
 668++        br_shake_inject(&self->ctx, string->buf, string->len);
 669++        Py_END_ALLOW_THREADS
 670++    } else {
 671++        br_shake_inject(&self->ctx, string->buf, string->len);
 672++    }
 673++
 674++    return (PyObject *)self;
 675++}
 676++
 677++/*[clinic input]
 678++_hashlib.new
 679++
 680++    name: str
 681++    string: Py_buffer = None
 682++    *
 683++    usedforsecurity: bool = True
 684++
 685++Return a new hash object using the named algorithm.
 686++
 687++An optional string argument may be provided and will be
 688++automatically hashed.
 689++
 690++The MD5 and SHA1 algorithms are always supported.
 691++[clinic start generated code]*/
 692++
 693++static PyObject *
 694++_hashlib_new_impl(PyObject *module, const char *name, Py_buffer *string,
 695++                  int usedforsecurity)
 696++/*[clinic end generated code: output=5459beb11946eb8d input=c7e3a9928c6af923]*/
 697++{
 698++    const br_hash_class *hc = NULL;
 699++    int shake = 0;
 700++
 701++    hc = py_hash_by_name(name);
 702++    if (hc)
 703++        ;
 704++    else if (strcmp(name, "shake_128") == 0)
 705++        shake = 128;
 706++    else if (strcmp(name, "shake_256") == 0)
 707++        shake = 256;
 708++    else {
 709++        PyErr_SetString(PyExc_ValueError, "unsupported hash type");
 710++        return NULL;
 711++    }
 712++
 713++    if (hc)
 714++        return Hash_new_vtable(module, hc, string, usedforsecurity);
 715++    if (shake)
 716++        return SHAKE_new(module, shake, string, usedforsecurity);
 717++}
 718++
 719++/*[clinic input]
 720++_hashlib.openssl_md5
 721++
 722++    string: Py_buffer = None
 723++    *
 724++    usedforsecurity: bool = True
 725++
 726++Returns a md5 hash object; optionally initialized with a string.
 727++[clinic start generated code]*/
 728++
 729++static PyObject *
 730++_hashlib_openssl_md5_impl(PyObject *module, Py_buffer *string,
 731++                          int usedforsecurity)
 732++/*[clinic end generated code: output=bf0df21c3ecd9d85 input=75e59cc38a292e51]*/
 733++{
 734++    return Hash_new_vtable(module, &br_md5_vtable, string, usedforsecurity);
 735++}
 736++
 737++/*[clinic input]
 738++_hashlib.openssl_sha1
 739++
 740++    string: Py_buffer = None
 741++    *
 742++    usedforsecurity: bool = True
 743++
 744++Returns a sha1 hash object; optionally initialized with a string.
 745++[clinic start generated code]*/
 746++
 747++static PyObject *
 748++_hashlib_openssl_sha1_impl(PyObject *module, Py_buffer *string,
 749++                           int usedforsecurity)
 750++/*[clinic end generated code: output=9c468cf3cfdd2e57 input=0f8ad0fa5d988be8]*/
 751++{
 752++    return Hash_new_vtable(module, &br_sha1_vtable, string, usedforsecurity);
 753++}
 754++
 755++/*[clinic input]
 756++_hashlib.openssl_sha224
 757++
 758++    string: Py_buffer = None
 759++    *
 760++    usedforsecurity: bool = True
 761++
 762++Returns a sha224 hash object; optionally initialized with a string.
 763++[clinic start generated code]*/
 764++
 765++static PyObject *
 766++_hashlib_openssl_sha224_impl(PyObject *module, Py_buffer *string,
 767++                             int usedforsecurity)
 768++/*[clinic end generated code: output=9b3fea17aacc8dfe input=21aacab0e6949431]*/
 769++{
 770++    return Hash_new_vtable(module, &br_sha224_vtable, string, usedforsecurity);
 771++}
 772++
 773++/*[clinic input]
 774++_hashlib.openssl_sha256
 775++
 776++    string: Py_buffer = None
 777++    *
 778++    usedforsecurity: bool = True
 779++
 780++Returns a sha256 hash object; optionally initialized with a string.
 781++[clinic start generated code]*/
 782++
 783++static PyObject *
 784++_hashlib_openssl_sha256_impl(PyObject *module, Py_buffer *string,
 785++                             int usedforsecurity)
 786++/*[clinic end generated code: output=2c0585ccc6dfa22a input=81dd291675e0f6c9]*/
 787++{
 788++    return Hash_new_vtable(module, &br_sha256_vtable, string, usedforsecurity);
 789++}
 790++
 791++/*[clinic input]
 792++_hashlib.openssl_sha384
 793++
 794++    string: Py_buffer = None
 795++    *
 796++    usedforsecurity: bool = True
 797++
 798++Returns a sha384 hash object; optionally initialized with a string.
 799++[clinic start generated code]*/
 800++
 801++static PyObject *
 802++_hashlib_openssl_sha384_impl(PyObject *module, Py_buffer *string,
 803++                             int usedforsecurity)
 804++/*[clinic end generated code: output=196d8d7558cfd155 input=eed0b0128dd67969]*/
 805++{
 806++    return Hash_new_vtable(module, &br_sha384_vtable, string, usedforsecurity);
 807++}
 808++
 809++/*[clinic input]
 810++_hashlib.openssl_sha512
 811++
 812++    string: Py_buffer = None
 813++    *
 814++    usedforsecurity: bool = True
 815++
 816++Returns a sha512 hash object; optionally initialized with a string.
 817++[clinic start generated code]*/
 818++
 819++static PyObject *
 820++_hashlib_openssl_sha512_impl(PyObject *module, Py_buffer *string,
 821++                             int usedforsecurity)
 822++/*[clinic end generated code: output=7349b37b20ff6f75 input=da1228b585897043]*/
 823++{
 824++    return Hash_new_vtable(module, &br_sha512_vtable, string, usedforsecurity);
 825++}
 826++
 827++/*[clinic input]
 828++_hashlib.openssl_shake_128
 829++
 830++    string: Py_buffer = None
 831++    *
 832++    usedforsecurity: bool = True
 833++
 834++Returns a shake-128 variable hash object; optionally initialized with a string.
 835++[clinic start generated code]*/
 836++
 837++static PyObject *
 838++_hashlib_openssl_shake_128_impl(PyObject *module, Py_buffer *string,
 839++                                int usedforsecurity)
 840++/*[clinic end generated code: output=e51cc0e4bded887e input=fb6dce24fc91d53d]*/
 841++{
 842++    return SHAKE_new(module, 128, string, usedforsecurity);
 843++}
 844++
 845++/*[clinic input]
 846++_hashlib.openssl_shake_256
 847++
 848++    string: Py_buffer = None
 849++    *
 850++    usedforsecurity: bool = True
 851++
 852++Returns a shake-256 variable hash object; optionally initialized with a string.
 853++[clinic start generated code]*/
 854++
 855++static PyObject *
 856++_hashlib_openssl_shake_256_impl(PyObject *module, Py_buffer *string,
 857++                                int usedforsecurity)
 858++/*[clinic end generated code: output=983a76ff0796751b input=9eb2a133d11e34dc]*/
 859++{
 860++    return SHAKE_new(module, 256, string, usedforsecurity);
 861++}
 862++
 863++static int
 864++_tscmp(const unsigned char *a, const unsigned char *b,
 865++        Py_ssize_t len_a, Py_ssize_t len_b)
 866++{
 867++    /* loop count depends on length of b. Might leak very little timing
 868++     * information if sizes are different.
 869++     */
 870++    Py_ssize_t length = len_b;
 871++    unsigned result = 0;
 872++    size_t i;
 873++
 874++    if (len_a != length) {
 875++        a = b;
 876++        result = 1;
 877++    }
 878++
 879++    for (i = 0; i < length; i++)
 880++        result |= (unsigned)a[i] ^ (unsigned)b[i];
 881++
 882++    return ~(result | -result) >> CHAR_BIT * sizeof(result) - 1;
 883++}
 884++
 885++/*[clinic input]
 886++_hashlib.compare_digest
 887++
 888++    a: object
 889++    b: object
 890++    /
 891++
 892++Return 'a == b'.
 893++
 894++This function uses an approach designed to prevent
 895++timing analysis, making it appropriate for cryptography.
 896++
 897++a and b must both be of the same type: either str (ASCII only),
 898++or any bytes-like object.
 899++
 900++Note: If a and b are of different lengths, or if an error occurs,
 901++a timing attack could theoretically reveal information about the
 902++types and lengths of a and b--but not their values.
 903++[clinic start generated code]*/
 904++
 905++static PyObject *
 906++_hashlib_compare_digest_impl(PyObject *module, PyObject *a, PyObject *b)
 907++/*[clinic end generated code: output=6f1c13927480aed9 input=f9cc6da970b1b1d5]*/
 908++{
 909++    int rc;
 910++
 911++    /* ASCII unicode string */
 912++    if(PyUnicode_Check(a) && PyUnicode_Check(b)) {
 913++        if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
 914++            return NULL;
 915++        }
 916++        if (!PyUnicode_IS_ASCII(a) || !PyUnicode_IS_ASCII(b)) {
 917++            PyErr_SetString(PyExc_TypeError,
 918++                            "comparing strings with non-ASCII characters is "
 919++                            "not supported");
 920++            return NULL;
 921++        }
 922++
 923++        rc = _tscmp(PyUnicode_DATA(a),
 924++                    PyUnicode_DATA(b),
 925++                    PyUnicode_GET_LENGTH(a),
 926++                    PyUnicode_GET_LENGTH(b));
 927++    }
 928++    /* fallback to buffer interface for bytes, bytesarray and other */
 929++    else {
 930++        Py_buffer view_a;
 931++        Py_buffer view_b;
 932++
 933++        if (PyObject_CheckBuffer(a) == 0 && PyObject_CheckBuffer(b) == 0) {
 934++            PyErr_Format(PyExc_TypeError,
 935++                         "unsupported operand types(s) or combination of types: "
 936++                         "'%.100s' and '%.100s'",
 937++                         Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
 938++            return NULL;
 939++        }
 940++
 941++        if (PyObject_GetBuffer(a, &view_a, PyBUF_SIMPLE) == -1) {
 942++            return NULL;
 943++        }
 944++        if (view_a.ndim > 1) {
 945++            PyErr_SetString(PyExc_BufferError,
 946++                            "Buffer must be single dimension");
 947++            PyBuffer_Release(&view_a);
 948++            return NULL;
 949++        }
 950++
 951++        if (PyObject_GetBuffer(b, &view_b, PyBUF_SIMPLE) == -1) {
 952++            PyBuffer_Release(&view_a);
 953++            return NULL;
 954++        }
 955++        if (view_b.ndim > 1) {
 956++            PyErr_SetString(PyExc_BufferError,
 957++                            "Buffer must be single dimension");
 958++            PyBuffer_Release(&view_a);
 959++            PyBuffer_Release(&view_b);
 960++            return NULL;
 961++        }
 962++
 963++        rc = _tscmp((const unsigned char*)view_a.buf,
 964++                    (const unsigned char*)view_b.buf,
 965++                    view_a.len,
 966++                    view_b.len);
 967++
 968++        PyBuffer_Release(&view_a);
 969++        PyBuffer_Release(&view_b);
 970++    }
 971++
 972++    return PyBool_FromLong(rc);
 973++}
 974++
 975++static struct PyMethodDef hashlib_methods[] = {
 976++    _HASHLIB_NEW_METHODDEF
 977++    _HASHLIB_HMAC_SINGLESHOT_METHODDEF
 978++    _HASHLIB_HMAC_NEW_METHODDEF
 979++    _HASHLIB_OPENSSL_MD5_METHODDEF
 980++    _HASHLIB_OPENSSL_SHA1_METHODDEF
 981++    _HASHLIB_OPENSSL_SHA224_METHODDEF
 982++    _HASHLIB_OPENSSL_SHA256_METHODDEF
 983++    _HASHLIB_OPENSSL_SHA384_METHODDEF
 984++    _HASHLIB_OPENSSL_SHA512_METHODDEF
 985++    _HASHLIB_OPENSSL_SHAKE_128_METHODDEF
 986++    _HASHLIB_OPENSSL_SHAKE_256_METHODDEF
 987++    _HASHLIB_COMPARE_DIGEST_METHODDEF
 988++    {0}
 989++};
 990++
 991++/* Fast HMAC for hmac.digest() */
 992++
 993++/*[clinic input]
 994++_hashlib.hmac_digest as _hashlib_hmac_singleshot
 995++
 996++    key: Py_buffer
 997++    msg: Py_buffer
 998++    digest: str
 999++
1000++Single-shot HMAC.
1001++[clinic start generated code]*/
1002++
1003++static PyObject *
1004++_hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key,
1005++                              Py_buffer *msg, const char *digest)
1006++/*[clinic end generated code: output=15658ede5ab98185 input=019dffc571909a46]*/
1007++{
1008++    char buf[64];
1009++    Py_ssize_t buf_len;
1010++    br_hmac_context ctx;
1011++    br_hmac_key_context keyctx;
1012++    const br_hash_class *hc;
1013++
1014++    hc = py_hash_by_name(digest);
1015++    if (!hc) {
1016++        PyErr_SetString(PyExc_ValueError, "unsupported hash type");
1017++        return NULL;
1018++    }
1019++    if (msg->len >= HASHLIB_GIL_MINSIZE) {
1020++        Py_BEGIN_ALLOW_THREADS
1021++        br_hmac_key_init(&keyctx, hc, key->buf, key->len);
1022++        br_hmac_init(&ctx, &keyctx, 0);
1023++        br_hmac_update(&ctx, msg->buf, msg->len);
1024++        br_hmac_out(&ctx, buf);
1025++        Py_END_ALLOW_THREADS
1026++    } else {
1027++        br_hmac_key_init(&keyctx, hc, key->buf, key->len);
1028++        br_hmac_init(&ctx, &keyctx, 0);
1029++        br_hmac_update(&ctx, msg->buf, msg->len);
1030++        br_hmac_out(&ctx, buf);
1031++    }
1032++    buf_len = br_hmac_size(&ctx);
1033++
1034++    return PyBytes_FromStringAndSize(buf, buf_len);
1035++}
1036++
1037++/*[clinic input]
1038++_hashlib.hmac_new
1039++
1040++    key: Py_buffer
1041++    msg: Py_buffer = None
1042++    digestmod: str(c_default="NULL") = None
1043++
1044++Return a new hmac object.
1045++[clinic start generated code]*/
1046++
1047++static PyObject *
1048++_hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, Py_buffer *msg,
1049++                       const char *digestmod)
1050++/*[clinic end generated code: output=5733a8600554bba2 input=b0125f4222a0d06d]*/
1051++{
1052++    HMAC *self;
1053++    const br_hash_class *hc;
1054++
1055++    printf("hmac new\n");
1056++
1057++    if (!digestmod || !digestmod[0]) {
1058++        PyErr_SetString(
1059++            PyExc_TypeError, "missing required parameter 'digestmod'");
1060++        return NULL;
1061++    }
1062++    hc = py_hash_by_name(digestmod);
1063++    if (!hc) {
1064++        PyErr_SetString(PyExc_ValueError, "unknown hash function");
1065++        return NULL;
1066++    }
1067++    self = PyObject_New(HMAC, &HMAC_Type);
1068++    if (!self)
1069++        return NULL;
1070++    self->lock = NULL;
1071++    br_hmac_key_init(&self->key, hc, key->buf, key->len);
1072++    br_hmac_init(&self->ctx, &self->key, 0);
1073++
1074++    if (msg->len >= HASHLIB_GIL_MINSIZE) {
1075++        Py_BEGIN_ALLOW_THREADS
1076++        br_hmac_update(&self->ctx, msg->buf, msg->len);
1077++        Py_END_ALLOW_THREADS
1078++    } else {
1079++        br_hmac_update(&self->ctx, msg->buf, msg->len);
1080++    }
1081++
1082++    return (PyObject *)self;
1083++}
1084++
1085++static struct PyModuleDef _hashlibmodule = {
1086++    PyModuleDef_HEAD_INIT,
1087++    .m_name = "_hashlib",
1088++    .m_doc = "BearSSL interface for hashlib module",
1089++    .m_methods = hashlib_methods,
1090++};
1091++
1092++PyMODINIT_FUNC
1093++PyInit__hashlib(void)
1094++{
1095++    PyObject *m = NULL, *set = NULL, *name;
1096++    static const char *const names[] = {
1097++        "md5",
1098++        "sha1",
1099++        "sha224",
1100++        "sha256",
1101++        "sha384",
1102++        "sha512",
1103++        "shake_128",
1104++        "shake_256",
1105++    };
1106++    int r;
1107++
1108++    m = PyState_FindModule(&_hashlibmodule);
1109++    if (m) {
1110++        Py_INCREF(m);
1111++        return m;
1112++    }
1113++    m = PyModule_Create(&_hashlibmodule);
1114++    if (!m)
1115++        goto err;
1116++    if (PyModule_AddType(m, &Hash_Type) < 0)
1117++        goto err;
1118++    if (PyModule_AddType(m, &SHAKE_Type) < 0)
1119++        goto err;
1120++    if (PyModule_AddType(m, &HMAC_Type) < 0)
1121++        goto err;
1122++    set = PyFrozenSet_New(NULL);
1123++    if (!set)
1124++        goto err;
1125++    for (size_t i = 0; i < sizeof(names) / sizeof(names[0]); i++) {
1126++        name = PyUnicode_FromString(names[i]);
1127++        if (!name)
1128++            goto err;
1129++        r = PySet_Add(set, name);
1130++        Py_DECREF(name);
1131++        if (r != 0)
1132++            goto err;
1133++    }
1134++    if (PyModule_AddObject(m, "openssl_md_meth_names", set) < 0)
1135++        goto err;
1136++
1137++    return m;
1138++
1139++  err:
1140++    if (set)
1141++        Py_DECREF(set);
1142++    if (m)
1143++        Py_DECREF(m);
1144++    return NULL;
1145++}
1146+diff --git a/Modules/clinic/_hashbearssl.c.h b/Modules/clinic/_hashbearssl.c.h
1147+new file mode 100644
1148+index 0000000000..49bf8f9287
1149+--- /dev/null
1150++++ b/Modules/clinic/_hashbearssl.c.h
1151+@@ -0,0 +1,1113 @@
1152++/*[clinic input]
1153++preserve
1154++[clinic start generated code]*/
1155++
1156++PyDoc_STRVAR(Hash_update__doc__,
1157++"update($self, data, /)\n"
1158++"--\n"
1159++"\n"
1160++"Update this hash object\'s state with the provided string.");
1161++
1162++#define HASH_UPDATE_METHODDEF    \
1163++    {"update", (PyCFunction)Hash_update, METH_O, Hash_update__doc__},
1164++
1165++static PyObject *
1166++Hash_update_impl(Hash *self, Py_buffer *data);
1167++
1168++static PyObject *
1169++Hash_update(Hash *self, PyObject *arg)
1170++{
1171++    PyObject *return_value = NULL;
1172++    Py_buffer data = {NULL, NULL};
1173++
1174++    if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
1175++        goto exit;
1176++    }
1177++    if (!PyBuffer_IsContiguous(&data, 'C')) {
1178++        _PyArg_BadArgument("update", "argument", "contiguous buffer", arg);
1179++        goto exit;
1180++    }
1181++    return_value = Hash_update_impl(self, &data);
1182++
1183++exit:
1184++    /* Cleanup for data */
1185++    if (data.obj) {
1186++       PyBuffer_Release(&data);
1187++    }
1188++
1189++    return return_value;
1190++}
1191++
1192++PyDoc_STRVAR(Hash_digest__doc__,
1193++"digest($self, /)\n"
1194++"--\n"
1195++"\n"
1196++"Return the digest value as a bytes object.");
1197++
1198++#define HASH_DIGEST_METHODDEF    \
1199++    {"digest", (PyCFunction)Hash_digest, METH_NOARGS, Hash_digest__doc__},
1200++
1201++static PyObject *
1202++Hash_digest_impl(Hash *self);
1203++
1204++static PyObject *
1205++Hash_digest(Hash *self, PyObject *Py_UNUSED(ignored))
1206++{
1207++    return Hash_digest_impl(self);
1208++}
1209++
1210++PyDoc_STRVAR(Hash_hexdigest__doc__,
1211++"hexdigest($self, /)\n"
1212++"--\n"
1213++"\n"
1214++"Return the digest value as a string of hexadecimal digits.");
1215++
1216++#define HASH_HEXDIGEST_METHODDEF    \
1217++    {"hexdigest", (PyCFunction)Hash_hexdigest, METH_NOARGS, Hash_hexdigest__doc__},
1218++
1219++static PyObject *
1220++Hash_hexdigest_impl(Hash *self);
1221++
1222++static PyObject *
1223++Hash_hexdigest(Hash *self, PyObject *Py_UNUSED(ignored))
1224++{
1225++    return Hash_hexdigest_impl(self);
1226++}
1227++
1228++PyDoc_STRVAR(Hash_copy__doc__,
1229++"copy($self, /)\n"
1230++"--\n"
1231++"\n"
1232++"Return a copy of the hash object.");
1233++
1234++#define HASH_COPY_METHODDEF    \
1235++    {"copy", (PyCFunction)Hash_copy, METH_NOARGS, Hash_copy__doc__},
1236++
1237++static PyObject *
1238++Hash_copy_impl(Hash *self);
1239++
1240++static PyObject *
1241++Hash_copy(Hash *self, PyObject *Py_UNUSED(ignored))
1242++{
1243++    return Hash_copy_impl(self);
1244++}
1245++
1246++PyDoc_STRVAR(SHAKE_update__doc__,
1247++"update($self, data, /)\n"
1248++"--\n"
1249++"\n"
1250++"Update this hash object\'s state with the provided string.");
1251++
1252++#define SHAKE_UPDATE_METHODDEF    \
1253++    {"update", (PyCFunction)SHAKE_update, METH_O, SHAKE_update__doc__},
1254++
1255++static PyObject *
1256++SHAKE_update_impl(SHAKE *self, Py_buffer *data);
1257++
1258++static PyObject *
1259++SHAKE_update(SHAKE *self, PyObject *arg)
1260++{
1261++    PyObject *return_value = NULL;
1262++    Py_buffer data = {NULL, NULL};
1263++
1264++    if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
1265++        goto exit;
1266++    }
1267++    if (!PyBuffer_IsContiguous(&data, 'C')) {
1268++        _PyArg_BadArgument("update", "argument", "contiguous buffer", arg);
1269++        goto exit;
1270++    }
1271++    return_value = SHAKE_update_impl(self, &data);
1272++
1273++exit:
1274++    /* Cleanup for data */
1275++    if (data.obj) {
1276++       PyBuffer_Release(&data);
1277++    }
1278++
1279++    return return_value;
1280++}
1281++
1282++PyDoc_STRVAR(SHAKE_digest__doc__,
1283++"digest($self, /, length)\n"
1284++"--\n"
1285++"\n"
1286++"Return the digest value as a bytes object.");
1287++
1288++#define SHAKE_DIGEST_METHODDEF    \
1289++    {"digest", (PyCFunction)(void(*)(void))SHAKE_digest, METH_FASTCALL|METH_KEYWORDS, SHAKE_digest__doc__},
1290++
1291++static PyObject *
1292++SHAKE_digest_impl(SHAKE *self, Py_ssize_t length);
1293++
1294++static PyObject *
1295++SHAKE_digest(SHAKE *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1296++{
1297++    PyObject *return_value = NULL;
1298++    static const char * const _keywords[] = {"length", NULL};
1299++    static _PyArg_Parser _parser = {NULL, _keywords, "digest", 0};
1300++    PyObject *argsbuf[1];
1301++    Py_ssize_t length;
1302++
1303++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
1304++    if (!args) {
1305++        goto exit;
1306++    }
1307++    if (PyFloat_Check(args[0])) {
1308++        PyErr_SetString(PyExc_TypeError,
1309++                        "integer argument expected, got float" );
1310++        goto exit;
1311++    }
1312++    {
1313++        Py_ssize_t ival = -1;
1314++        PyObject *iobj = PyNumber_Index(args[0]);
1315++        if (iobj != NULL) {
1316++            ival = PyLong_AsSsize_t(iobj);
1317++            Py_DECREF(iobj);
1318++        }
1319++        if (ival == -1 && PyErr_Occurred()) {
1320++            goto exit;
1321++        }
1322++        length = ival;
1323++    }
1324++    return_value = SHAKE_digest_impl(self, length);
1325++
1326++exit:
1327++    return return_value;
1328++}
1329++
1330++PyDoc_STRVAR(SHAKE_hexdigest__doc__,
1331++"hexdigest($self, /, length)\n"
1332++"--\n"
1333++"\n"
1334++"Return the digest value as a string of hexadecimal digits.");
1335++
1336++#define SHAKE_HEXDIGEST_METHODDEF    \
1337++    {"hexdigest", (PyCFunction)(void(*)(void))SHAKE_hexdigest, METH_FASTCALL|METH_KEYWORDS, SHAKE_hexdigest__doc__},
1338++
1339++static PyObject *
1340++SHAKE_hexdigest_impl(SHAKE *self, Py_ssize_t length);
1341++
1342++static PyObject *
1343++SHAKE_hexdigest(SHAKE *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1344++{
1345++    PyObject *return_value = NULL;
1346++    static const char * const _keywords[] = {"length", NULL};
1347++    static _PyArg_Parser _parser = {NULL, _keywords, "hexdigest", 0};
1348++    PyObject *argsbuf[1];
1349++    Py_ssize_t length;
1350++
1351++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
1352++    if (!args) {
1353++        goto exit;
1354++    }
1355++    if (PyFloat_Check(args[0])) {
1356++        PyErr_SetString(PyExc_TypeError,
1357++                        "integer argument expected, got float" );
1358++        goto exit;
1359++    }
1360++    {
1361++        Py_ssize_t ival = -1;
1362++        PyObject *iobj = PyNumber_Index(args[0]);
1363++        if (iobj != NULL) {
1364++            ival = PyLong_AsSsize_t(iobj);
1365++            Py_DECREF(iobj);
1366++        }
1367++        if (ival == -1 && PyErr_Occurred()) {
1368++            goto exit;
1369++        }
1370++        length = ival;
1371++    }
1372++    return_value = SHAKE_hexdigest_impl(self, length);
1373++
1374++exit:
1375++    return return_value;
1376++}
1377++
1378++PyDoc_STRVAR(SHAKE_copy__doc__,
1379++"copy($self, /)\n"
1380++"--\n"
1381++"\n"
1382++"Return a copy of the SHAKE object.");
1383++
1384++#define SHAKE_COPY_METHODDEF    \
1385++    {"copy", (PyCFunction)SHAKE_copy, METH_NOARGS, SHAKE_copy__doc__},
1386++
1387++static PyObject *
1388++SHAKE_copy_impl(SHAKE *self);
1389++
1390++static PyObject *
1391++SHAKE_copy(SHAKE *self, PyObject *Py_UNUSED(ignored))
1392++{
1393++    return SHAKE_copy_impl(self);
1394++}
1395++
1396++PyDoc_STRVAR(HMAC_copy__doc__,
1397++"copy($self, /)\n"
1398++"--\n"
1399++"\n"
1400++"Return a copy of the HMAC object.");
1401++
1402++#define HMAC_COPY_METHODDEF    \
1403++    {"copy", (PyCFunction)HMAC_copy, METH_NOARGS, HMAC_copy__doc__},
1404++
1405++static PyObject *
1406++HMAC_copy_impl(HMAC *self);
1407++
1408++static PyObject *
1409++HMAC_copy(HMAC *self, PyObject *Py_UNUSED(ignored))
1410++{
1411++    return HMAC_copy_impl(self);
1412++}
1413++
1414++PyDoc_STRVAR(HMAC_update__doc__,
1415++"update($self, data, /)\n"
1416++"--\n"
1417++"\n"
1418++"Update the HMAC object with data.");
1419++
1420++#define HMAC_UPDATE_METHODDEF    \
1421++    {"update", (PyCFunction)HMAC_update, METH_O, HMAC_update__doc__},
1422++
1423++static PyObject *
1424++HMAC_update_impl(HMAC *self, Py_buffer *data);
1425++
1426++static PyObject *
1427++HMAC_update(HMAC *self, PyObject *arg)
1428++{
1429++    PyObject *return_value = NULL;
1430++    Py_buffer data = {NULL, NULL};
1431++
1432++    if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
1433++        goto exit;
1434++    }
1435++    if (!PyBuffer_IsContiguous(&data, 'C')) {
1436++        _PyArg_BadArgument("update", "argument", "contiguous buffer", arg);
1437++        goto exit;
1438++    }
1439++    return_value = HMAC_update_impl(self, &data);
1440++
1441++exit:
1442++    /* Cleanup for data */
1443++    if (data.obj) {
1444++       PyBuffer_Release(&data);
1445++    }
1446++
1447++    return return_value;
1448++}
1449++
1450++PyDoc_STRVAR(HMAC_digest__doc__,
1451++"digest($self, /)\n"
1452++"--\n"
1453++"\n"
1454++"Return the digest of the bytes passed to the update() method so far.");
1455++
1456++#define HMAC_DIGEST_METHODDEF    \
1457++    {"digest", (PyCFunction)HMAC_digest, METH_NOARGS, HMAC_digest__doc__},
1458++
1459++static PyObject *
1460++HMAC_digest_impl(HMAC *self);
1461++
1462++static PyObject *
1463++HMAC_digest(HMAC *self, PyObject *Py_UNUSED(ignored))
1464++{
1465++    return HMAC_digest_impl(self);
1466++}
1467++
1468++PyDoc_STRVAR(HMAC_hexdigest__doc__,
1469++"hexdigest($self, /)\n"
1470++"--\n"
1471++"\n"
1472++"Return hexadecimal digest of the bytes passed to the update() method so far.\n"
1473++"\n"
1474++"This may be used to exchange the value safely in email or other non-binary\n"
1475++"environments.");
1476++
1477++#define HMAC_HEXDIGEST_METHODDEF    \
1478++    {"hexdigest", (PyCFunction)HMAC_hexdigest, METH_NOARGS, HMAC_hexdigest__doc__},
1479++
1480++static PyObject *
1481++HMAC_hexdigest_impl(HMAC *self);
1482++
1483++static PyObject *
1484++HMAC_hexdigest(HMAC *self, PyObject *Py_UNUSED(ignored))
1485++{
1486++    return HMAC_hexdigest_impl(self);
1487++}
1488++
1489++PyDoc_STRVAR(_hashlib_new__doc__,
1490++"new($module, /, name, string=None, *, usedforsecurity=True)\n"
1491++"--\n"
1492++"\n"
1493++"Return a new hash object using the named algorithm.\n"
1494++"\n"
1495++"An optional string argument may be provided and will be\n"
1496++"automatically hashed.\n"
1497++"\n"
1498++"The MD5 and SHA1 algorithms are always supported.");
1499++
1500++#define _HASHLIB_NEW_METHODDEF    \
1501++    {"new", (PyCFunction)(void(*)(void))_hashlib_new, METH_FASTCALL|METH_KEYWORDS, _hashlib_new__doc__},
1502++
1503++static PyObject *
1504++_hashlib_new_impl(PyObject *module, const char *name, Py_buffer *string,
1505++                  int usedforsecurity);
1506++
1507++static PyObject *
1508++_hashlib_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1509++{
1510++    PyObject *return_value = NULL;
1511++    static const char * const _keywords[] = {"name", "string", "usedforsecurity", NULL};
1512++    static _PyArg_Parser _parser = {NULL, _keywords, "new", 0};
1513++    PyObject *argsbuf[3];
1514++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1515++    const char *name;
1516++    Py_buffer string = {NULL, NULL};
1517++    int usedforsecurity = 1;
1518++
1519++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
1520++    if (!args) {
1521++        goto exit;
1522++    }
1523++    if (!PyUnicode_Check(args[0])) {
1524++        _PyArg_BadArgument("new", "argument 'name'", "str", args[0]);
1525++        goto exit;
1526++    }
1527++    Py_ssize_t name_length;
1528++    name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
1529++    if (name == NULL) {
1530++        goto exit;
1531++    }
1532++    if (strlen(name) != (size_t)name_length) {
1533++        PyErr_SetString(PyExc_ValueError, "embedded null character");
1534++        goto exit;
1535++    }
1536++    if (!noptargs) {
1537++        goto skip_optional_pos;
1538++    }
1539++    if (args[1]) {
1540++        if (PyObject_GetBuffer(args[1], &string, PyBUF_SIMPLE) != 0) {
1541++            goto exit;
1542++        }
1543++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1544++            _PyArg_BadArgument("new", "argument 'string'", "contiguous buffer", args[1]);
1545++            goto exit;
1546++        }
1547++        if (!--noptargs) {
1548++            goto skip_optional_pos;
1549++        }
1550++    }
1551++skip_optional_pos:
1552++    if (!noptargs) {
1553++        goto skip_optional_kwonly;
1554++    }
1555++    usedforsecurity = PyObject_IsTrue(args[2]);
1556++    if (usedforsecurity < 0) {
1557++        goto exit;
1558++    }
1559++skip_optional_kwonly:
1560++    return_value = _hashlib_new_impl(module, name, &string, usedforsecurity);
1561++
1562++exit:
1563++    /* Cleanup for string */
1564++    if (string.obj) {
1565++       PyBuffer_Release(&string);
1566++    }
1567++
1568++    return return_value;
1569++}
1570++
1571++PyDoc_STRVAR(_hashlib_openssl_md5__doc__,
1572++"openssl_md5($module, /, string=None, *, usedforsecurity=True)\n"
1573++"--\n"
1574++"\n"
1575++"Returns a md5 hash object; optionally initialized with a string.");
1576++
1577++#define _HASHLIB_OPENSSL_MD5_METHODDEF    \
1578++    {"openssl_md5", (PyCFunction)(void(*)(void))_hashlib_openssl_md5, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_md5__doc__},
1579++
1580++static PyObject *
1581++_hashlib_openssl_md5_impl(PyObject *module, Py_buffer *string,
1582++                          int usedforsecurity);
1583++
1584++static PyObject *
1585++_hashlib_openssl_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1586++{
1587++    PyObject *return_value = NULL;
1588++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1589++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_md5", 0};
1590++    PyObject *argsbuf[2];
1591++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1592++    Py_buffer string = {NULL, NULL};
1593++    int usedforsecurity = 1;
1594++
1595++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1596++    if (!args) {
1597++        goto exit;
1598++    }
1599++    if (!noptargs) {
1600++        goto skip_optional_pos;
1601++    }
1602++    if (args[0]) {
1603++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1604++            goto exit;
1605++        }
1606++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1607++            _PyArg_BadArgument("openssl_md5", "argument 'string'", "contiguous buffer", args[0]);
1608++            goto exit;
1609++        }
1610++        if (!--noptargs) {
1611++            goto skip_optional_pos;
1612++        }
1613++    }
1614++skip_optional_pos:
1615++    if (!noptargs) {
1616++        goto skip_optional_kwonly;
1617++    }
1618++    usedforsecurity = PyObject_IsTrue(args[1]);
1619++    if (usedforsecurity < 0) {
1620++        goto exit;
1621++    }
1622++skip_optional_kwonly:
1623++    return_value = _hashlib_openssl_md5_impl(module, &string, usedforsecurity);
1624++
1625++exit:
1626++    /* Cleanup for string */
1627++    if (string.obj) {
1628++       PyBuffer_Release(&string);
1629++    }
1630++
1631++    return return_value;
1632++}
1633++
1634++PyDoc_STRVAR(_hashlib_openssl_sha1__doc__,
1635++"openssl_sha1($module, /, string=None, *, usedforsecurity=True)\n"
1636++"--\n"
1637++"\n"
1638++"Returns a sha1 hash object; optionally initialized with a string.");
1639++
1640++#define _HASHLIB_OPENSSL_SHA1_METHODDEF    \
1641++    {"openssl_sha1", (PyCFunction)(void(*)(void))_hashlib_openssl_sha1, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha1__doc__},
1642++
1643++static PyObject *
1644++_hashlib_openssl_sha1_impl(PyObject *module, Py_buffer *string,
1645++                           int usedforsecurity);
1646++
1647++static PyObject *
1648++_hashlib_openssl_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1649++{
1650++    PyObject *return_value = NULL;
1651++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1652++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha1", 0};
1653++    PyObject *argsbuf[2];
1654++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1655++    Py_buffer string = {NULL, NULL};
1656++    int usedforsecurity = 1;
1657++
1658++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1659++    if (!args) {
1660++        goto exit;
1661++    }
1662++    if (!noptargs) {
1663++        goto skip_optional_pos;
1664++    }
1665++    if (args[0]) {
1666++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1667++            goto exit;
1668++        }
1669++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1670++            _PyArg_BadArgument("openssl_sha1", "argument 'string'", "contiguous buffer", args[0]);
1671++            goto exit;
1672++        }
1673++        if (!--noptargs) {
1674++            goto skip_optional_pos;
1675++        }
1676++    }
1677++skip_optional_pos:
1678++    if (!noptargs) {
1679++        goto skip_optional_kwonly;
1680++    }
1681++    usedforsecurity = PyObject_IsTrue(args[1]);
1682++    if (usedforsecurity < 0) {
1683++        goto exit;
1684++    }
1685++skip_optional_kwonly:
1686++    return_value = _hashlib_openssl_sha1_impl(module, &string, usedforsecurity);
1687++
1688++exit:
1689++    /* Cleanup for string */
1690++    if (string.obj) {
1691++       PyBuffer_Release(&string);
1692++    }
1693++
1694++    return return_value;
1695++}
1696++
1697++PyDoc_STRVAR(_hashlib_openssl_sha224__doc__,
1698++"openssl_sha224($module, /, string=None, *, usedforsecurity=True)\n"
1699++"--\n"
1700++"\n"
1701++"Returns a sha224 hash object; optionally initialized with a string.");
1702++
1703++#define _HASHLIB_OPENSSL_SHA224_METHODDEF    \
1704++    {"openssl_sha224", (PyCFunction)(void(*)(void))_hashlib_openssl_sha224, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha224__doc__},
1705++
1706++static PyObject *
1707++_hashlib_openssl_sha224_impl(PyObject *module, Py_buffer *string,
1708++                             int usedforsecurity);
1709++
1710++static PyObject *
1711++_hashlib_openssl_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1712++{
1713++    PyObject *return_value = NULL;
1714++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1715++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha224", 0};
1716++    PyObject *argsbuf[2];
1717++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1718++    Py_buffer string = {NULL, NULL};
1719++    int usedforsecurity = 1;
1720++
1721++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1722++    if (!args) {
1723++        goto exit;
1724++    }
1725++    if (!noptargs) {
1726++        goto skip_optional_pos;
1727++    }
1728++    if (args[0]) {
1729++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1730++            goto exit;
1731++        }
1732++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1733++            _PyArg_BadArgument("openssl_sha224", "argument 'string'", "contiguous buffer", args[0]);
1734++            goto exit;
1735++        }
1736++        if (!--noptargs) {
1737++            goto skip_optional_pos;
1738++        }
1739++    }
1740++skip_optional_pos:
1741++    if (!noptargs) {
1742++        goto skip_optional_kwonly;
1743++    }
1744++    usedforsecurity = PyObject_IsTrue(args[1]);
1745++    if (usedforsecurity < 0) {
1746++        goto exit;
1747++    }
1748++skip_optional_kwonly:
1749++    return_value = _hashlib_openssl_sha224_impl(module, &string, usedforsecurity);
1750++
1751++exit:
1752++    /* Cleanup for string */
1753++    if (string.obj) {
1754++       PyBuffer_Release(&string);
1755++    }
1756++
1757++    return return_value;
1758++}
1759++
1760++PyDoc_STRVAR(_hashlib_openssl_sha256__doc__,
1761++"openssl_sha256($module, /, string=None, *, usedforsecurity=True)\n"
1762++"--\n"
1763++"\n"
1764++"Returns a sha256 hash object; optionally initialized with a string.");
1765++
1766++#define _HASHLIB_OPENSSL_SHA256_METHODDEF    \
1767++    {"openssl_sha256", (PyCFunction)(void(*)(void))_hashlib_openssl_sha256, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha256__doc__},
1768++
1769++static PyObject *
1770++_hashlib_openssl_sha256_impl(PyObject *module, Py_buffer *string,
1771++                             int usedforsecurity);
1772++
1773++static PyObject *
1774++_hashlib_openssl_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1775++{
1776++    PyObject *return_value = NULL;
1777++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1778++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha256", 0};
1779++    PyObject *argsbuf[2];
1780++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1781++    Py_buffer string = {NULL, NULL};
1782++    int usedforsecurity = 1;
1783++
1784++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1785++    if (!args) {
1786++        goto exit;
1787++    }
1788++    if (!noptargs) {
1789++        goto skip_optional_pos;
1790++    }
1791++    if (args[0]) {
1792++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1793++            goto exit;
1794++        }
1795++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1796++            _PyArg_BadArgument("openssl_sha256", "argument 'string'", "contiguous buffer", args[0]);
1797++            goto exit;
1798++        }
1799++        if (!--noptargs) {
1800++            goto skip_optional_pos;
1801++        }
1802++    }
1803++skip_optional_pos:
1804++    if (!noptargs) {
1805++        goto skip_optional_kwonly;
1806++    }
1807++    usedforsecurity = PyObject_IsTrue(args[1]);
1808++    if (usedforsecurity < 0) {
1809++        goto exit;
1810++    }
1811++skip_optional_kwonly:
1812++    return_value = _hashlib_openssl_sha256_impl(module, &string, usedforsecurity);
1813++
1814++exit:
1815++    /* Cleanup for string */
1816++    if (string.obj) {
1817++       PyBuffer_Release(&string);
1818++    }
1819++
1820++    return return_value;
1821++}
1822++
1823++PyDoc_STRVAR(_hashlib_openssl_sha384__doc__,
1824++"openssl_sha384($module, /, string=None, *, usedforsecurity=True)\n"
1825++"--\n"
1826++"\n"
1827++"Returns a sha384 hash object; optionally initialized with a string.");
1828++
1829++#define _HASHLIB_OPENSSL_SHA384_METHODDEF    \
1830++    {"openssl_sha384", (PyCFunction)(void(*)(void))_hashlib_openssl_sha384, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha384__doc__},
1831++
1832++static PyObject *
1833++_hashlib_openssl_sha384_impl(PyObject *module, Py_buffer *string,
1834++                             int usedforsecurity);
1835++
1836++static PyObject *
1837++_hashlib_openssl_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1838++{
1839++    PyObject *return_value = NULL;
1840++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1841++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha384", 0};
1842++    PyObject *argsbuf[2];
1843++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1844++    Py_buffer string = {NULL, NULL};
1845++    int usedforsecurity = 1;
1846++
1847++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1848++    if (!args) {
1849++        goto exit;
1850++    }
1851++    if (!noptargs) {
1852++        goto skip_optional_pos;
1853++    }
1854++    if (args[0]) {
1855++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1856++            goto exit;
1857++        }
1858++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1859++            _PyArg_BadArgument("openssl_sha384", "argument 'string'", "contiguous buffer", args[0]);
1860++            goto exit;
1861++        }
1862++        if (!--noptargs) {
1863++            goto skip_optional_pos;
1864++        }
1865++    }
1866++skip_optional_pos:
1867++    if (!noptargs) {
1868++        goto skip_optional_kwonly;
1869++    }
1870++    usedforsecurity = PyObject_IsTrue(args[1]);
1871++    if (usedforsecurity < 0) {
1872++        goto exit;
1873++    }
1874++skip_optional_kwonly:
1875++    return_value = _hashlib_openssl_sha384_impl(module, &string, usedforsecurity);
1876++
1877++exit:
1878++    /* Cleanup for string */
1879++    if (string.obj) {
1880++       PyBuffer_Release(&string);
1881++    }
1882++
1883++    return return_value;
1884++}
1885++
1886++PyDoc_STRVAR(_hashlib_openssl_sha512__doc__,
1887++"openssl_sha512($module, /, string=None, *, usedforsecurity=True)\n"
1888++"--\n"
1889++"\n"
1890++"Returns a sha512 hash object; optionally initialized with a string.");
1891++
1892++#define _HASHLIB_OPENSSL_SHA512_METHODDEF    \
1893++    {"openssl_sha512", (PyCFunction)(void(*)(void))_hashlib_openssl_sha512, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha512__doc__},
1894++
1895++static PyObject *
1896++_hashlib_openssl_sha512_impl(PyObject *module, Py_buffer *string,
1897++                             int usedforsecurity);
1898++
1899++static PyObject *
1900++_hashlib_openssl_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1901++{
1902++    PyObject *return_value = NULL;
1903++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1904++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha512", 0};
1905++    PyObject *argsbuf[2];
1906++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1907++    Py_buffer string = {NULL, NULL};
1908++    int usedforsecurity = 1;
1909++
1910++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1911++    if (!args) {
1912++        goto exit;
1913++    }
1914++    if (!noptargs) {
1915++        goto skip_optional_pos;
1916++    }
1917++    if (args[0]) {
1918++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1919++            goto exit;
1920++        }
1921++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1922++            _PyArg_BadArgument("openssl_sha512", "argument 'string'", "contiguous buffer", args[0]);
1923++            goto exit;
1924++        }
1925++        if (!--noptargs) {
1926++            goto skip_optional_pos;
1927++        }
1928++    }
1929++skip_optional_pos:
1930++    if (!noptargs) {
1931++        goto skip_optional_kwonly;
1932++    }
1933++    usedforsecurity = PyObject_IsTrue(args[1]);
1934++    if (usedforsecurity < 0) {
1935++        goto exit;
1936++    }
1937++skip_optional_kwonly:
1938++    return_value = _hashlib_openssl_sha512_impl(module, &string, usedforsecurity);
1939++
1940++exit:
1941++    /* Cleanup for string */
1942++    if (string.obj) {
1943++       PyBuffer_Release(&string);
1944++    }
1945++
1946++    return return_value;
1947++}
1948++
1949++PyDoc_STRVAR(_hashlib_openssl_shake_128__doc__,
1950++"openssl_shake_128($module, /, string=None, *, usedforsecurity=True)\n"
1951++"--\n"
1952++"\n"
1953++"Returns a shake-128 variable hash object; optionally initialized with a string.");
1954++
1955++#define _HASHLIB_OPENSSL_SHAKE_128_METHODDEF    \
1956++    {"openssl_shake_128", (PyCFunction)(void(*)(void))_hashlib_openssl_shake_128, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_128__doc__},
1957++
1958++static PyObject *
1959++_hashlib_openssl_shake_128_impl(PyObject *module, Py_buffer *string,
1960++                                int usedforsecurity);
1961++
1962++static PyObject *
1963++_hashlib_openssl_shake_128(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1964++{
1965++    PyObject *return_value = NULL;
1966++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1967++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_shake_128", 0};
1968++    PyObject *argsbuf[2];
1969++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1970++    Py_buffer string = {NULL, NULL};
1971++    int usedforsecurity = 1;
1972++
1973++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1974++    if (!args) {
1975++        goto exit;
1976++    }
1977++    if (!noptargs) {
1978++        goto skip_optional_pos;
1979++    }
1980++    if (args[0]) {
1981++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1982++            goto exit;
1983++        }
1984++        if (!PyBuffer_IsContiguous(&string, 'C')) {
1985++            _PyArg_BadArgument("openssl_shake_128", "argument 'string'", "contiguous buffer", args[0]);
1986++            goto exit;
1987++        }
1988++        if (!--noptargs) {
1989++            goto skip_optional_pos;
1990++        }
1991++    }
1992++skip_optional_pos:
1993++    if (!noptargs) {
1994++        goto skip_optional_kwonly;
1995++    }
1996++    usedforsecurity = PyObject_IsTrue(args[1]);
1997++    if (usedforsecurity < 0) {
1998++        goto exit;
1999++    }
2000++skip_optional_kwonly:
2001++    return_value = _hashlib_openssl_shake_128_impl(module, &string, usedforsecurity);
2002++
2003++exit:
2004++    /* Cleanup for string */
2005++    if (string.obj) {
2006++       PyBuffer_Release(&string);
2007++    }
2008++
2009++    return return_value;
2010++}
2011++
2012++PyDoc_STRVAR(_hashlib_openssl_shake_256__doc__,
2013++"openssl_shake_256($module, /, string=None, *, usedforsecurity=True)\n"
2014++"--\n"
2015++"\n"
2016++"Returns a shake-256 variable hash object; optionally initialized with a string.");
2017++
2018++#define _HASHLIB_OPENSSL_SHAKE_256_METHODDEF    \
2019++    {"openssl_shake_256", (PyCFunction)(void(*)(void))_hashlib_openssl_shake_256, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_256__doc__},
2020++
2021++static PyObject *
2022++_hashlib_openssl_shake_256_impl(PyObject *module, Py_buffer *string,
2023++                                int usedforsecurity);
2024++
2025++static PyObject *
2026++_hashlib_openssl_shake_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2027++{
2028++    PyObject *return_value = NULL;
2029++    static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
2030++    static _PyArg_Parser _parser = {NULL, _keywords, "openssl_shake_256", 0};
2031++    PyObject *argsbuf[2];
2032++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
2033++    Py_buffer string = {NULL, NULL};
2034++    int usedforsecurity = 1;
2035++
2036++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
2037++    if (!args) {
2038++        goto exit;
2039++    }
2040++    if (!noptargs) {
2041++        goto skip_optional_pos;
2042++    }
2043++    if (args[0]) {
2044++        if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
2045++            goto exit;
2046++        }
2047++        if (!PyBuffer_IsContiguous(&string, 'C')) {
2048++            _PyArg_BadArgument("openssl_shake_256", "argument 'string'", "contiguous buffer", args[0]);
2049++            goto exit;
2050++        }
2051++        if (!--noptargs) {
2052++            goto skip_optional_pos;
2053++        }
2054++    }
2055++skip_optional_pos:
2056++    if (!noptargs) {
2057++        goto skip_optional_kwonly;
2058++    }
2059++    usedforsecurity = PyObject_IsTrue(args[1]);
2060++    if (usedforsecurity < 0) {
2061++        goto exit;
2062++    }
2063++skip_optional_kwonly:
2064++    return_value = _hashlib_openssl_shake_256_impl(module, &string, usedforsecurity);
2065++
2066++exit:
2067++    /* Cleanup for string */
2068++    if (string.obj) {
2069++       PyBuffer_Release(&string);
2070++    }
2071++
2072++    return return_value;
2073++}
2074++
2075++PyDoc_STRVAR(_hashlib_compare_digest__doc__,
2076++"compare_digest($module, a, b, /)\n"
2077++"--\n"
2078++"\n"
2079++"Return \'a == b\'.\n"
2080++"\n"
2081++"This function uses an approach designed to prevent\n"
2082++"timing analysis, making it appropriate for cryptography.\n"
2083++"\n"
2084++"a and b must both be of the same type: either str (ASCII only),\n"
2085++"or any bytes-like object.\n"
2086++"\n"
2087++"Note: If a and b are of different lengths, or if an error occurs,\n"
2088++"a timing attack could theoretically reveal information about the\n"
2089++"types and lengths of a and b--but not their values.");
2090++
2091++#define _HASHLIB_COMPARE_DIGEST_METHODDEF    \
2092++    {"compare_digest", (PyCFunction)(void(*)(void))_hashlib_compare_digest, METH_FASTCALL, _hashlib_compare_digest__doc__},
2093++
2094++static PyObject *
2095++_hashlib_compare_digest_impl(PyObject *module, PyObject *a, PyObject *b);
2096++
2097++static PyObject *
2098++_hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2099++{
2100++    PyObject *return_value = NULL;
2101++    PyObject *a;
2102++    PyObject *b;
2103++
2104++    if (!_PyArg_CheckPositional("compare_digest", nargs, 2, 2)) {
2105++        goto exit;
2106++    }
2107++    a = args[0];
2108++    b = args[1];
2109++    return_value = _hashlib_compare_digest_impl(module, a, b);
2110++
2111++exit:
2112++    return return_value;
2113++}
2114++
2115++PyDoc_STRVAR(_hashlib_hmac_singleshot__doc__,
2116++"hmac_digest($module, /, key, msg, digest)\n"
2117++"--\n"
2118++"\n"
2119++"Single-shot HMAC.");
2120++
2121++#define _HASHLIB_HMAC_SINGLESHOT_METHODDEF    \
2122++    {"hmac_digest", (PyCFunction)(void(*)(void))_hashlib_hmac_singleshot, METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_singleshot__doc__},
2123++
2124++static PyObject *
2125++_hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key,
2126++                              Py_buffer *msg, const char *digest);
2127++
2128++static PyObject *
2129++_hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2130++{
2131++    PyObject *return_value = NULL;
2132++    static const char * const _keywords[] = {"key", "msg", "digest", NULL};
2133++    static _PyArg_Parser _parser = {NULL, _keywords, "hmac_digest", 0};
2134++    PyObject *argsbuf[3];
2135++    Py_buffer key = {NULL, NULL};
2136++    Py_buffer msg = {NULL, NULL};
2137++    const char *digest;
2138++
2139++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
2140++    if (!args) {
2141++        goto exit;
2142++    }
2143++    if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
2144++        goto exit;
2145++    }
2146++    if (!PyBuffer_IsContiguous(&key, 'C')) {
2147++        _PyArg_BadArgument("hmac_digest", "argument 'key'", "contiguous buffer", args[0]);
2148++        goto exit;
2149++    }
2150++    if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) {
2151++        goto exit;
2152++    }
2153++    if (!PyBuffer_IsContiguous(&msg, 'C')) {
2154++        _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]);
2155++        goto exit;
2156++    }
2157++    if (!PyUnicode_Check(args[2])) {
2158++        _PyArg_BadArgument("hmac_digest", "argument 'digest'", "str", args[2]);
2159++        goto exit;
2160++    }
2161++    Py_ssize_t digest_length;
2162++    digest = PyUnicode_AsUTF8AndSize(args[2], &digest_length);
2163++    if (digest == NULL) {
2164++        goto exit;
2165++    }
2166++    if (strlen(digest) != (size_t)digest_length) {
2167++        PyErr_SetString(PyExc_ValueError, "embedded null character");
2168++        goto exit;
2169++    }
2170++    return_value = _hashlib_hmac_singleshot_impl(module, &key, &msg, digest);
2171++
2172++exit:
2173++    /* Cleanup for key */
2174++    if (key.obj) {
2175++       PyBuffer_Release(&key);
2176++    }
2177++    /* Cleanup for msg */
2178++    if (msg.obj) {
2179++       PyBuffer_Release(&msg);
2180++    }
2181++
2182++    return return_value;
2183++}
2184++
2185++PyDoc_STRVAR(_hashlib_hmac_new__doc__,
2186++"hmac_new($module, /, key, msg=None, digestmod=None)\n"
2187++"--\n"
2188++"\n"
2189++"Return a new hmac object.");
2190++
2191++#define _HASHLIB_HMAC_NEW_METHODDEF    \
2192++    {"hmac_new", (PyCFunction)(void(*)(void))_hashlib_hmac_new, METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_new__doc__},
2193++
2194++static PyObject *
2195++_hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, Py_buffer *msg,
2196++                       const char *digestmod);
2197++
2198++static PyObject *
2199++_hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2200++{
2201++    PyObject *return_value = NULL;
2202++    static const char * const _keywords[] = {"key", "msg", "digestmod", NULL};
2203++    static _PyArg_Parser _parser = {NULL, _keywords, "hmac_new", 0};
2204++    PyObject *argsbuf[3];
2205++    Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2206++    Py_buffer key = {NULL, NULL};
2207++    Py_buffer msg = {NULL, NULL};
2208++    const char *digestmod = NULL;
2209++
2210++    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
2211++    if (!args) {
2212++        goto exit;
2213++    }
2214++    if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
2215++        goto exit;
2216++    }
2217++    if (!PyBuffer_IsContiguous(&key, 'C')) {
2218++        _PyArg_BadArgument("hmac_new", "argument 'key'", "contiguous buffer", args[0]);
2219++        goto exit;
2220++    }
2221++    if (!noptargs) {
2222++        goto skip_optional_pos;
2223++    }
2224++    if (args[1]) {
2225++        if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) {
2226++            goto exit;
2227++        }
2228++        if (!PyBuffer_IsContiguous(&msg, 'C')) {
2229++            _PyArg_BadArgument("hmac_new", "argument 'msg'", "contiguous buffer", args[1]);
2230++            goto exit;
2231++        }
2232++        if (!--noptargs) {
2233++            goto skip_optional_pos;
2234++        }
2235++    }
2236++    if (!PyUnicode_Check(args[2])) {
2237++        _PyArg_BadArgument("hmac_new", "argument 'digestmod'", "str", args[2]);
2238++        goto exit;
2239++    }
2240++    Py_ssize_t digestmod_length;
2241++    digestmod = PyUnicode_AsUTF8AndSize(args[2], &digestmod_length);
2242++    if (digestmod == NULL) {
2243++        goto exit;
2244++    }
2245++    if (strlen(digestmod) != (size_t)digestmod_length) {
2246++        PyErr_SetString(PyExc_ValueError, "embedded null character");
2247++        goto exit;
2248++    }
2249++skip_optional_pos:
2250++    return_value = _hashlib_hmac_new_impl(module, &key, &msg, digestmod);
2251++
2252++exit:
2253++    /* Cleanup for key */
2254++    if (key.obj) {
2255++       PyBuffer_Release(&key);
2256++    }
2257++    /* Cleanup for msg */
2258++    if (msg.obj) {
2259++       PyBuffer_Release(&msg);
2260++    }
2261++
2262++    return return_value;
2263++}
2264++/*[clinic end generated code: output=b4705bad5ece43e9 input=a9049054013a1b77]*/
2265+-- 
2266+2.32.0
2267+
+403, -0
  1@@ -0,0 +1,403 @@
  2+From 308e4f113891bea997bcac7e7e48a18956478265 Mon Sep 17 00:00:00 2001
  3+From: Michael Forney <mforney@mforney.org>
  4+Date: Tue, 5 Oct 2021 14:44:43 -0700
  5+Subject: [PATCH] Re-add support for libressl
  6+
  7+---
  8+ Modules/_hashopenssl.c          |  4 +++
  9+ Modules/_ssl.c                  | 58 +++++++++++++++++++++------------
 10+ Modules/_ssl/debughelpers.c     |  4 +++
 11+ Modules/clinic/_hashopenssl.c.h | 10 +++++-
 12+ Modules/clinic/_ssl.c.h         | 28 ++++++++++++----
 13+ 5 files changed, 77 insertions(+), 27 deletions(-)
 14+
 15+diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
 16+index b9e68c05c3..75eb76266a 100644
 17+--- a/Modules/_hashopenssl.c
 18++++ b/Modules/_hashopenssl.c
 19+@@ -40,10 +40,12 @@
 20+ 
 21+ #define MUNCH_SIZE INT_MAX
 22+ 
 23++#ifndef LIBRESSL_VERSION_NUMBER
 24+ #define PY_OPENSSL_HAS_SCRYPT 1
 25+ #define PY_OPENSSL_HAS_SHA3 1
 26+ #define PY_OPENSSL_HAS_SHAKE 1
 27+ #define PY_OPENSSL_HAS_BLAKE2 1
 28++#endif
 29+ 
 30+ static PyModuleDef _hashlibmodule;
 31+ 
 32+@@ -1794,6 +1796,7 @@ hashlib_md_meth_names(PyObject *module)
 33+     return 0;
 34+ }
 35+ 
 36++#ifndef LIBRESSL_VERSION_NUMBER
 37+ /*[clinic input]
 38+ _hashlib.get_fips_mode -> int
 39+ 
 40+@@ -1831,6 +1834,7 @@ _hashlib_get_fips_mode_impl(PyObject *module)
 41+     return result;
 42+ #endif
 43+ }
 44++#endif
 45+ 
 46+ 
 47+ static int
 48+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
 49+index 6c63301b2a..d8a70d5511 100644
 50+--- a/Modules/_ssl.c
 51++++ b/Modules/_ssl.c
 52+@@ -291,8 +291,10 @@ typedef struct {
 53+     int post_handshake_auth;
 54+ #endif
 55+     PyObject *msg_cb;
 56++#ifndef LIBRESSL_VERSION_NUMBER
 57+     PyObject *keylog_filename;
 58+     BIO *keylog_bio;
 59++#endif
 60+     /* Cached module state, also used in SSLSocket and SSLSession code. */
 61+     _sslmodulestate *state;
 62+ } PySSLContext;
 63+@@ -1829,6 +1831,7 @@ _ssl__SSLSocket_getpeercert_impl(PySSLSocket *self, int binary_mode)
 64+     return result;
 65+ }
 66+ 
 67++#ifndef LIBRESSL_VERSION_NUMBER
 68+ /*[clinic input]
 69+ _ssl._SSLSocket.get_verified_chain
 70+ 
 71+@@ -1892,6 +1895,7 @@ _ssl__SSLSocket_get_unverified_chain_impl(PySSLSocket *self)
 72+     }
 73+     return retval;
 74+ }
 75++#endif
 76+ 
 77+ static PyObject *
 78+ cipher_to_tuple(const SSL_CIPHER *cipher)
 79+@@ -2298,8 +2302,7 @@ static PyObject *
 80+ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)
 81+ /*[clinic end generated code: output=aa7a6be5527358d8 input=77262d994fe5100a]*/
 82+ {
 83+-    size_t count = 0;
 84+-    int retval;
 85++    int len;
 86+     int sockstate;
 87+     _PySSLError err;
 88+     int nonblocking;
 89+@@ -2317,6 +2320,12 @@ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)
 90+         Py_INCREF(sock);
 91+     }
 92+ 
 93++    if (b->len > INT_MAX) {
 94++        PyErr_Format(PyExc_OverflowError,
 95++                     "string longer than %d bytes", INT_MAX);
 96++        goto error;
 97++    }
 98++
 99+     if (sock != NULL) {
100+         /* just in case the blocking state of the socket has been changed */
101+         nonblocking = (sock->sock_timeout >= 0);
102+@@ -2346,8 +2355,8 @@ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)
103+ 
104+     do {
105+         PySSL_BEGIN_ALLOW_THREADS
106+-        retval = SSL_write_ex(self->ssl, b->buf, (size_t)b->len, &count);
107+-        err = _PySSL_errno(retval == 0, self->ssl, retval);
108++        len = SSL_write(self->ssl, b->buf, (int)b->len);
109++        err = _PySSL_errno(len <= 0, self->ssl, len);
110+         PySSL_END_ALLOW_THREADS
111+         self->err = err;
112+ 
113+@@ -2380,11 +2389,11 @@ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)
114+              err.ssl == SSL_ERROR_WANT_WRITE);
115+ 
116+     Py_XDECREF(sock);
117+-    if (retval == 0)
118+-        return PySSL_SetError(self, retval, __FILE__, __LINE__);
119++    if (len <= 0)
120++        return PySSL_SetError(self, len, __FILE__, __LINE__);
121+     if (PySSL_ChainExceptions(self) < 0)
122+         return NULL;
123+-    return PyLong_FromSize_t(count);
124++    return PyLong_FromLong(len);
125+ error:
126+     Py_XDECREF(sock);
127+     PySSL_ChainExceptions(self);
128+@@ -2418,7 +2427,7 @@ _ssl__SSLSocket_pending_impl(PySSLSocket *self)
129+ 
130+ /*[clinic input]
131+ _ssl._SSLSocket.read
132+-    size as len: Py_ssize_t
133++    size as len: int
134+     [
135+     buffer: Py_buffer(accept={rwbuffer})
136+     ]
137+@@ -2428,14 +2437,13 @@ Read up to size bytes from the SSL socket.
138+ [clinic start generated code]*/
139+ 
140+ static PyObject *
141+-_ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
142+-                          int group_right_1, Py_buffer *buffer)
143+-/*[clinic end generated code: output=49b16e6406023734 input=ec48bf622be1c4a1]*/
144++_ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
145++                          Py_buffer *buffer)
146++/*[clinic end generated code: output=00097776cec2a0af input=ff157eb918d0905b]*/
147+ {
148+     PyObject *dest = NULL;
149+     char *mem;
150+-    size_t count = 0;
151+-    int retval;
152++    int count;
153+     int sockstate;
154+     _PySSLError err;
155+     int nonblocking;
156+@@ -2498,8 +2506,8 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
157+ 
158+     do {
159+         PySSL_BEGIN_ALLOW_THREADS
160+-        retval = SSL_read_ex(self->ssl, mem, (size_t)len, &count);
161+-        err = _PySSL_errno(retval == 0, self->ssl, retval);
162++        count = SSL_read(self->ssl, mem, len);
163++        err = _PySSL_errno(count <= 0, self->ssl, count);
164+         PySSL_END_ALLOW_THREADS
165+         self->err = err;
166+ 
167+@@ -2532,8 +2540,8 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
168+     } while (err.ssl == SSL_ERROR_WANT_READ ||
169+              err.ssl == SSL_ERROR_WANT_WRITE);
170+ 
171+-    if (retval == 0) {
172+-        PySSL_SetError(self, retval, __FILE__, __LINE__);
173++    if (count <= 0) {
174++        PySSL_SetError(self, count, __FILE__, __LINE__);
175+         goto error;
176+     }
177+     if (self->exc_type != NULL)
178+@@ -2546,7 +2554,7 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
179+         return dest;
180+     }
181+     else {
182+-        return PyLong_FromSize_t(count);
183++        return PyLong_FromLong(count);
184+     }
185+ 
186+ error:
187+@@ -3062,8 +3070,10 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
188+     self->hostflags = X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;
189+     self->protocol = proto_version;
190+     self->msg_cb = NULL;
191++#ifndef LIBRESSL_VERSION_NUMBER
192+     self->keylog_filename = NULL;
193+     self->keylog_bio = NULL;
194++#endif
195+     self->alpn_protocols = NULL;
196+     self->set_sni_cb = NULL;
197+     self->state = get_ssl_state(module);
198+@@ -3187,6 +3197,7 @@ context_clear(PySSLContext *self)
199+ {
200+     Py_CLEAR(self->set_sni_cb);
201+     Py_CLEAR(self->msg_cb);
202++#ifndef LIBRESSL_VERSION_NUMBER
203+     Py_CLEAR(self->keylog_filename);
204+     if (self->keylog_bio != NULL) {
205+         PySSL_BEGIN_ALLOW_THREADS
206+@@ -3194,6 +3205,7 @@ context_clear(PySSLContext *self)
207+         PySSL_END_ALLOW_THREADS
208+         self->keylog_bio = NULL;
209+     }
210++#endif
211+     return 0;
212+ }
213+ 
214+@@ -3535,7 +3547,7 @@ set_maximum_version(PySSLContext *self, PyObject *arg, void *c)
215+     return set_min_max_proto_version(self, arg, 1);
216+ }
217+ 
218+-#ifdef TLS1_3_VERSION
219++#if defined(TLS1_3_VERSION) && !defined(LIBRESSL_VERSION_NUMBER)
220+ static PyObject *
221+ get_num_tickets(PySSLContext *self, void *c)
222+ {
223+@@ -3568,12 +3580,14 @@ PyDoc_STRVAR(PySSLContext_num_tickets_doc,
224+ "Control the number of TLSv1.3 session tickets");
225+ #endif /* TLS1_3_VERSION */
226+ 
227++#ifndef LIBRESSL_VERSION_NUMBER
228+ static PyObject *
229+ get_security_level(PySSLContext *self, void *c)
230+ {
231+     return PyLong_FromLong(SSL_CTX_get_security_level(self->ctx));
232+ }
233+ PyDoc_STRVAR(PySSLContext_security_level_doc, "The current security level");
234++#endif
235+ 
236+ static PyObject *
237+ get_options(PySSLContext *self, void *c)
238+@@ -4603,13 +4617,15 @@ static PyGetSetDef context_getsetlist[] = {
239+                         (setter) set_minimum_version, NULL},
240+     {"maximum_version", (getter) get_maximum_version,
241+                         (setter) set_maximum_version, NULL},
242++#ifndef LIBRESSL_VERSION_NUMBER
243+     {"keylog_filename", (getter) _PySSLContext_get_keylog_filename,
244+                         (setter) _PySSLContext_set_keylog_filename, NULL},
245++#endif
246+     {"_msg_callback", (getter) _PySSLContext_get_msg_callback,
247+                       (setter) _PySSLContext_set_msg_callback, NULL},
248+     {"sni_callback", (getter) get_sni_callback,
249+                      (setter) set_sni_callback, PySSLContext_sni_callback_doc},
250+-#ifdef TLS1_3_VERSION
251++#if defined(TLS1_3_VERSION) && !defined(LIBRESSL_VERSION_NUMBER)
252+     {"num_tickets", (getter) get_num_tickets,
253+                     (setter) set_num_tickets, PySSLContext_num_tickets_doc},
254+ #endif
255+@@ -4628,8 +4644,10 @@ static PyGetSetDef context_getsetlist[] = {
256+                      (setter) set_verify_flags, NULL},
257+     {"verify_mode", (getter) get_verify_mode,
258+                     (setter) set_verify_mode, NULL},
259++#ifndef LIBRESSL_VERSION_NUMBER
260+     {"security_level", (getter) get_security_level,
261+                        NULL, PySSLContext_security_level_doc},
262++#endif
263+     {NULL},            /* sentinel */
264+ };
265+ 
266+diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c
267+index 03c125eb44..d992c5bc02 100644
268+--- a/Modules/_ssl/debughelpers.c
269++++ b/Modules/_ssl/debughelpers.c
270+@@ -114,6 +114,8 @@ _PySSLContext_set_msg_callback(PySSLContext *self, PyObject *arg, void *c) {
271+     return 0;
272+ }
273+ 
274++#ifndef LIBRESSL_VERSION_NUMBER
275++
276+ static void
277+ _PySSL_keylog_callback(const SSL *ssl, const char *line)
278+ {
279+@@ -217,3 +219,5 @@ _PySSLContext_set_keylog_filename(PySSLContext *self, PyObject *arg, void *c) {
280+     SSL_CTX_set_keylog_callback(self->ctx, _PySSL_keylog_callback);
281+     return 0;
282+ }
283++
284++#endif
285+diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h
286+index de01489e6a..c686eddea8 100644
287+--- a/Modules/clinic/_hashopenssl.c.h
288++++ b/Modules/clinic/_hashopenssl.c.h
289+@@ -1275,6 +1275,8 @@ _hashlib_HMAC_hexdigest(HMACobject *self, PyObject *Py_UNUSED(ignored))
290+     return _hashlib_HMAC_hexdigest_impl(self);
291+ }
292+ 
293++#if !defined(LIBRESSL_VERSION_NUMBER)
294++
295+ PyDoc_STRVAR(_hashlib_get_fips_mode__doc__,
296+ "get_fips_mode($module, /)\n"
297+ "--\n"
298+@@ -1310,6 +1312,8 @@ _hashlib_get_fips_mode(PyObject *module, PyObject *Py_UNUSED(ignored))
299+     return return_value;
300+ }
301+ 
302++#endif /* !defined(LIBRESSL_VERSION_NUMBER) */
303++
304+ PyDoc_STRVAR(_hashlib_compare_digest__doc__,
305+ "compare_digest($module, a, b, /)\n"
306+ "--\n"
307+@@ -1385,4 +1389,8 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg
308+ #ifndef _HASHLIB_SCRYPT_METHODDEF
309+     #define _HASHLIB_SCRYPT_METHODDEF
310+ #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
311+-/*[clinic end generated code: output=162369cb9d43f1cc input=a9049054013a1b77]*/
312++
313++#ifndef _HASHLIB_GET_FIPS_MODE_METHODDEF
314++    #define _HASHLIB_GET_FIPS_MODE_METHODDEF
315++#endif /* !defined(_HASHLIB_GET_FIPS_MODE_METHODDEF) */
316++/*[clinic end generated code: output=a110f274fb33395d input=a9049054013a1b77]*/
317+diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h
318+index b59b129af8..f6bcd09e03 100644
319+--- a/Modules/clinic/_ssl.c.h
320++++ b/Modules/clinic/_ssl.c.h
321+@@ -88,6 +88,8 @@ _ssl__SSLSocket_getpeercert(PySSLSocket *self, PyObject *const *args, Py_ssize_t
322+     return return_value;
323+ }
324+ 
325++#if !defined(LIBRESSL_VERSION_NUMBER)
326++
327+ PyDoc_STRVAR(_ssl__SSLSocket_get_verified_chain__doc__,
328+ "get_verified_chain($self, /)\n"
329+ "--\n"
330+@@ -105,6 +107,10 @@ _ssl__SSLSocket_get_verified_chain(PySSLSocket *self, PyObject *Py_UNUSED(ignore
331+     return _ssl__SSLSocket_get_verified_chain_impl(self);
332+ }
333+ 
334++#endif /* !defined(LIBRESSL_VERSION_NUMBER) */
335++
336++#if !defined(LIBRESSL_VERSION_NUMBER)
337++
338+ PyDoc_STRVAR(_ssl__SSLSocket_get_unverified_chain__doc__,
339+ "get_unverified_chain($self, /)\n"
340+ "--\n"
341+@@ -122,6 +128,8 @@ _ssl__SSLSocket_get_unverified_chain(PySSLSocket *self, PyObject *Py_UNUSED(igno
342+     return _ssl__SSLSocket_get_unverified_chain_impl(self);
343+ }
344+ 
345++#endif /* !defined(LIBRESSL_VERSION_NUMBER) */
346++
347+ PyDoc_STRVAR(_ssl__SSLSocket_shared_ciphers__doc__,
348+ "shared_ciphers($self, /)\n"
349+ "--\n"
350+@@ -271,25 +279,25 @@ PyDoc_STRVAR(_ssl__SSLSocket_read__doc__,
351+     {"read", (PyCFunction)_ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__},
352+ 
353+ static PyObject *
354+-_ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
355+-                          int group_right_1, Py_buffer *buffer);
356++_ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
357++                          Py_buffer *buffer);
358+ 
359+ static PyObject *
360+ _ssl__SSLSocket_read(PySSLSocket *self, PyObject *args)
361+ {
362+     PyObject *return_value = NULL;
363+-    Py_ssize_t len;
364++    int len;
365+     int group_right_1 = 0;
366+     Py_buffer buffer = {NULL, NULL};
367+ 
368+     switch (PyTuple_GET_SIZE(args)) {
369+         case 1:
370+-            if (!PyArg_ParseTuple(args, "n:read", &len)) {
371++            if (!PyArg_ParseTuple(args, "i:read", &len)) {
372+                 goto exit;
373+             }
374+             break;
375+         case 2:
376+-            if (!PyArg_ParseTuple(args, "nw*:read", &len, &buffer)) {
377++            if (!PyArg_ParseTuple(args, "iw*:read", &len, &buffer)) {
378+                 goto exit;
379+             }
380+             group_right_1 = 1;
381+@@ -1351,6 +1359,14 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje
382+ 
383+ #endif /* defined(_MSC_VER) */
384+ 
385++#ifndef _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF
386++    #define _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF
387++#endif /* !defined(_SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF) */
388++
389++#ifndef _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF
390++    #define _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF
391++#endif /* !defined(_SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF) */
392++
393+ #ifndef _SSL_ENUM_CERTIFICATES_METHODDEF
394+     #define _SSL_ENUM_CERTIFICATES_METHODDEF
395+ #endif /* !defined(_SSL_ENUM_CERTIFICATES_METHODDEF) */
396+@@ -1358,4 +1374,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje
397+ #ifndef _SSL_ENUM_CRLS_METHODDEF
398+     #define _SSL_ENUM_CRLS_METHODDEF
399+ #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
400+-/*[clinic end generated code: output=5a7d7bf5cf8ee092 input=a9049054013a1b77]*/
401++/*[clinic end generated code: output=0e12e5e4ee2221b5 input=a9049054013a1b77]*/
402+-- 
403+2.32.0
404+
+564, -0
  1@@ -0,0 +1,564 @@
  2+#ifndef Py_PYCONFIG_H
  3+#define Py_PYCONFIG_H
  4+/* #undef AC_APPLE_UNIVERSAL_BUILD */
  5+/* #undef AIX_BUILDDATE */
  6+/* #undef AIX_GENUINE_CPLUSPLUS */
  7+#define ALIGNOF_LONG 8
  8+#define ALIGNOF_SIZE_T 8
  9+/* #undef ALT_SOABI */
 10+/* #undef ANDROID_API_LEVEL */
 11+/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
 12+/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
 13+#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
 14+#define ENABLE_IPV6 1
 15+/* #undef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS */
 16+/* #undef FLOAT_WORDS_BIGENDIAN */
 17+/* #undef FLOCK_NEEDS_LIBBSD */
 18+/* #undef GETPGRP_HAVE_ARG */
 19+#define HAVE_ACCEPT4 1
 20+#define HAVE_ACOSH 1
 21+#define HAVE_ADDRINFO 1
 22+#define HAVE_ALARM 1
 23+/* #undef HAVE_ALIGNED_REQUIRED */
 24+#define HAVE_ALLOCA_H 1
 25+/* #undef HAVE_ALTZONE */
 26+#define HAVE_ASINH 1
 27+#define HAVE_ASM_TYPES_H 1
 28+#define HAVE_ATANH 1
 29+#define HAVE_BIND_TEXTDOMAIN_CODESET 1
 30+/* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
 31+/* #undef HAVE_BLUETOOTH_H */
 32+/* #undef HAVE_BROKEN_MBSTOWCS */
 33+/* #undef HAVE_BROKEN_NICE */
 34+/* #undef HAVE_BROKEN_PIPE_BUF */
 35+/* #undef HAVE_BROKEN_POLL */
 36+/* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
 37+/* #undef HAVE_BROKEN_PTHREAD_SIGMASK */
 38+/* #undef HAVE_BROKEN_SEM_GETVALUE */
 39+/* #undef HAVE_BROKEN_UNSETENV */
 40+#define HAVE_BUILTIN_ATOMIC 1
 41+/* #undef HAVE_CHFLAGS */
 42+#define HAVE_CHOWN 1
 43+#define HAVE_CHROOT 1
 44+#define HAVE_CLOCK 1
 45+#define HAVE_CLOCK_GETRES 1
 46+#define HAVE_CLOCK_GETTIME 1
 47+#define HAVE_CLOCK_SETTIME 1
 48+/* #undef HAVE_CLOSE_RANGE */
 49+#define HAVE_COMPUTED_GOTOS 1
 50+#define HAVE_CONFSTR 1
 51+/* #undef HAVE_CONIO_H */
 52+#define HAVE_COPYSIGN 1
 53+#define HAVE_COPY_FILE_RANGE 1
 54+#define HAVE_CRYPT_H 1
 55+#define HAVE_CRYPT_R 1
 56+#define HAVE_CTERMID 1
 57+/* #undef HAVE_CTERMID_R */
 58+/* #undef HAVE_CURSES_FILTER */
 59+/* #undef HAVE_CURSES_H */
 60+/* #undef HAVE_CURSES_HAS_KEY */
 61+/* #undef HAVE_CURSES_IMMEDOK */
 62+/* #undef HAVE_CURSES_IS_PAD */
 63+/* #undef HAVE_CURSES_IS_TERM_RESIZED */
 64+/* #undef HAVE_CURSES_RESIZETERM */
 65+/* #undef HAVE_CURSES_RESIZE_TERM */
 66+/* #undef HAVE_CURSES_SYNCOK */
 67+/* #undef HAVE_CURSES_TYPEAHEAD */
 68+/* #undef HAVE_CURSES_USE_ENV */
 69+/* #undef HAVE_CURSES_WCHGAT */
 70+#define HAVE_DECL_ISFINITE 1
 71+#define HAVE_DECL_ISINF 1
 72+#define HAVE_DECL_ISNAN 1
 73+#define HAVE_DECL_RTLD_DEEPBIND 0
 74+#define HAVE_DECL_RTLD_GLOBAL 1
 75+#define HAVE_DECL_RTLD_LAZY 1
 76+#define HAVE_DECL_RTLD_LOCAL 1
 77+#define HAVE_DECL_RTLD_MEMBER 0
 78+#define HAVE_DECL_RTLD_NODELETE 1
 79+#define HAVE_DECL_RTLD_NOLOAD 1
 80+#define HAVE_DECL_RTLD_NOW 1
 81+/* #undef HAVE_DECL_TZNAME */
 82+#define HAVE_DEVICE_MACROS 1
 83+/* #undef HAVE_DEV_PTC */
 84+#define HAVE_DEV_PTMX 1
 85+/* #undef HAVE_DIRECT_H */
 86+#define HAVE_DIRENT_D_TYPE 1
 87+#define HAVE_DIRENT_H 1
 88+#define HAVE_DIRFD 1
 89+#define HAVE_DLFCN_H 1
 90+/* #undef HAVE_DLOPEN */
 91+#define HAVE_DUP2 1
 92+#define HAVE_DUP3 1
 93+/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
 94+/* #undef HAVE_DYNAMIC_LOADING */
 95+#define HAVE_ENDIAN_H 1
 96+#define HAVE_EPOLL 1
 97+#define HAVE_EPOLL_CREATE1 1
 98+#define HAVE_ERF 1
 99+#define HAVE_ERFC 1
100+#define HAVE_ERRNO_H 1
101+#define HAVE_EVENTFD 1
102+#define HAVE_EXECV 1
103+#define HAVE_EXPLICIT_BZERO 1
104+/* #undef HAVE_EXPLICIT_MEMSET */
105+#define HAVE_EXPM1 1
106+#define HAVE_FACCESSAT 1
107+#define HAVE_FCHDIR 1
108+#define HAVE_FCHMOD 1
109+#define HAVE_FCHMODAT 1
110+#define HAVE_FCHOWN 1
111+#define HAVE_FCHOWNAT 1
112+#define HAVE_FCNTL_H 1
113+#define HAVE_FDATASYNC 1
114+#define HAVE_FDOPENDIR 1
115+/* #undef HAVE_FDWALK */
116+#define HAVE_FEXECVE 1
117+#define HAVE_FINITE 1
118+#define HAVE_FLOCK 1
119+#define HAVE_FORK 1
120+#define HAVE_FORKPTY 1
121+#define HAVE_FPATHCONF 1
122+/* #undef HAVE_FSEEK64 */
123+#define HAVE_FSEEKO 1
124+#define HAVE_FSTATAT 1
125+#define HAVE_FSTATVFS 1
126+#define HAVE_FSYNC 1
127+/* #undef HAVE_FTELL64 */
128+#define HAVE_FTELLO 1
129+#define HAVE_FTIME 1
130+#define HAVE_FTRUNCATE 1
131+#define HAVE_FUTIMENS 1
132+#define HAVE_FUTIMES 1
133+#define HAVE_FUTIMESAT 1
134+#define HAVE_GAI_STRERROR 1
135+/* #undef HAVE_GAMMA */
136+/* #undef HAVE_GCC_ASM_FOR_MC68881 */
137+#define HAVE_GCC_ASM_FOR_X64 1
138+#define HAVE_GCC_ASM_FOR_X87 1
139+#define HAVE_GCC_UINT128_T 1
140+#define HAVE_GETADDRINFO 1
141+#define HAVE_GETC_UNLOCKED 1
142+#define HAVE_GETENTROPY 1
143+#define HAVE_GETGRGID_R 1
144+#define HAVE_GETGRNAM_R 1
145+#define HAVE_GETGROUPLIST 1
146+#define HAVE_GETGROUPS 1
147+/* #undef HAVE_GETHOSTBYNAME */
148+#define HAVE_GETHOSTBYNAME_R 1
149+/* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
150+/* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
151+#define HAVE_GETHOSTBYNAME_R_6_ARG 1
152+#define HAVE_GETITIMER 1
153+#define HAVE_GETLOADAVG 1
154+#define HAVE_GETLOGIN 1
155+#define HAVE_GETNAMEINFO 1
156+#define HAVE_GETPAGESIZE 1
157+#define HAVE_GETPEERNAME 1
158+#define HAVE_GETPGID 1
159+#define HAVE_GETPGRP 1
160+#define HAVE_GETPID 1
161+#define HAVE_GETPRIORITY 1
162+#define HAVE_GETPWENT 1
163+#define HAVE_GETPWNAM_R 1
164+#define HAVE_GETPWUID_R 1
165+#define HAVE_GETRANDOM 1
166+#define HAVE_GETRANDOM_SYSCALL 1
167+#define HAVE_GETRESGID 1
168+#define HAVE_GETRESUID 1
169+#define HAVE_GETSID 1
170+#define HAVE_GETSPENT 1
171+#define HAVE_GETSPNAM 1
172+/* #undef HAVE_GETWD */
173+/* #undef HAVE_GLIBC_MEMMOVE_BUG */
174+#define HAVE_GRP_H 1
175+#define HAVE_HSTRERROR 1
176+#define HAVE_HTOLE64 1
177+#define HAVE_HYPOT 1
178+/* #undef HAVE_IEEEFP_H */
179+#define HAVE_IF_NAMEINDEX 1
180+#define HAVE_INET_ATON 1
181+#define HAVE_INET_PTON 1
182+#define HAVE_INITGROUPS 1
183+#define HAVE_INTTYPES_H 1
184+/* #undef HAVE_IO_H */
185+/* #undef HAVE_IPA_PURE_CONST_BUG */
186+#define HAVE_KILL 1
187+#define HAVE_KILLPG 1
188+/* #undef HAVE_KQUEUE */
189+#define HAVE_LANGINFO_H 1
190+/* #undef HAVE_LARGEFILE_SUPPORT */
191+/* #undef HAVE_LCHFLAGS */
192+/* #undef HAVE_LCHMOD */
193+#define HAVE_LCHOWN 1
194+#define HAVE_LGAMMA 1
195+#define HAVE_LIBDL 1
196+/* #undef HAVE_LIBDLD */
197+/* #undef HAVE_LIBIEEE */
198+#define HAVE_LIBINTL_H 1
199+/* #undef HAVE_LIBREADLINE */
200+/* #undef HAVE_LIBRESOLV */
201+/* #undef HAVE_LIBSENDFILE */
202+/* #undef HAVE_LIBUTIL_H */
203+#define HAVE_LINK 1
204+#define HAVE_LINKAT 1
205+#define HAVE_LINUX_CAN_BCM_H 1
206+#define HAVE_LINUX_CAN_H 1
207+#define HAVE_LINUX_CAN_J1939_H 1
208+#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1
209+#define HAVE_LINUX_CAN_RAW_H 1
210+#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1
211+#define HAVE_LINUX_MEMFD_H 1
212+#define HAVE_LINUX_NETLINK_H 1
213+#define HAVE_LINUX_QRTR_H 1
214+#define HAVE_LINUX_RANDOM_H 1
215+#define HAVE_LINUX_TIPC_H 1
216+#define HAVE_LINUX_VM_SOCKETS_H 1
217+#define HAVE_LINUX_WAIT_H 1
218+#define HAVE_LOCKF 1
219+#define HAVE_LOG1P 1
220+#define HAVE_LOG2 1
221+#define HAVE_LONG_DOUBLE 1
222+#define HAVE_LSTAT 1
223+#define HAVE_LUTIMES 1
224+#define HAVE_MADVISE 1
225+#define HAVE_MAKEDEV 1
226+#define HAVE_MBRTOWC 1
227+#define HAVE_MEMFD_CREATE 1
228+#define HAVE_MEMORY_H 1
229+#define HAVE_MEMRCHR 1
230+#define HAVE_MKDIRAT 1
231+#define HAVE_MKFIFO 1
232+#define HAVE_MKFIFOAT 1
233+#define HAVE_MKNOD 1
234+#define HAVE_MKNODAT 1
235+#define HAVE_MKTIME 1
236+#define HAVE_MMAP 1
237+#define HAVE_MREMAP 1
238+/* #undef HAVE_NCURSES_H */
239+/* #undef HAVE_NDIR_H */
240+#define HAVE_NETPACKET_PACKET_H 1
241+#define HAVE_NET_IF_H 1
242+#define HAVE_NICE 1
243+/* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
244+#define HAVE_OPENAT 1
245+#define HAVE_OPENPTY 1
246+#define HAVE_PATHCONF 1
247+#define HAVE_PAUSE 1
248+#define HAVE_PIPE2 1
249+/* #undef HAVE_PLOCK */
250+#define HAVE_POLL 1
251+#define HAVE_POLL_H 1
252+#define HAVE_POSIX_FADVISE 1
253+#define HAVE_POSIX_FALLOCATE 1
254+#define HAVE_POSIX_SPAWN 1
255+#define HAVE_POSIX_SPAWNP 1
256+#define HAVE_PREAD 1
257+#define HAVE_PREADV 1
258+/* #undef HAVE_PREADV2 */
259+#define HAVE_PRLIMIT 1
260+/* #undef HAVE_PROCESS_H */
261+#define HAVE_PROTOTYPES 1
262+#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
263+/* #undef HAVE_PTHREAD_DESTRUCTOR */
264+#define HAVE_PTHREAD_GETCPUCLOCKID 1
265+#define HAVE_PTHREAD_H 1
266+/* #undef HAVE_PTHREAD_INIT */
267+#define HAVE_PTHREAD_KILL 1
268+#define HAVE_PTHREAD_SIGMASK 1
269+#define HAVE_PTY_H 1
270+#define HAVE_PWRITE 1
271+#define HAVE_PWRITEV 1
272+/* #undef HAVE_PWRITEV2 */
273+#define HAVE_READLINK 1
274+#define HAVE_READLINKAT 1
275+#define HAVE_READV 1
276+#define HAVE_REALPATH 1
277+#define HAVE_RENAMEAT 1
278+/* #undef HAVE_RL_APPEND_HISTORY */
279+/* #undef HAVE_RL_CATCH_SIGNAL */
280+/* #undef HAVE_RL_COMPLETION_APPEND_CHARACTER */
281+/* #undef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK */
282+/* #undef HAVE_RL_COMPLETION_MATCHES */
283+/* #undef HAVE_RL_COMPLETION_SUPPRESS_APPEND */
284+/* #undef HAVE_RL_PRE_INPUT_HOOK */
285+/* #undef HAVE_RL_RESIZE_TERMINAL */
286+#define HAVE_ROUND 1
287+/* #undef HAVE_RTPSPAWN */
288+#define HAVE_SCHED_GET_PRIORITY_MAX 1
289+#define HAVE_SCHED_H 1
290+#define HAVE_SCHED_RR_GET_INTERVAL 1
291+#define HAVE_SCHED_SETAFFINITY 1
292+#define HAVE_SCHED_SETPARAM 1
293+#define HAVE_SCHED_SETSCHEDULER 1
294+#define HAVE_SEM_GETVALUE 1
295+#define HAVE_SEM_OPEN 1
296+#define HAVE_SEM_TIMEDWAIT 1
297+#define HAVE_SEM_UNLINK 1
298+#define HAVE_SENDFILE 1
299+#define HAVE_SETEGID 1
300+#define HAVE_SETEUID 1
301+#define HAVE_SETGID 1
302+#define HAVE_SETGROUPS 1
303+#define HAVE_SETHOSTNAME 1
304+#define HAVE_SETITIMER 1
305+#define HAVE_SETLOCALE 1
306+#define HAVE_SETPGID 1
307+#define HAVE_SETPGRP 1
308+#define HAVE_SETPRIORITY 1
309+#define HAVE_SETREGID 1
310+#define HAVE_SETRESGID 1
311+#define HAVE_SETRESUID 1
312+#define HAVE_SETREUID 1
313+#define HAVE_SETSID 1
314+#define HAVE_SETUID 1
315+#define HAVE_SETVBUF 1
316+#define HAVE_SHADOW_H 1
317+#define HAVE_SHM_OPEN 1
318+#define HAVE_SHM_UNLINK 1
319+#define HAVE_SIGACTION 1
320+#define HAVE_SIGALTSTACK 1
321+#define HAVE_SIGFILLSET 1
322+#define HAVE_SIGINFO_T_SI_BAND 1
323+#define HAVE_SIGINTERRUPT 1
324+#define HAVE_SIGNAL_H 1
325+#define HAVE_SIGPENDING 1
326+#define HAVE_SIGRELSE 1
327+#define HAVE_SIGTIMEDWAIT 1
328+#define HAVE_SIGWAIT 1
329+#define HAVE_SIGWAITINFO 1
330+#define HAVE_SNPRINTF 1
331+#define HAVE_SOCKADDR_ALG 1
332+/* #undef HAVE_SOCKADDR_SA_LEN */
333+#define HAVE_SOCKADDR_STORAGE 1
334+#define HAVE_SOCKETPAIR 1
335+#define HAVE_SPAWN_H 1
336+#define HAVE_SPLICE 1
337+#define HAVE_SSIZE_T 1
338+#define HAVE_STATVFS 1
339+#define HAVE_STAT_TV_NSEC 1
340+/* #undef HAVE_STAT_TV_NSEC2 */
341+#define HAVE_STDARG_PROTOTYPES 1
342+#define HAVE_STDINT_H 1
343+#define HAVE_STDLIB_H 1
344+#define HAVE_STD_ATOMIC 1
345+#define HAVE_STRFTIME 1
346+#define HAVE_STRINGS_H 1
347+#define HAVE_STRING_H 1
348+#define HAVE_STRLCPY 1
349+#define HAVE_STROPTS_H 1
350+#define HAVE_STRSIGNAL 1
351+#define HAVE_STRUCT_PASSWD_PW_GECOS 1
352+#define HAVE_STRUCT_PASSWD_PW_PASSWD 1
353+/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */
354+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
355+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
356+/* #undef HAVE_STRUCT_STAT_ST_FLAGS */
357+/* #undef HAVE_STRUCT_STAT_ST_GEN */
358+#define HAVE_STRUCT_STAT_ST_RDEV 1
359+#define HAVE_STRUCT_TM_TM_ZONE 1
360+#define HAVE_SYMLINK 1
361+#define HAVE_SYMLINKAT 1
362+#define HAVE_SYNC 1
363+#define HAVE_SYSCONF 1
364+#define HAVE_SYSEXITS_H 1
365+/* #undef HAVE_SYS_AUDIOIO_H */
366+/* #undef HAVE_SYS_BSDTTY_H */
367+/* #undef HAVE_SYS_DEVPOLL_H */
368+/* #undef HAVE_SYS_DIR_H */
369+/* #undef HAVE_SYS_ENDIAN_H */
370+#define HAVE_SYS_EPOLL_H 1
371+#define HAVE_SYS_EVENTFD_H 1
372+/* #undef HAVE_SYS_EVENT_H */
373+#define HAVE_SYS_FILE_H 1
374+#define HAVE_SYS_IOCTL_H 1
375+/* #undef HAVE_SYS_KERN_CONTROL_H */
376+/* #undef HAVE_SYS_LOADAVG_H */
377+/* #undef HAVE_SYS_LOCK_H */
378+/* #undef HAVE_SYS_MEMFD_H */
379+/* #undef HAVE_SYS_MKDEV_H */
380+#define HAVE_SYS_MMAN_H 1
381+/* #undef HAVE_SYS_MODEM_H */
382+/* #undef HAVE_SYS_NDIR_H */
383+#define HAVE_SYS_PARAM_H 1
384+#define HAVE_SYS_POLL_H 1
385+#define HAVE_SYS_RANDOM_H 1
386+#define HAVE_SYS_RESOURCE_H 1
387+#define HAVE_SYS_SELECT_H 1
388+#define HAVE_SYS_SENDFILE_H 1
389+#define HAVE_SYS_SOCKET_H 1
390+#define HAVE_SYS_STATVFS_H 1
391+#define HAVE_SYS_STAT_H 1
392+#define HAVE_SYS_SYSCALL_H 1
393+#define HAVE_SYS_SYSMACROS_H 1
394+/* #undef HAVE_SYS_SYS_DOMAIN_H */
395+/* #undef HAVE_SYS_TERMIO_H */
396+#define HAVE_SYS_TIMES_H 1
397+#define HAVE_SYS_TIME_H 1
398+#define HAVE_SYS_TYPES_H 1
399+#define HAVE_SYS_UIO_H 1
400+#define HAVE_SYS_UN_H 1
401+#define HAVE_SYS_UTSNAME_H 1
402+#define HAVE_SYS_WAIT_H 1
403+#define HAVE_SYS_XATTR_H 1
404+#define HAVE_TCGETPGRP 1
405+#define HAVE_TCSETPGRP 1
406+#define HAVE_TEMPNAM 1
407+#define HAVE_TERMIOS_H 1
408+/* #undef HAVE_TERM_H */
409+#define HAVE_TGAMMA 1
410+#define HAVE_TIMEGM 1
411+#define HAVE_TIMES 1
412+#define HAVE_TMPFILE 1
413+#define HAVE_TMPNAM 1
414+/* #undef HAVE_TMPNAM_R */
415+#define HAVE_TM_ZONE 1
416+#define HAVE_TRUNCATE 1
417+/* #undef HAVE_TZNAME */
418+/* #undef HAVE_UCS4_TCL */
419+#define HAVE_UNAME 1
420+#define HAVE_UNISTD_H 1
421+#define HAVE_UNLINKAT 1
422+/* #undef HAVE_USABLE_WCHAR_T */
423+/* #undef HAVE_UTIL_H */
424+#define HAVE_UTIMENSAT 1
425+#define HAVE_UTIMES 1
426+#define HAVE_UTIME_H 1
427+/* #undef HAVE_UUID_CREATE */
428+/* #undef HAVE_UUID_ENC_BE */
429+/* #undef HAVE_UUID_GENERATE_TIME_SAFE */
430+/* #undef HAVE_UUID_H */
431+/* #undef HAVE_UUID_UUID_H */
432+#define HAVE_VFORK 1
433+#define HAVE_WAIT3 1
434+#define HAVE_WAIT4 1
435+#define HAVE_WAITID 1
436+#define HAVE_WAITPID 1
437+#define HAVE_WCHAR_H 1
438+#define HAVE_WCSCOLL 1
439+#define HAVE_WCSFTIME 1
440+#define HAVE_WCSXFRM 1
441+#define HAVE_WMEMCMP 1
442+#define HAVE_WORKING_TZSET 1
443+#define HAVE_WRITEV 1
444+#define HAVE_ZLIB_COPY 1
445+/* #undef HAVE__GETPTY */
446+/* #undef MAJOR_IN_MKDEV */
447+#define MAJOR_IN_SYSMACROS 1
448+/* #undef MVWDELCH_IS_EXPRESSION */
449+/* #undef PACKAGE_BUGREPORT */
450+/* #undef PACKAGE_NAME */
451+/* #undef PACKAGE_STRING */
452+/* #undef PACKAGE_TARNAME */
453+/* #undef PACKAGE_URL */
454+/* #undef PACKAGE_VERSION */
455+/* #undef POSIX_SEMAPHORES_NOT_ENABLED */
456+#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
457+#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
458+/* #undef PYLONG_BITS_IN_DIGIT */
459+#define PY_BUILTIN_HASHLIB_HASHES "sha3,blake2"
460+#define PY_COERCE_C_LOCALE 1
461+#define PY_FORMAT_SIZE_T "z"
462+#define PY_SSL_DEFAULT_CIPHERS 0
463+#define PY_SSL_DEFAULT_CIPHER_STRING "TLSv1.3:TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE"
464+/* #undef Py_DEBUG */
465+/* #undef Py_ENABLE_SHARED */
466+/* #undef Py_HASH_ALGORITHM */
467+/* #undef Py_TRACE_REFS */
468+#define RETSIGTYPE void
469+/* #undef SETPGRP_HAVE_ARG */
470+/* #undef SHM_NEEDS_LIBRT */
471+/* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
472+#define SIZEOF_DOUBLE 8
473+#define SIZEOF_FLOAT 4
474+#define SIZEOF_FPOS_T 16
475+#define SIZEOF_INT 4
476+#define SIZEOF_LONG 8
477+#define SIZEOF_LONG_DOUBLE 16
478+#define SIZEOF_LONG_LONG 8
479+#define SIZEOF_OFF_T 8
480+#define SIZEOF_PID_T 4
481+#define SIZEOF_PTHREAD_KEY_T 4
482+#define SIZEOF_PTHREAD_T 8
483+#define SIZEOF_SHORT 2
484+#define SIZEOF_SIZE_T 8
485+#define SIZEOF_TIME_T 8
486+#define SIZEOF_UINTPTR_T 8
487+#define SIZEOF_VOID_P 8
488+#define SIZEOF_WCHAR_T 4
489+#define SIZEOF__BOOL 1
490+#define STDC_HEADERS 1
491+#define SYS_SELECT_WITH_SYS_TIME 1
492+/* #undef TIMEMODULE_LIB */
493+#define TIME_WITH_SYS_TIME 1
494+/* #undef TM_IN_SYS_TIME */
495+/* #undef USE_COMPUTED_GOTOS */
496+#ifndef _ALL_SOURCE
497+# define _ALL_SOURCE 1
498+#endif
499+#ifndef _GNU_SOURCE
500+# define _GNU_SOURCE 1
501+#endif
502+#ifndef _POSIX_PTHREAD_SEMANTICS
503+# define _POSIX_PTHREAD_SEMANTICS 1
504+#endif
505+#ifndef _TANDEM_SOURCE
506+# define _TANDEM_SOURCE 1
507+#endif
508+#ifndef __EXTENSIONS__
509+# define __EXTENSIONS__ 1
510+#endif
511+/* #undef WINDOW_HAS_FLAGS */
512+#define WITH_DECIMAL_CONTEXTVAR 1
513+#define WITH_DOC_STRINGS 1
514+/* #undef WITH_DTRACE */
515+/* #undef WITH_DYLD */
516+/* #undef WITH_EDITLINE */
517+/* #undef WITH_LIBINTL */
518+/* #undef WITH_NEXT_FRAMEWORK */
519+/* #undef WITH_PYMALLOC */
520+/* #undef WITH_VALGRIND */
521+#if defined AC_APPLE_UNIVERSAL_BUILD
522+# if defined __BIG_ENDIAN__
523+#  define WORDS_BIGENDIAN 1
524+# endif
525+#else
526+# ifndef WORDS_BIGENDIAN
527+/* #  undef WORDS_BIGENDIAN */
528+# endif
529+#endif
530+/* #undef X87_DOUBLE_ROUNDING */
531+/* #undef _BSD_SOURCE */
532+#define _DARWIN_C_SOURCE 1
533+#define _FILE_OFFSET_BITS 64
534+#define _GNU_SOURCE 1
535+/* #undef _INCLUDE__STDC_A1_SOURCE */
536+#define _LARGEFILE_SOURCE 1
537+/* #undef _LARGE_FILES */
538+/* #undef _MINIX */
539+#define _NETBSD_SOURCE 1
540+/* #undef _POSIX_1_SOURCE */
541+#define _POSIX_C_SOURCE 200809L
542+/* #undef _POSIX_SOURCE */
543+/* #undef _POSIX_THREADS */
544+#define _PYTHONFRAMEWORK ""
545+#define _REENTRANT 1
546+#define _XOPEN_SOURCE 700
547+#define _XOPEN_SOURCE_EXTENDED 1
548+#define __BSD_VISIBLE 1
549+#ifndef __CHAR_UNSIGNED__
550+/* # undef __CHAR_UNSIGNED__ */
551+#endif
552+/* #undef clock_t */
553+/* #undef const */
554+/* #undef gid_t */
555+/* #undef mode_t */
556+/* #undef off_t */
557+/* #undef pid_t */
558+/* #undef signed */
559+/* #undef size_t */
560+/* #undef socklen_t */
561+/* #undef uid_t */
562+#if defined(__USLC__) && defined(__SCO_VERSION__)
563+#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
564+#endif
565+#endif /*Py_PYCONFIG_H*/
+722, -0
  1@@ -0,0 +1,722 @@
  2+# 2,<cd src/Lib && find * '(' -name test -o -name tests -o -name idle_test ')' '!' -prune -o -name '*.py' -o -name '*Grammar.txt' | LC_COLLATE=C sort
  3+__future__.py
  4+__phello__.foo.py
  5+_aix_support.py
  6+_bootsubprocess.py
  7+_collections_abc.py
  8+_compat_pickle.py
  9+_compression.py
 10+_markupbase.py
 11+_osx_support.py
 12+_py_abc.py
 13+_pydecimal.py
 14+_pyio.py
 15+_sitebuiltins.py
 16+_strptime.py
 17+_threading_local.py
 18+_weakrefset.py
 19+abc.py
 20+aifc.py
 21+antigravity.py
 22+argparse.py
 23+ast.py
 24+asynchat.py
 25+asyncio/__init__.py
 26+asyncio/__main__.py
 27+asyncio/base_events.py
 28+asyncio/base_futures.py
 29+asyncio/base_subprocess.py
 30+asyncio/base_tasks.py
 31+asyncio/constants.py
 32+asyncio/coroutines.py
 33+asyncio/events.py
 34+asyncio/exceptions.py
 35+asyncio/format_helpers.py
 36+asyncio/futures.py
 37+asyncio/locks.py
 38+asyncio/log.py
 39+asyncio/mixins.py
 40+asyncio/proactor_events.py
 41+asyncio/protocols.py
 42+asyncio/queues.py
 43+asyncio/runners.py
 44+asyncio/selector_events.py
 45+asyncio/sslproto.py
 46+asyncio/staggered.py
 47+asyncio/streams.py
 48+asyncio/subprocess.py
 49+asyncio/tasks.py
 50+asyncio/threads.py
 51+asyncio/transports.py
 52+asyncio/trsock.py
 53+asyncio/unix_events.py
 54+asyncio/windows_events.py
 55+asyncio/windows_utils.py
 56+asyncore.py
 57+base64.py
 58+bdb.py
 59+binhex.py
 60+bisect.py
 61+bz2.py
 62+cProfile.py
 63+calendar.py
 64+cgi.py
 65+cgitb.py
 66+chunk.py
 67+cmd.py
 68+code.py
 69+codecs.py
 70+codeop.py
 71+collections/__init__.py
 72+collections/abc.py
 73+colorsys.py
 74+compileall.py
 75+concurrent/__init__.py
 76+concurrent/futures/__init__.py
 77+concurrent/futures/_base.py
 78+concurrent/futures/process.py
 79+concurrent/futures/thread.py
 80+configparser.py
 81+contextlib.py
 82+contextvars.py
 83+copy.py
 84+copyreg.py
 85+crypt.py
 86+csv.py
 87+ctypes/__init__.py
 88+ctypes/_aix.py
 89+ctypes/_endian.py
 90+ctypes/macholib/__init__.py
 91+ctypes/macholib/dyld.py
 92+ctypes/macholib/dylib.py
 93+ctypes/macholib/framework.py
 94+ctypes/util.py
 95+ctypes/wintypes.py
 96+curses/__init__.py
 97+curses/ascii.py
 98+curses/has_key.py
 99+curses/panel.py
100+curses/textpad.py
101+dataclasses.py
102+datetime.py
103+dbm/__init__.py
104+dbm/dumb.py
105+dbm/gnu.py
106+dbm/ndbm.py
107+decimal.py
108+difflib.py
109+dis.py
110+distutils/__init__.py
111+distutils/_msvccompiler.py
112+distutils/archive_util.py
113+distutils/bcppcompiler.py
114+distutils/ccompiler.py
115+distutils/cmd.py
116+distutils/command/__init__.py
117+distutils/command/bdist.py
118+distutils/command/bdist_dumb.py
119+distutils/command/bdist_msi.py
120+distutils/command/bdist_rpm.py
121+distutils/command/build.py
122+distutils/command/build_clib.py
123+distutils/command/build_ext.py
124+distutils/command/build_py.py
125+distutils/command/build_scripts.py
126+distutils/command/check.py
127+distutils/command/clean.py
128+distutils/command/config.py
129+distutils/command/install.py
130+distutils/command/install_data.py
131+distutils/command/install_egg_info.py
132+distutils/command/install_headers.py
133+distutils/command/install_lib.py
134+distutils/command/install_scripts.py
135+distutils/command/register.py
136+distutils/command/sdist.py
137+distutils/command/upload.py
138+distutils/config.py
139+distutils/core.py
140+distutils/cygwinccompiler.py
141+distutils/debug.py
142+distutils/dep_util.py
143+distutils/dir_util.py
144+distutils/dist.py
145+distutils/errors.py
146+distutils/extension.py
147+distutils/fancy_getopt.py
148+distutils/file_util.py
149+distutils/filelist.py
150+distutils/log.py
151+distutils/msvc9compiler.py
152+distutils/msvccompiler.py
153+distutils/spawn.py
154+distutils/sysconfig.py
155+distutils/text_file.py
156+distutils/unixccompiler.py
157+distutils/util.py
158+distutils/version.py
159+distutils/versionpredicate.py
160+doctest.py
161+email/__init__.py
162+email/_encoded_words.py
163+email/_header_value_parser.py
164+email/_parseaddr.py
165+email/_policybase.py
166+email/base64mime.py
167+email/charset.py
168+email/contentmanager.py
169+email/encoders.py
170+email/errors.py
171+email/feedparser.py
172+email/generator.py
173+email/header.py
174+email/headerregistry.py
175+email/iterators.py
176+email/message.py
177+email/mime/__init__.py
178+email/mime/application.py
179+email/mime/audio.py
180+email/mime/base.py
181+email/mime/image.py
182+email/mime/message.py
183+email/mime/multipart.py
184+email/mime/nonmultipart.py
185+email/mime/text.py
186+email/parser.py
187+email/policy.py
188+email/quoprimime.py
189+email/utils.py
190+encodings/__init__.py
191+encodings/aliases.py
192+encodings/ascii.py
193+encodings/base64_codec.py
194+encodings/big5.py
195+encodings/big5hkscs.py
196+encodings/bz2_codec.py
197+encodings/charmap.py
198+encodings/cp037.py
199+encodings/cp1006.py
200+encodings/cp1026.py
201+encodings/cp1125.py
202+encodings/cp1140.py
203+encodings/cp1250.py
204+encodings/cp1251.py
205+encodings/cp1252.py
206+encodings/cp1253.py
207+encodings/cp1254.py
208+encodings/cp1255.py
209+encodings/cp1256.py
210+encodings/cp1257.py
211+encodings/cp1258.py
212+encodings/cp273.py
213+encodings/cp424.py
214+encodings/cp437.py
215+encodings/cp500.py
216+encodings/cp720.py
217+encodings/cp737.py
218+encodings/cp775.py
219+encodings/cp850.py
220+encodings/cp852.py
221+encodings/cp855.py
222+encodings/cp856.py
223+encodings/cp857.py
224+encodings/cp858.py
225+encodings/cp860.py
226+encodings/cp861.py
227+encodings/cp862.py
228+encodings/cp863.py
229+encodings/cp864.py
230+encodings/cp865.py
231+encodings/cp866.py
232+encodings/cp869.py
233+encodings/cp874.py
234+encodings/cp875.py
235+encodings/cp932.py
236+encodings/cp949.py
237+encodings/cp950.py
238+encodings/euc_jis_2004.py
239+encodings/euc_jisx0213.py
240+encodings/euc_jp.py
241+encodings/euc_kr.py
242+encodings/gb18030.py
243+encodings/gb2312.py
244+encodings/gbk.py
245+encodings/hex_codec.py
246+encodings/hp_roman8.py
247+encodings/hz.py
248+encodings/idna.py
249+encodings/iso2022_jp.py
250+encodings/iso2022_jp_1.py
251+encodings/iso2022_jp_2.py
252+encodings/iso2022_jp_2004.py
253+encodings/iso2022_jp_3.py
254+encodings/iso2022_jp_ext.py
255+encodings/iso2022_kr.py
256+encodings/iso8859_1.py
257+encodings/iso8859_10.py
258+encodings/iso8859_11.py
259+encodings/iso8859_13.py
260+encodings/iso8859_14.py
261+encodings/iso8859_15.py
262+encodings/iso8859_16.py
263+encodings/iso8859_2.py
264+encodings/iso8859_3.py
265+encodings/iso8859_4.py
266+encodings/iso8859_5.py
267+encodings/iso8859_6.py
268+encodings/iso8859_7.py
269+encodings/iso8859_8.py
270+encodings/iso8859_9.py
271+encodings/johab.py
272+encodings/koi8_r.py
273+encodings/koi8_t.py
274+encodings/koi8_u.py
275+encodings/kz1048.py
276+encodings/latin_1.py
277+encodings/mac_arabic.py
278+encodings/mac_croatian.py
279+encodings/mac_cyrillic.py
280+encodings/mac_farsi.py
281+encodings/mac_greek.py
282+encodings/mac_iceland.py
283+encodings/mac_latin2.py
284+encodings/mac_roman.py
285+encodings/mac_romanian.py
286+encodings/mac_turkish.py
287+encodings/mbcs.py
288+encodings/oem.py
289+encodings/palmos.py
290+encodings/ptcp154.py
291+encodings/punycode.py
292+encodings/quopri_codec.py
293+encodings/raw_unicode_escape.py
294+encodings/rot_13.py
295+encodings/shift_jis.py
296+encodings/shift_jis_2004.py
297+encodings/shift_jisx0213.py
298+encodings/tis_620.py
299+encodings/undefined.py
300+encodings/unicode_escape.py
301+encodings/utf_16.py
302+encodings/utf_16_be.py
303+encodings/utf_16_le.py
304+encodings/utf_32.py
305+encodings/utf_32_be.py
306+encodings/utf_32_le.py
307+encodings/utf_7.py
308+encodings/utf_8.py
309+encodings/utf_8_sig.py
310+encodings/uu_codec.py
311+encodings/zlib_codec.py
312+ensurepip/__init__.py
313+ensurepip/__main__.py
314+ensurepip/_bundled/__init__.py
315+ensurepip/_uninstall.py
316+enum.py
317+filecmp.py
318+fileinput.py
319+fnmatch.py
320+fractions.py
321+ftplib.py
322+functools.py
323+genericpath.py
324+getopt.py
325+getpass.py
326+gettext.py
327+glob.py
328+graphlib.py
329+gzip.py
330+hashlib.py
331+heapq.py
332+hmac.py
333+html/__init__.py
334+html/entities.py
335+html/parser.py
336+http/__init__.py
337+http/client.py
338+http/cookiejar.py
339+http/cookies.py
340+http/server.py
341+idlelib/__init__.py
342+idlelib/__main__.py
343+idlelib/autocomplete.py
344+idlelib/autocomplete_w.py
345+idlelib/autoexpand.py
346+idlelib/browser.py
347+idlelib/calltip.py
348+idlelib/calltip_w.py
349+idlelib/codecontext.py
350+idlelib/colorizer.py
351+idlelib/config.py
352+idlelib/config_key.py
353+idlelib/configdialog.py
354+idlelib/debugger.py
355+idlelib/debugger_r.py
356+idlelib/debugobj.py
357+idlelib/debugobj_r.py
358+idlelib/delegator.py
359+idlelib/dynoption.py
360+idlelib/editor.py
361+idlelib/filelist.py
362+idlelib/format.py
363+idlelib/grep.py
364+idlelib/help.py
365+idlelib/help_about.py
366+idlelib/history.py
367+idlelib/hyperparser.py
368+idlelib/idle.py
369+idlelib/iomenu.py
370+idlelib/macosx.py
371+idlelib/mainmenu.py
372+idlelib/multicall.py
373+idlelib/outwin.py
374+idlelib/parenmatch.py
375+idlelib/pathbrowser.py
376+idlelib/percolator.py
377+idlelib/pyparse.py
378+idlelib/pyshell.py
379+idlelib/query.py
380+idlelib/redirector.py
381+idlelib/replace.py
382+idlelib/rpc.py
383+idlelib/run.py
384+idlelib/runscript.py
385+idlelib/scrolledlist.py
386+idlelib/search.py
387+idlelib/searchbase.py
388+idlelib/searchengine.py
389+idlelib/sidebar.py
390+idlelib/squeezer.py
391+idlelib/stackviewer.py
392+idlelib/statusbar.py
393+idlelib/textview.py
394+idlelib/tooltip.py
395+idlelib/tree.py
396+idlelib/undo.py
397+idlelib/window.py
398+idlelib/zoomheight.py
399+idlelib/zzdummy.py
400+imaplib.py
401+imghdr.py
402+imp.py
403+importlib/__init__.py
404+importlib/_abc.py
405+importlib/_adapters.py
406+importlib/_bootstrap.py
407+importlib/_bootstrap_external.py
408+importlib/_common.py
409+importlib/abc.py
410+importlib/machinery.py
411+importlib/metadata/__init__.py
412+importlib/metadata/_adapters.py
413+importlib/metadata/_collections.py
414+importlib/metadata/_functools.py
415+importlib/metadata/_itertools.py
416+importlib/metadata/_meta.py
417+importlib/metadata/_text.py
418+importlib/readers.py
419+importlib/resources.py
420+importlib/util.py
421+inspect.py
422+io.py
423+ipaddress.py
424+json/__init__.py
425+json/decoder.py
426+json/encoder.py
427+json/scanner.py
428+json/tool.py
429+keyword.py
430+lib2to3/Grammar.txt
431+lib2to3/PatternGrammar.txt
432+lib2to3/__init__.py
433+lib2to3/__main__.py
434+lib2to3/btm_matcher.py
435+lib2to3/btm_utils.py
436+lib2to3/fixer_base.py
437+lib2to3/fixer_util.py
438+lib2to3/fixes/__init__.py
439+lib2to3/fixes/fix_apply.py
440+lib2to3/fixes/fix_asserts.py
441+lib2to3/fixes/fix_basestring.py
442+lib2to3/fixes/fix_buffer.py
443+lib2to3/fixes/fix_dict.py
444+lib2to3/fixes/fix_except.py
445+lib2to3/fixes/fix_exec.py
446+lib2to3/fixes/fix_execfile.py
447+lib2to3/fixes/fix_exitfunc.py
448+lib2to3/fixes/fix_filter.py
449+lib2to3/fixes/fix_funcattrs.py
450+lib2to3/fixes/fix_future.py
451+lib2to3/fixes/fix_getcwdu.py
452+lib2to3/fixes/fix_has_key.py
453+lib2to3/fixes/fix_idioms.py
454+lib2to3/fixes/fix_import.py
455+lib2to3/fixes/fix_imports.py
456+lib2to3/fixes/fix_imports2.py
457+lib2to3/fixes/fix_input.py
458+lib2to3/fixes/fix_intern.py
459+lib2to3/fixes/fix_isinstance.py
460+lib2to3/fixes/fix_itertools.py
461+lib2to3/fixes/fix_itertools_imports.py
462+lib2to3/fixes/fix_long.py
463+lib2to3/fixes/fix_map.py
464+lib2to3/fixes/fix_metaclass.py
465+lib2to3/fixes/fix_methodattrs.py
466+lib2to3/fixes/fix_ne.py
467+lib2to3/fixes/fix_next.py
468+lib2to3/fixes/fix_nonzero.py
469+lib2to3/fixes/fix_numliterals.py
470+lib2to3/fixes/fix_operator.py
471+lib2to3/fixes/fix_paren.py
472+lib2to3/fixes/fix_print.py
473+lib2to3/fixes/fix_raise.py
474+lib2to3/fixes/fix_raw_input.py
475+lib2to3/fixes/fix_reduce.py
476+lib2to3/fixes/fix_reload.py
477+lib2to3/fixes/fix_renames.py
478+lib2to3/fixes/fix_repr.py
479+lib2to3/fixes/fix_set_literal.py
480+lib2to3/fixes/fix_standarderror.py
481+lib2to3/fixes/fix_sys_exc.py
482+lib2to3/fixes/fix_throw.py
483+lib2to3/fixes/fix_tuple_params.py
484+lib2to3/fixes/fix_types.py
485+lib2to3/fixes/fix_unicode.py
486+lib2to3/fixes/fix_urllib.py
487+lib2to3/fixes/fix_ws_comma.py
488+lib2to3/fixes/fix_xrange.py
489+lib2to3/fixes/fix_xreadlines.py
490+lib2to3/fixes/fix_zip.py
491+lib2to3/main.py
492+lib2to3/patcomp.py
493+lib2to3/pgen2/__init__.py
494+lib2to3/pgen2/conv.py
495+lib2to3/pgen2/driver.py
496+lib2to3/pgen2/grammar.py
497+lib2to3/pgen2/literals.py
498+lib2to3/pgen2/parse.py
499+lib2to3/pgen2/pgen.py
500+lib2to3/pgen2/token.py
501+lib2to3/pgen2/tokenize.py
502+lib2to3/pygram.py
503+lib2to3/pytree.py
504+lib2to3/refactor.py
505+linecache.py
506+locale.py
507+logging/__init__.py
508+logging/config.py
509+logging/handlers.py
510+lzma.py
511+mailbox.py
512+mailcap.py
513+mimetypes.py
514+modulefinder.py
515+msilib/__init__.py
516+msilib/schema.py
517+msilib/sequence.py
518+msilib/text.py
519+multiprocessing/__init__.py
520+multiprocessing/connection.py
521+multiprocessing/context.py
522+multiprocessing/dummy/__init__.py
523+multiprocessing/dummy/connection.py
524+multiprocessing/forkserver.py
525+multiprocessing/heap.py
526+multiprocessing/managers.py
527+multiprocessing/pool.py
528+multiprocessing/popen_fork.py
529+multiprocessing/popen_forkserver.py
530+multiprocessing/popen_spawn_posix.py
531+multiprocessing/popen_spawn_win32.py
532+multiprocessing/process.py
533+multiprocessing/queues.py
534+multiprocessing/reduction.py
535+multiprocessing/resource_sharer.py
536+multiprocessing/resource_tracker.py
537+multiprocessing/shared_memory.py
538+multiprocessing/sharedctypes.py
539+multiprocessing/spawn.py
540+multiprocessing/synchronize.py
541+multiprocessing/util.py
542+netrc.py
543+nntplib.py
544+ntpath.py
545+nturl2path.py
546+numbers.py
547+opcode.py
548+operator.py
549+optparse.py
550+os.py
551+pathlib.py
552+pdb.py
553+pickle.py
554+pickletools.py
555+pipes.py
556+pkgutil.py
557+platform.py
558+plistlib.py
559+poplib.py
560+posixpath.py
561+pprint.py
562+profile.py
563+pstats.py
564+pty.py
565+py_compile.py
566+pyclbr.py
567+pydoc.py
568+pydoc_data/__init__.py
569+pydoc_data/topics.py
570+queue.py
571+quopri.py
572+random.py
573+re.py
574+reprlib.py
575+rlcompleter.py
576+runpy.py
577+sched.py
578+secrets.py
579+selectors.py
580+shelve.py
581+shlex.py
582+shutil.py
583+signal.py
584+site.py
585+smtpd.py
586+smtplib.py
587+sndhdr.py
588+socket.py
589+socketserver.py
590+sqlite3/__init__.py
591+sqlite3/dbapi2.py
592+sqlite3/dump.py
593+sre_compile.py
594+sre_constants.py
595+sre_parse.py
596+ssl.py
597+stat.py
598+statistics.py
599+string.py
600+stringprep.py
601+struct.py
602+subprocess.py
603+sunau.py
604+symtable.py
605+sysconfig.py
606+tabnanny.py
607+tarfile.py
608+telnetlib.py
609+tempfile.py
610+textwrap.py
611+this.py
612+threading.py
613+timeit.py
614+tkinter/__init__.py
615+tkinter/__main__.py
616+tkinter/colorchooser.py
617+tkinter/commondialog.py
618+tkinter/constants.py
619+tkinter/dialog.py
620+tkinter/dnd.py
621+tkinter/filedialog.py
622+tkinter/font.py
623+tkinter/messagebox.py
624+tkinter/scrolledtext.py
625+tkinter/simpledialog.py
626+tkinter/tix.py
627+tkinter/ttk.py
628+token.py
629+tokenize.py
630+trace.py
631+traceback.py
632+tracemalloc.py
633+tty.py
634+turtle.py
635+turtledemo/__init__.py
636+turtledemo/__main__.py
637+turtledemo/bytedesign.py
638+turtledemo/chaos.py
639+turtledemo/clock.py
640+turtledemo/colormixer.py
641+turtledemo/forest.py
642+turtledemo/fractalcurves.py
643+turtledemo/lindenmayer.py
644+turtledemo/minimal_hanoi.py
645+turtledemo/nim.py
646+turtledemo/paint.py
647+turtledemo/peace.py
648+turtledemo/penrose.py
649+turtledemo/planet_and_moon.py
650+turtledemo/rosette.py
651+turtledemo/round_dance.py
652+turtledemo/sorting_animate.py
653+turtledemo/tree.py
654+turtledemo/two_canvases.py
655+turtledemo/yinyang.py
656+types.py
657+typing.py
658+unittest/__init__.py
659+unittest/__main__.py
660+unittest/_log.py
661+unittest/async_case.py
662+unittest/case.py
663+unittest/loader.py
664+unittest/main.py
665+unittest/mock.py
666+unittest/result.py
667+unittest/runner.py
668+unittest/signals.py
669+unittest/suite.py
670+unittest/util.py
671+urllib/__init__.py
672+urllib/error.py
673+urllib/parse.py
674+urllib/request.py
675+urllib/response.py
676+urllib/robotparser.py
677+uu.py
678+uuid.py
679+venv/__init__.py
680+venv/__main__.py
681+warnings.py
682+wave.py
683+weakref.py
684+webbrowser.py
685+wsgiref/__init__.py
686+wsgiref/handlers.py
687+wsgiref/headers.py
688+wsgiref/simple_server.py
689+wsgiref/util.py
690+wsgiref/validate.py
691+xdrlib.py
692+xml/__init__.py
693+xml/dom/NodeFilter.py
694+xml/dom/__init__.py
695+xml/dom/domreg.py
696+xml/dom/expatbuilder.py
697+xml/dom/minicompat.py
698+xml/dom/minidom.py
699+xml/dom/pulldom.py
700+xml/dom/xmlbuilder.py
701+xml/etree/ElementInclude.py
702+xml/etree/ElementPath.py
703+xml/etree/ElementTree.py
704+xml/etree/__init__.py
705+xml/etree/cElementTree.py
706+xml/parsers/__init__.py
707+xml/parsers/expat.py
708+xml/sax/__init__.py
709+xml/sax/_exceptions.py
710+xml/sax/expatreader.py
711+xml/sax/handler.py
712+xml/sax/saxutils.py
713+xml/sax/xmlreader.py
714+xmlrpc/__init__.py
715+xmlrpc/client.py
716+xmlrpc/server.py
717+zipapp.py
718+zipfile.py
719+zipimport.py
720+zoneinfo/__init__.py
721+zoneinfo/_common.py
722+zoneinfo/_tzpath.py
723+zoneinfo/_zoneinfo.py
+1, -0
1@@ -0,0 +1 @@
2+5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002  Python-3.10.0.tar.xz
+1, -0
1@@ -0,0 +1 @@
2+url = "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz"
+1, -0
1@@ -0,0 +1 @@
2+3.10.0 r1
+1, -0
1@@ -46,6 +46,7 @@ return {
2 		'muon',
3 		'musl',
4 		'nasm', 
5+		'python',
6 		'qbe',
7 		'strace',
8 		'the_silver_searcher',