commit f63e629
Michael Forney
·
2026-10-20 20:09:45 +0000 UTC
parent 3f437f2
python: Update to 3.15.1 Frozen modules were dropped from the git repository in [0]. To avoid requiring a special bootstrap python, the modules are now pre-generated and hosted as a release asset in the oasis cpython repository. [0] https://github.com/python/cpython/pull/28375
13 files changed,
+1356,
-1213
+2,
-1
1@@ -1,6 +1,7 @@
2-/Python-3.10.0.tar.xz
3 /curl-8.14.1.tar.xz
4 /fontconfig-2.13.1.tar.gz
5+/Python-3.15.1.tar.xz
6+/Python-frozen_modules-3.15.1.tar.gz
7 /bc-1.08.2.tar.gz
8 /binutils-2.46.0.tar.xz
9 /byacc-20260126.tgz
+2,
-0
1@@ -5,6 +5,8 @@ Generated with
2
3 ./configure \
4 --without-pymalloc \
5+ --without-mimalloc \
6+ --without-remote-debug \
7 --with-builtin-hashlib-hashes='sha3,blake2' \
8 --with-ssl-default-suites='TLSv1.3:TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE' \
9 ax_cv_c_float_words_bigendian=no
+94,
-18
1@@ -1,8 +1,13 @@
2 cflags{
3+ '-std=c11', -- otherwise Modules/mathmodule.c tries to use C23 issubnormal
4 '-D NDEBUG',
5 '-I $dir',
6+ '-I $srcdir',
7 '-I $srcdir/Include',
8 '-I $srcdir/Include/internal',
9+ '-I $srcdir/Modules/_hacl',
10+ '-I $srcdir/Modules/_hacl/include',
11+ '-I $srcdir/Modules/expat',
12 '-isystem $builddir/pkg/linux-headers/include',
13 }
14
15@@ -18,25 +23,28 @@ end
16 if modules._hashlib then
17 cflags{'-isystem $builddir/pkg/bearssl/include'}
18 table.insert(pkg.deps, 'pkg/bearssl/headers')
19- table.insert(libs, 'bearssl/libbearssl.a')
20+ table.insert(libs, '$builddir/pkg/bearssl/libbearssl.a')
21 end
22 if modules._ssl then
23 cflags{'-isystem $builddir/pkg/libressl/include'}
24 table.insert(pkg.deps, 'pkg/libressl/headers')
25 table.insert(libs, {
26- 'libressl/libssl.a',
27- 'libressl/libcrypto.a',
28+ '$builddir/pkg/libressl/libssl.a',
29+ '$builddir/pkg/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+ table.insert(libs, '$builddir/pkg/expat/libexpat.a.d')
37 end
38 if modules.zlib then
39 cflags{'-isystem $builddir/pkg/zlib/include'}
40 table.insert(pkg.deps, 'pkg/zlib/headers')
41- table.insert(libs, 'zlib/libz.a')
42+ table.insert(libs, '$builddir/pkg/zlib/libz.a')
43+end
44+if modules._blake2 or modules._sha3 then
45+ table.insert(libs, 'libhacl.a')
46 end
47
48 local srcs = {}
49@@ -61,7 +69,7 @@ rule('makesetup', 'lua $dir/makesetup.lua $dir/modules.lua <$in >$out')
50 build('makesetup', '$outdir/config.c', {'$srcdir/Modules/config.c.in', '|', '$dir/makesetup.lua', '$dir/modules.lua'})
51
52 cc('Modules/getbuildinfo.c', nil, {
53- cflags=[[$cflags -D 'DATE="Oct 4 2021"' -D 'TIME="18:40:47"']]
54+ cflags=[[$cflags -D 'DATE="Oct 21 2026"' -D 'TIME="08:54:43"']]
55 })
56 cc('Modules/getpath.c', nil, {
57 cflags={
58@@ -69,8 +77,9 @@ cc('Modules/getpath.c', nil, {
59 [[-D 'PYTHONPATH=":plat-linux"']],
60 [[-D 'PREFIX="/"']],
61 [[-D 'EXEC_PREFIX="/"']],
62- [[-D 'VERSION="3.10"']],
63+ [[-D 'VERSION="3.15"']],
64 [[-D 'VPATH=""']],
65+ [[-D 'PLATLIBDIR="lib"']],
66 },
67 })
68
69@@ -94,6 +103,18 @@ cc('Python/sysmodule.c', nil, {
70 cflags=string.format([[$cflags -D 'ABIFLAGS="%s"']], abiflags),
71 })
72
73+cc('Modules/_hacl/Lib_Memzero0.c', nil, {
74+ cflags='$cflags -D _GNU_SOURCE',
75+})
76+lib('libhacl.a', [[
77+ Modules/_hacl/(
78+ Hacl_Hash_SHA3.c
79+ Hacl_Hash_Blake2s.c
80+ Hacl_Hash_Blake2b.c
81+ Lib_Memzero0.c.o
82+ )
83+]])
84+
85 lib('libpython.a', {expand{'Modules/', srcs}, paths[[
86 Modules/(
87 getbuildinfo.c.o
88@@ -103,7 +124,6 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[
89 )
90 Objects/(
91 abstract.c
92- accu.c
93 boolobject.c
94 bytes_methods.c
95 bytearrayobject.c
96@@ -123,8 +143,9 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[
97 floatobject.c
98 frameobject.c
99 funcobject.c
100- interpreteridobject.c
101+ interpolationobject.c
102 iterobject.c
103+ lazyimportobject.c
104 listobject.c
105 longobject.c
106 dictobject.c
107@@ -137,54 +158,97 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[
108 obmalloc.c
109 picklebufobject.c
110 rangeobject.c
111+ sentinelobject.c
112 setobject.c
113 sliceobject.c
114 structseq.c
115+ templateobject.c
116 tupleobject.c
117 typeobject.c
118- unicodeobject.c
119+ typevarobject.c
120+ unicode_format.c
121+ unicode_formatter.c
122+ unicode_writer.c
123 unicodectype.c
124+ unicodeobject.c
125 unionobject.c
126 weakrefobject.c
127 )
128 Parser/(
129 token.c
130 pegen.c
131+ pegen_errors.c
132+ action_helpers.c
133 parser.c
134 string_parser.c
135 peg_api.c
136+ lexer/(buffer.c lexer.c state.c)
137+ tokenizer/(
138+ file_tokenizer.c
139+ readline_tokenizer.c
140+ string_tokenizer.c
141+ utf8_tokenizer.c
142+ helpers.c
143+ )
144 myreadline.c
145- tokenizer.c
146 )
147 Python/(
148+ _contextvars.c
149 _warnings.c
150 Python-ast.c
151+ Python-tokenize.c
152 asdl.c
153+ assemble.c
154 ast.c
155- ast_opt.c
156+ ast_preprocess.c
157 ast_unparse.c
158 bltinmodule.c
159+ brc.c
160 ceval.c
161 codecs.c
162+ codegen.c
163 compile.c
164 context.c
165+ critical_section.c
166+ crossinterp.c
167+ dynamic_annotations.c
168 errors.c
169+ flowgraph.c
170+ frame.c
171 frozenmain.c
172 future.c
173+ gc.c
174+ gc_free_threading.c
175+ gc_gil.c
176 getargs.c
177 getcompiler.c
178 getcopyright.c
179 getplatform.c.o
180 getversion.c
181+ ceval_gil.c
182 hamt.c
183 hashtable.c
184 import.c
185 importdl.c
186+ index_pool.c
187 initconfig.c.o
188+ interpconfig.c
189+ instrumentation.c
190+ instruction_sequence.c
191+ intrinsics.c
192+ jit.c
193+ jit_publish.c
194+ legacy_tracing.c
195+ lock.c
196 marshal.c
197 modsupport.c
198 mysnprintf.c
199 mystrtoul.c
200+ object_stack.c
201+ optimizer.c
202+ optimizer_analysis.c
203+ optimizer_symbols.c
204+ parking_lot.c
205 pathconfig.c
206 preconfig.c
207 pyarena.c
208@@ -194,29 +258,41 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[
209 pylifecycle.c
210 pymath.c
211 pystate.c
212+ pystats.c
213 pythonrun.c
214 pytime.c
215+ qsbr.c
216 bootstrap_hash.c
217+ specialize.c
218+ slots.c
219+ slots_generated.c
220+ stackrefs.c
221 structmember.c
222 symtable.c
223 sysmodule.c.o
224 thread.c
225 traceback.c
226+ tracemalloc.c
227+ uniqueid.c
228 getopt.c
229 pystrcmp.c
230 pystrtod.c
231 pystrhex.c
232 dtoa.c
233- formatter_unicode.c
234 fileutils.c
235 suggestions.c
236+ perf_trampoline.c
237+ perf_jit_trampoline.c
238+ jit_unwind.c
239+ remote_debugging.c
240 dynload_stub.c
241+
242 frozen.c
243 )
244 $outdir/config.c
245 ]]})
246
247-exe('python', {'Programs/python.c', 'libpython.a', expand{'$builddir/pkg/', libs}})
248+exe('python', {'Programs/python.c', 'libpython.a', libs})
249 file('bin/python3', '755', '$outdir/python')
250 sym('bin/python', 'python3')
251
252@@ -225,10 +301,10 @@ man{'$outdir/python3.1'}
253 sym('share/man/man1/python.1.gz', 'python3.1.gz')
254
255 for f in iterlines('pylibs.txt') do
256- file('lib/python3.10/'..f, '644', '$srcdir/Lib/'..f)
257+ file('lib/python3.15/'..f, '644', '$srcdir/Lib/'..f)
258 end
259-file('lib/python3.10/_sysconfigdata_'..abiflags..'_'..platform..'_.py', '644', '$dir/lib/_sysconfigdata.py')
260-file('lib/python3.10/Makefile', '644', '$dir/lib/Makefile')
261-dir('lib/python3.10/lib-dynload', '755')
262+file('lib/python3.15/_sysconfigdata_'..abiflags..'_'..platform..'_.py', '644', '$dir/lib/_sysconfigdata.py')
263+file('lib/python3.15/Makefile', '644', '$dir/lib/Makefile')
264+dir('lib/python3.15/lib-dynload', '755')
265
266 fetch 'curl'
+1,
-0
1@@ -1,2 +1,3 @@
2 build_time_vars = {
3+ 'EXE': '',
4 }
+95,
-81
1@@ -1,22 +1,16 @@
2 return {
3- -- Modules/Setup
4+ -- Modules/Setup.bootstrap.in
5+ atexit={'atexitmodule.c'},
6+ faulthandler={'faulthandler.c'},
7 posix={'posixmodule.c'},
8- errno={'errnomodule.c'},
9- pwd={'pwdmodule.c'},
10- _sre={'_sre.c'},
11+ _signal={'signalmodule.c'},
12+ _tracemalloc={'_tracemalloc.c'},
13+ _suggestions={'_suggestions.c'},
14+ _datetime={'_datetimemodule.c'},
15+
16 _codecs={'_codecsmodule.c'},
17- _weakref={'_weakref.c'},
18- _functools={'_functoolsmodule.c'},
19- _operator={'_operator.c'},
20 _collections={'_collectionsmodule.c'},
21- _abc={'_abc.c'},
22- itertools={'itertoolsmodule.c'},
23- atexit={'atexitmodule.c'},
24- _signal={'signalmodule.c'},
25- _stat={'_stat.c'},
26- time={'timemodule.c'},
27- _thread={'_threadmodule.c'},
28- _locale={'_localemodule.c'},
29+ errno={'errnomodule.c'},
30 _io={
31 '_io/_iomodule.c',
32 '_io/iobase.c',
33@@ -26,90 +20,110 @@ return {
34 '_io/textio.c',
35 '_io/stringio.c',
36 },
37- faulthandler={'faulthandler.c'},
38- _tracemalloc={'_tracemalloc.c'},
39+ itertools={'itertoolsmodule.c'},
40+ _sre={'_sre/sre.c'},
41+ _sysconfig={'_sysconfig.c'},
42+ _thread={'_threadmodule.c'},
43+ time={'timemodule.c'},
44+ _types={'_typesmodule.c'},
45+ _typing={'_typingmodule.c'},
46+ _weakref={'_weakref.c'},
47+
48+ _abc={'_abc.c'},
49+ _functools={'_functoolsmodule.c'},
50+ _locale={'_localemodule.c'},
51+ _opcode={'_opcode.c'},
52+ _operator={'_operator.c'},
53+ _stat={'_stat.c'},
54 --_symtable={'symtablemodule.c'},
55- --xxsubtype={'xxsubtype.c'},
56
57- -- setup.py:/Extension
58+ pwd={'pwdmodule.c'},
59+
60+ -- Modules/Setup.stdlib.in
61 array={'arraymodule.c'},
62- _contextvars={'_contextvarsmodule.c'},
63- math={'mathmodule.c', '_math.c'},
64- cmath={'cmathmodule.c', '_math.c'},
65- -- time defined above
66- _datetime={'_datetimemodule.c'},
67- _zoneinfo={'_zoneinfo.c'},
68- _random={'_randommodule.c'},
69 _bisect={'_bisectmodule.c'},
70+ _csv={'_csv.c'},
71 _heapq={'_heapqmodule.c'},
72- _pickle={'_pickle.c'},
73 _json={'_json.c'},
74 --_lsprof={'_lsprof.c', 'rotatingtree.c'},
75- unicodedata={'unicodedata.c'},
76- _opcode={'_opcode.c'},
77- _asyncio={'_asynciomodule.c'},
78- _abc={'_abc.c'},
79+ _math_integer={'mathintegermodule.c'},
80+ _pickle={'_pickle.c'},
81 _queue={'_queuemodule.c'},
82+ _random={'_randommodule.c'},
83+ --_remote_debugging={'_remote_debugging_module.c', '_remote_debugging/gc_stats.c', '_remote_debugging/object_reading.c', '_remote_debugging/code_objects.c', '_remote_debugging/frames.c', '_remote_debugging/frame_cache.c', '_remote_debugging/threads.c', '_remote_debugging/asyncio.c', 'remote_debugging/binary_io_writer.c', 'remote_debugging/binary_io_reader.c', 'remote_debugging/subprocess.c', 'remote_debugging/interpreters.c'},
84+ _struct={'_struct.c'},
85+
86+ --_interpreters={'_interpretersmodule.c'},
87+ --_interpchannels={'_interpchannelsmodule.c'},
88+ --_interpqueues={'_interpqueuesmodule.c'},
89+
90+ _zoneinfo={'_zoneinfo.c'},
91+
92+ math={'mathmodule.c'},
93+ cmath={'cmathmodule.c'},
94 _statistics={'_statisticsmodule.c'},
95- fcntl={'fcntlmodule.c'},
96- -- pwd defined above
97- grp={'grpmodule.c'},
98- spwd={'spwdmodule.c'},
99- select={'selectmodule.c'},
100- mmap={'mmapmodule.c'},
101- --syslog={'syslogmodule.c'},
102- --_xxsubinterpreters={'_xxsubinterpretersmodule.c'},
103- --audioop={'audioop.c'},
104- _csv={'_csv.c'},
105- _posixsubprocess={'_posixsubprocess.c'},
106- --_testcapi={'_testcapimodule.c'},
107- --_testinternalcapi={'_testinternalcapi.c'},
108- --_testbuffer={'_testbuffer.c'},
109- --_testimportmultiple={'_testimportmultiple.c'},
110- --_testmultiphase={'_testmultiphase.c'},
111- --_xxtestfuzz={'_xxtestfuzz/_xxtestfuzz.c', '_xxtestfuzz/fuzzer.c'},
112- --readline={'readline.c'},
113- --_curses={'_cursesmodule.c'},
114- --_curses_panel={'_curses_panel.c'},
115- _crypt={'_cryptmodule.c'},
116- _socket={'socketmodule.c'},
117- --_dbm={'_dbmmodule.c'},
118- --_gdbm={'_gdbmmodule.c'},
119- --_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'},
120- termios={'termios.c'},
121- resource={'resource.c'},
122- --ossaudiodev={'ossaudiodev.c'},
123- --_scproxy={'_scproxy.c'},
124- zlib={'zlibmodule.c'},
125+
126+ --_decimal={'_decimal/_decimal.c'},
127+
128 binascii={'binascii.c'},
129 --_bz2={'_bz2module.c'},
130 --_lzma={'_lzmamodule.c'},
131- pyexpat={'pyexpat.c'},
132+ --_zstd={'_zstd/module.c', '_zstd/zstddict.c', '_zstd/compressor.c', '_zstd/decompressor.c'},
133+ zlib={'zlibmodule.c'},
134+
135+ --_dbm={'_dbmmodule.c'},
136+ --_gdbm={'_gdbmmodule.c'},
137+
138+ --readline={'readline.c'},
139+
140+ --_md5={'md5module.c'},
141+ --_sha1={'sha1module.c'},
142+ --_sha256={'sha256module.c'},
143+ --_sha512={'sha512module.c'},
144+ _sha3={'sha3module.c'},
145+ _blake2={'blake2module.c'},
146+
147+ --_hmac={'hmacmodule.c'},
148+
149+ pyexpat={'pyexpat.c', 'expat/xcs.c', 'expat/xmlparse.c', 'expat/xmlrole.c', 'expat/xmltok.c'},
150+
151 --_elementtree={'_elementtree.c'},
152- --_multibytecodec={'cjkcodecs/multibytecodec.c'},
153- --_codecs_kr={'cjkcodecs/_codecs_kr.c'},
154- --_codecs_jp={'cjkcodecs/_codecs_jp.c'},
155+
156 --_codecs_cn={'cjkcodecs/_codecs_cn.c'},
157- --_codecs_tw={'cjkcodecs/_codecs_tw.c'},
158 --_codecs_hk={'cjkcodecs/_codecs_hk.c'},
159 --_codecs_iso2022={'cjkcodecs/_codecs_iso2022.c'},
160- _multiprocessing={'_multiprocessing/multiprocessing.c', '_multiprocessing/semaphore.c'},
161+ --_codecs_jp={'cjkcodecs/_codecs_jp.c'},
162+ --_codecs_kr={'cjkcodecs/_codecs_kr.c'},
163+ --_codecs_tw={'cjkcodecs/_codecs_tw.c'},
164+ --_multibytecodec={'cjkcodecs/multibytecodec.c'},
165+ unicodedata={'unicodedata.c'},
166+
167+ fcntl={'fcntlmodule.c'},
168+ grp={'grpmodule.c'},
169+ mmap={'mmapmodule.c'},
170+ _posixsubprocess={'_posixsubprocess.c'},
171+ resource={'resource.c'},
172+ select={'selectmodule.c'},
173+ _socket={'socketmodule.c'},
174+ --syslog={'syslogmodule.c'},
175+ termios={'termios.c'},
176+
177 _posixshmem={'_multiprocessing/posixshmem.c'},
178- --_uuid={'_uuidmodule.c'},
179- --xxlimited={'xxlimited.c'},
180- --xxlimited_35={'xxlimited_35.c'},
181- --_tkinter={'_tkinter.c', 'tkappinit.c'},
182+ _multiprocessing={'_multiprocessing/multiprocessing.c', '_multiprocessing/semaphore.c'},
183+
184 --_ctypes={'_ctypes/_ctypes.c', '_ctypes/callbacks.c', '_ctypes/callproc.c', '_ctypes/stgdict.c', '_ctypes/cfield.c'},
185- --_ctypes_test={'_ctypes/_ctypes_test.c'},
186- --_decimal={'_decimal/_decimal.c'},
187+
188+ --_curses={'_cursesmodule.c'},
189+ --_curses_panel={'_curses_panel.c'},
190+
191+ --_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'},
192+
193 _ssl={'_ssl.c'},
194 _hashlib={'_hashbearssl.c'},
195- --_sha256={'sha256module.c'},
196- --_sha512={'sha512module.c'},
197- --_md5={'md5module.c'},
198- --_sha1={'sha1module.c'},
199- _blake2={'_blake2/blake2module.c', '_blake2/blake2b_impl.c', '_blake2/blake2s_impl.c'},
200- _sha3={'_sha3/sha3module.c'},
201- --nis={'nismodule.c'},
202- _struct={'_struct.c'},
203+
204+ --_uuid={'_uuidmodule.c'},
205+
206+ --_tkinter={'_tkinter.c', 'tkappinit.c'},
207+
208+ _asyncio={'_asynciomodule.c'},
209 }
1@@ -1,83 +1,87 @@
2-From 61ad7f5ec78d4c80a99ac71820d9bc8b62c3fbae Mon Sep 17 00:00:00 2001
3+From 3d3b232e1359e189884cac83095b06312e3c82e0 Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Sat, 15 May 2021 22:48:13 -0700
6 Subject: [PATCH] Add BearSSL implementation of _hashlib
7
8 ---
9- Modules/_hashbearssl.c | 1126 +++++++++++++++++++++++++++++++
10- Modules/clinic/_hashbearssl.c.h | 1113 ++++++++++++++++++++++++++++++
11- 2 files changed, 2239 insertions(+)
12+ Modules/_hashbearssl.c | 1129 +++++++++++++++++++++++++
13+ Modules/clinic/_hashbearssl.c.h | 1401 +++++++++++++++++++++++++++++++
14+ 2 files changed, 2530 insertions(+)
15 create mode 100644 Modules/_hashbearssl.c
16 create mode 100644 Modules/clinic/_hashbearssl.c.h
17
18 diff --git a/Modules/_hashbearssl.c b/Modules/_hashbearssl.c
19 new file mode 100644
20-index 0000000000..2d1a76296d
21+index 00000000000..543fb2c0813
22 --- /dev/null
23 +++ b/Modules/_hashbearssl.c
24-@@ -0,0 +1,1126 @@
25+@@ -0,0 +1,1129 @@
26 +/* Module that wraps all BearSSL hash algorithms */
27-+#define PY_SSIZE_T_CLEAN
28++#ifndef Py_BUILD_CORE_BUILTIN
29++# define Py_BUILD_CORE_MODULE 1
30++#endif
31 +#include "Python.h"
32++#include "pycore_strhex.h" // _Py_strhex()
33 +#include "hashlib.h"
34-+#include "pystrhex.h"
35 +
36 +#include <bearssl.h>
37 +
38 +static PyModuleDef _hashlibmodule;
39-+static PyTypeObject Hash_Type;
40-+static PyTypeObject SHAKE_Type;
41++static PyTypeObject HASH_Type;
42++static PyTypeObject HASHXOF_Type;
43 +static PyTypeObject HMAC_Type;
44 +
45++// --- Module objects ---------------------------------------------------------
46++
47 +typedef struct {
48-+ PyObject_HEAD
49++ HASHLIB_OBJECT_HEAD
50 + br_hash_compat_context ctx;
51-+ PyThread_type_lock lock;
52-+} Hash;
53++} HASH;
54 +
55 +typedef struct {
56-+ PyObject_HEAD
57++ HASHLIB_OBJECT_HEAD
58 + br_hmac_context ctx;
59 + br_hmac_key_context key;
60-+ PyThread_type_lock lock;
61 +} HMAC;
62 +
63 +typedef struct {
64-+ PyObject_HEAD
65++ HASHLIB_OBJECT_HEAD
66 + br_shake_context ctx;
67 + int bits;
68-+ PyThread_type_lock lock;
69-+} SHAKE;
70++} HASHXOF;
71++
72++// --- Module clinic configuration --------------------------------------------
73 +
74-+#include "clinic/_hashbearssl.c.h"
75 +/*[clinic input]
76 +module _hashlib
77-+class _hashlib.Hash "Hash *" "Hash_Type"
78++class _hashlib.HASH "HASH *" "HASH_Type"
79++class _hashlib.HASHXOF "HASHXOF *" "HASHXOF_Type"
80 +class _hashlib.HMAC "HMAC *" "HMAC_Type"
81-+class _hashlib.SHAKE "SHAKE *" "SHAKE_Type"
82 +[clinic start generated code]*/
83-+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7a269412ec77c79a]*/
84++/*[clinic end generated code: output=da39a3ee5e6b4b0d input=213641e4849871ea]*/
85++
86++#include "clinic/_hashbearssl.c.h"
87 +
88 +static const br_hash_class *
89 +py_hash_by_name(const char *name)
90 +{
91-+ if (strcmp(name, "md5") == 0)
92++ if (PyOS_stricmp(name, "md5") == 0)
93 + return &br_md5_vtable;
94-+ else if (strcmp(name, "sha1") == 0)
95++ else if (PyOS_stricmp(name, "sha1") == 0)
96 + return &br_sha1_vtable;
97-+ else if (strcmp(name, "sha224") == 0)
98++ else if (PyOS_stricmp(name, "sha224") == 0)
99 + return &br_sha224_vtable;
100-+ else if (strcmp(name, "sha256") == 0)
101++ else if (PyOS_stricmp(name, "sha256") == 0)
102 + return &br_sha256_vtable;
103-+ else if (strcmp(name, "sha384") == 0)
104++ else if (PyOS_stricmp(name, "sha384") == 0)
105 + return &br_sha384_vtable;
106-+ else if (strcmp(name, "sha512") == 0)
107++ else if (PyOS_stricmp(name, "sha512") == 0)
108 + return &br_sha512_vtable;
109 + return NULL;
110 +}
111 +
112-+PyDoc_STRVAR(Hash_doc,
113-+"Hash(name, string=b\'\')\n"
114++PyDoc_STRVAR(HASH_doc,
115++"HASH(name, string=b\'\')\n"
116 +"--\n"
117 +"\n"
118 +"A hash is an object used to calculate a checksum of a string of information.\n"
119@@ -95,15 +99,13 @@ index 0000000000..2d1a76296d
120 +"digest_size -- number of bytes in this hashes output");
121 +
122 +static void
123-+Hash_dealloc(Hash *self)
124++HASH_dealloc(HASH *self)
125 +{
126-+ if (self->lock)
127-+ PyThread_free_lock(self->lock);
128 + PyObject_Free(self);
129 +}
130 +
131 +/*[clinic input]
132-+_hashlib.Hash.update as Hash_update
133++_hashlib.HASH.update as HASH_update
134 +
135 + data: Py_buffer
136 + /
137@@ -112,89 +114,82 @@ index 0000000000..2d1a76296d
138 +[clinic start generated code]*/
139 +
140 +static PyObject *
141-+Hash_update_impl(Hash *self, Py_buffer *data)
142-+/*[clinic end generated code: output=eed11f7503e289a3 input=0547d16ba3981abf]*/
143++HASH_update_impl(HASH *self, Py_buffer *data)
144++/*[clinic end generated code: output=e7371e3b82c78813 input=8d134669e7bfa813]*/
145 +{
146-+ if (!self->lock && data->len >= HASHLIB_GIL_MINSIZE)
147-+ self->lock = PyThread_allocate_lock();
148-+ if (self->lock) {
149-+ Py_BEGIN_ALLOW_THREADS
150-+ PyThread_acquire_lock(self->lock, 1);
151-+ self->ctx.vtable->update(&self->ctx.vtable, data->buf, data->len);
152-+ PyThread_release_lock(self->lock);
153-+ Py_END_ALLOW_THREADS
154-+ } else {
155-+ self->ctx.vtable->update(&self->ctx.vtable, data->buf, data->len);
156-+ }
157++ HASHLIB_EXTERNAL_INSTRUCTIONS_LOCKED(
158++ self, data->len,
159++ self->ctx.vtable->update(&self->ctx.vtable, data->buf, data->len)
160++ );
161 + Py_RETURN_NONE;
162 +}
163 +
164 +/*[clinic input]
165-+_hashlib.Hash.digest as Hash_digest
166++_hashlib.HASH.digest as HASH_digest
167 +
168 +Return the digest value as a bytes object.
169 +[clinic start generated code]*/
170 +
171 +static PyObject *
172-+Hash_digest_impl(Hash *self)
173-+/*[clinic end generated code: output=b3eafdc9f37cf341 input=6d4afcd832edc55a]*/
174++HASH_digest_impl(HASH *self)
175++/*[clinic end generated code: output=b48bf00fd5875e49 input=9279858aec58f77a]*/
176 +{
177 + char digest[64];
178 + Py_ssize_t digest_size;
179 +
180-+ ENTER_HASHLIB(self)
181++ HASHLIB_ACQUIRE_LOCK(self);
182 + self->ctx.vtable->out(&self->ctx.vtable, digest);
183-+ LEAVE_HASHLIB(self)
184++ HASHLIB_RELEASE_LOCK(self);
185 + digest_size = (self->ctx.vtable->desc >> BR_HASHDESC_OUT_OFF) & BR_HASHDESC_OUT_MASK;
186 +
187 + return PyBytes_FromStringAndSize(digest, digest_size);
188 +}
189 +
190 +/*[clinic input]
191-+_hashlib.Hash.hexdigest as Hash_hexdigest
192++_hashlib.HASH.hexdigest as HASH_hexdigest
193 +
194 +Return the digest value as a string of hexadecimal digits.
195 +[clinic start generated code]*/
196 +
197 +static PyObject *
198-+Hash_hexdigest_impl(Hash *self)
199-+/*[clinic end generated code: output=eff810494302910a input=6b224236fad6ff65]*/
200++HASH_hexdigest_impl(HASH *self)
201++/*[clinic end generated code: output=c94a721f9bd8a703 input=2947eb48a8cb30b8]*/
202 +{
203 + char digest[64];
204 + Py_ssize_t digest_size;
205 +
206-+ ENTER_HASHLIB(self)
207++ HASHLIB_ACQUIRE_LOCK(self);
208 + self->ctx.vtable->out(&self->ctx.vtable, digest);
209-+ LEAVE_HASHLIB(self)
210++ HASHLIB_RELEASE_LOCK(self);
211 + digest_size = (self->ctx.vtable->desc >> BR_HASHDESC_OUT_OFF) & BR_HASHDESC_OUT_MASK;
212 +
213 + return _Py_strhex(digest, digest_size);
214 +}
215 +
216 +/*[clinic input]
217-+_hashlib.Hash.copy as Hash_copy
218++_hashlib.HASH.copy as HASH_copy
219 +
220 +Return a copy of the hash object.
221 +[clinic start generated code]*/
222 +
223 +static PyObject *
224-+Hash_copy_impl(Hash *self)
225-+/*[clinic end generated code: output=e97863340f55061b input=b830c9d949d08256]*/
226++HASH_copy_impl(HASH *self)
227++/*[clinic end generated code: output=83f55894ab63fa16 input=648c01014857e870]*/
228 +{
229-+ Hash *newobj;
230++ HASH *newobj;
231 +
232-+ newobj = PyObject_New(Hash, &Hash_Type);
233++ newobj = PyObject_New(HASH, &HASH_Type);
234 + if (!newobj)
235 + return NULL;
236-+ newobj->lock = NULL;
237-+ ENTER_HASHLIB(self)
238++ HASHLIB_INIT_MUTEX(newobj);
239++ HASHLIB_ACQUIRE_LOCK(self);
240 + newobj->ctx = self->ctx;
241-+ LEAVE_HASHLIB(self)
242++ HASHLIB_RELEASE_LOCK(self);
243 +
244 + return (PyObject *)newobj;
245 +}
246 +
247-+static PyMethodDef Hash_methods[] = {
248++static PyMethodDef HASH_methods[] = {
249 + HASH_UPDATE_METHODDEF
250 + HASH_DIGEST_METHODDEF
251 + HASH_HEXDIGEST_METHODDEF
252@@ -203,7 +198,7 @@ index 0000000000..2d1a76296d
253 +};
254 +
255 +static PyObject *
256-+Hash_get_digest_size(Hash *self, void *closure)
257++HASH_get_digest_size(HASH *self, void *closure)
258 +{
259 + long digest_size;
260 +
261@@ -212,7 +207,7 @@ index 0000000000..2d1a76296d
262 +}
263 +
264 +static PyObject *
265-+Hash_get_block_size(Hash *self, void *closure)
266++HASH_get_block_size(HASH *self, void *closure)
267 +{
268 + long block_size;
269 +
270@@ -221,7 +216,7 @@ index 0000000000..2d1a76296d
271 +}
272 +
273 +static PyObject *
274-+Hash_get_name(Hash *self, void *closure)
275++HASH_get_name(HASH *self, void *closure)
276 +{
277 + const char *name = NULL;
278 +
279@@ -237,26 +232,40 @@ index 0000000000..2d1a76296d
280 + return PyUnicode_FromString(name);
281 +}
282 +
283-+static PyGetSetDef Hash_getset[] = {
284-+ {"digest_size", (getter)Hash_get_digest_size, NULL, NULL, NULL},
285-+ {"block_size", (getter)Hash_get_block_size, NULL, NULL, NULL},
286-+ {"name", (getter)Hash_get_name, NULL, NULL, NULL},
287++static PyGetSetDef HASH_getset[] = {
288++ {"digest_size", (getter)HASH_get_digest_size, NULL, NULL, NULL},
289++ {"block_size", (getter)HASH_get_block_size, NULL, NULL, NULL},
290++ {"name", (getter)HASH_get_name, NULL, NULL, NULL},
291 + {0}
292 +};
293 +
294-+static PyTypeObject Hash_Type = {
295++static PyObject *
296++HASH_repr(HASH *self)
297++{
298++ PyObject *name = HASH_get_name(self, NULL);
299++ if (name == NULL) {
300++ return NULL;
301++ }
302++ PyObject *repr = PyUnicode_FromFormat("<%U %T object @ %p>",
303++ name, self, self);
304++ Py_DECREF(name);
305++ return repr;
306++}
307++
308++static PyTypeObject HASH_Type = {
309 + PyVarObject_HEAD_INIT(NULL, 0)
310-+ .tp_name = "_hashlib.Hash",
311-+ .tp_dealloc = (destructor)Hash_dealloc,
312-+ .tp_doc = Hash_doc,
313-+ .tp_basicsize = sizeof(Hash),
314++ .tp_name = "_hashlib.HASH",
315++ .tp_dealloc = (destructor)HASH_dealloc,
316++ .tp_repr = (reprfunc)HASH_repr,
317++ .tp_doc = HASH_doc,
318++ .tp_basicsize = sizeof(HASH),
319 + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
320-+ .tp_methods = Hash_methods,
321-+ .tp_getset = Hash_getset,
322++ .tp_methods = HASH_methods,
323++ .tp_getset = HASH_getset,
324 +};
325 +
326-+PyDoc_STRVAR(SHAKE_doc,
327-+"SHAKE(name, string=b\'\')\n"
328++PyDoc_STRVAR(HASHXOF_doc,
329++"HASHXOF(name, string=b\'\')\n"
330 +"--\n"
331 +"\n"
332 +"A hash is an object used to calculate a checksum of a string of information.\n"
333@@ -274,15 +283,13 @@ index 0000000000..2d1a76296d
334 +"digest_size -- number of bytes in this hashes output");
335 +
336 +static void
337-+SHAKE_dealloc(SHAKE *self)
338++HASHXOF_dealloc(HASHXOF *self)
339 +{
340-+ if (self->lock)
341-+ PyThread_free_lock(self->lock);
342 + PyObject_Free(self);
343 +}
344 +
345 +/*[clinic input]
346-+_hashlib.SHAKE.update as SHAKE_update
347++_hashlib.HASHXOF.update as HASHXOF_update
348 +
349 + data: Py_buffer
350 + /
351@@ -291,34 +298,27 @@ index 0000000000..2d1a76296d
352 +[clinic start generated code]*/
353 +
354 +static PyObject *
355-+SHAKE_update_impl(SHAKE *self, Py_buffer *data)
356-+/*[clinic end generated code: output=b7f5cd67459e2fb3 input=87a80642380b615f]*/
357++HASHXOF_update_impl(HASHXOF *self, Py_buffer *data)
358++/*[clinic end generated code: output=284c614570e39dcf input=8f56a60e5e1d5126]*/
359 +{
360-+ if (!self->lock && data->len >= HASHLIB_GIL_MINSIZE)
361-+ self->lock = PyThread_allocate_lock();
362-+ if (self->lock) {
363-+ Py_BEGIN_ALLOW_THREADS
364-+ PyThread_acquire_lock(self->lock, 1);
365-+ br_shake_inject(&self->ctx, data->buf, data->len);
366-+ PyThread_release_lock(self->lock);
367-+ Py_END_ALLOW_THREADS
368-+ } else {
369-+ br_shake_inject(&self->ctx, data->buf, data->len);
370-+ }
371++ HASHLIB_EXTERNAL_INSTRUCTIONS_LOCKED(
372++ self, data->len,
373++ br_shake_inject(&self->ctx, data->buf, data->len)
374++ );
375 + Py_RETURN_NONE;
376 +}
377 +
378 +/*[clinic input]
379-+_hashlib.SHAKE.digest as SHAKE_digest
380++_hashlib.HASHXOF.digest as HASHXOF_digest
381 +
382-+ length: Py_ssize_t
383++ length: Py_ssize_t(allow_negative=False)
384 +
385 +Return the digest value as a bytes object.
386 +[clinic start generated code]*/
387 +
388 +static PyObject *
389-+SHAKE_digest_impl(SHAKE *self, Py_ssize_t length)
390-+/*[clinic end generated code: output=4235ee593cba0b23 input=9e31587954f5e87a]*/
391++HASHXOF_digest_impl(HASHXOF *self, Py_ssize_t length)
392++/*[clinic end generated code: output=4acfde5485438ea1 input=57648448f97345a9]*/
393 +{
394 + br_shake_context ctx;
395 + PyObject *bytes;
396@@ -327,9 +327,9 @@ index 0000000000..2d1a76296d
397 + if (!bytes)
398 + return NULL;
399 +
400-+ ENTER_HASHLIB(self)
401++ HASHLIB_ACQUIRE_LOCK(self);
402 + ctx = self->ctx;
403-+ LEAVE_HASHLIB(self)
404++ HASHLIB_RELEASE_LOCK(self);
405 + br_shake_flip(&ctx);
406 + br_shake_produce(&ctx, PyBytes_AS_STRING(bytes), length);
407 +
408@@ -337,16 +337,16 @@ index 0000000000..2d1a76296d
409 +}
410 +
411 +/*[clinic input]
412-+_hashlib.SHAKE.hexdigest as SHAKE_hexdigest
413++_hashlib.HASHXOF.hexdigest as HASHXOF_hexdigest
414 +
415-+ length: Py_ssize_t
416++ length: Py_ssize_t(allow_negative=False)
417 +
418 +Return the digest value as a string of hexadecimal digits.
419 +[clinic start generated code]*/
420 +
421 +static PyObject *
422-+SHAKE_hexdigest_impl(SHAKE *self, Py_ssize_t length)
423-+/*[clinic end generated code: output=fd9a7905a89a1509 input=2c43a9638ca1db5e]*/
424++HASHXOF_hexdigest_impl(HASHXOF *self, Py_ssize_t length)
425++/*[clinic end generated code: output=6ca89e7ccb71e4fc input=c341a60302ee6e78]*/
426 +{
427 + br_shake_context ctx;
428 + char *bytes;
429@@ -358,9 +358,9 @@ index 0000000000..2d1a76296d
430 + return NULL;
431 + }
432 +
433-+ ENTER_HASHLIB(self)
434++ HASHLIB_ACQUIRE_LOCK(self);
435 + ctx = self->ctx;
436-+ LEAVE_HASHLIB(self)
437++ HASHLIB_RELEASE_LOCK(self);
438 + br_shake_flip(&ctx);
439 + br_shake_produce(&ctx, bytes, length);
440 +
441@@ -370,51 +370,51 @@ index 0000000000..2d1a76296d
442 +}
443 +
444 +/*[clinic input]
445-+_hashlib.SHAKE.copy as SHAKE_copy
446++_hashlib.HASHXOF.copy as HASHXOF_copy
447 +
448-+Return a copy of the SHAKE object.
449++Return a copy of the HASHXOF object.
450 +[clinic start generated code]*/
451 +
452 +static PyObject *
453-+SHAKE_copy_impl(SHAKE *self)
454-+/*[clinic end generated code: output=19cff23538f29dc6 input=34c8368c5c9e910c]*/
455++HASHXOF_copy_impl(HASHXOF *self)
456++/*[clinic end generated code: output=26a3ae2ab4f72986 input=c7ae6f5b7497f72e]*/
457 +{
458-+ SHAKE *newobj;
459++ HASHXOF *newobj;
460 +
461-+ newobj = PyObject_New(SHAKE, &SHAKE_Type);
462++ newobj = PyObject_New(HASHXOF, &HASHXOF_Type);
463 + if (!newobj)
464 + return NULL;
465-+ newobj->lock = NULL;
466-+ ENTER_HASHLIB(self)
467++ HASHLIB_INIT_MUTEX(newobj);
468++ HASHLIB_ACQUIRE_LOCK(self);
469 + newobj->ctx = self->ctx;
470 + newobj->bits = self->bits;
471-+ LEAVE_HASHLIB(self)
472++ HASHLIB_RELEASE_LOCK(self);
473 +
474 + return (PyObject *)newobj;
475 +}
476 +
477-+static PyMethodDef SHAKE_methods[] = {
478-+ SHAKE_UPDATE_METHODDEF
479-+ SHAKE_DIGEST_METHODDEF
480-+ SHAKE_HEXDIGEST_METHODDEF
481-+ SHAKE_COPY_METHODDEF
482++static PyMethodDef HASHXOF_methods[] = {
483++ HASHXOF_UPDATE_METHODDEF
484++ HASHXOF_DIGEST_METHODDEF
485++ HASHXOF_HEXDIGEST_METHODDEF
486++ HASHXOF_COPY_METHODDEF
487 + {0}
488 +};
489 +
490 +static PyObject *
491-+SHAKE_get_digest_size(SHAKE *self, void *closure)
492++HASHXOF_get_digest_size(HASHXOF *self, void *closure)
493 +{
494 + return PyLong_FromLong(0);
495 +}
496 +
497 +static PyObject *
498-+SHAKE_get_block_size(SHAKE *self, void *closure)
499++HASHXOF_get_block_size(HASHXOF *self, void *closure)
500 +{
501 + return PyLong_FromLong(self->ctx.rate);
502 +}
503 +
504 +static PyObject *
505-+SHAKE_get_name(SHAKE *self, void *closure)
506++HASHXOF_get_name(HASHXOF *self, void *closure)
507 +{
508 + const char *name = NULL;
509 +
510@@ -426,22 +426,36 @@ index 0000000000..2d1a76296d
511 + return PyUnicode_FromString(name);
512 +}
513 +
514-+static PyGetSetDef SHAKE_getset[] = {
515-+ {"digest_size", (getter)SHAKE_get_digest_size, NULL, NULL, NULL},
516-+ {"block_size", (getter)SHAKE_get_block_size, NULL, NULL, NULL},
517-+ {"name", (getter)SHAKE_get_name, NULL, NULL, NULL},
518++static PyGetSetDef HASHXOF_getset[] = {
519++ {"digest_size", (getter)HASHXOF_get_digest_size, NULL, NULL, NULL},
520++ {"block_size", (getter)HASHXOF_get_block_size, NULL, NULL, NULL},
521++ {"name", (getter)HASHXOF_get_name, NULL, NULL, NULL},
522 + {0}
523 +};
524 +
525-+static PyTypeObject SHAKE_Type = {
526++static PyObject *
527++HASHXOF_repr(HASHXOF *self)
528++{
529++ PyObject *name = HASHXOF_get_name(self, NULL);
530++ if (name == NULL) {
531++ return NULL;
532++ }
533++ PyObject *repr = PyUnicode_FromFormat("<%U %T object @ %p>",
534++ name, self, self);
535++ Py_DECREF(name);
536++ return repr;
537++}
538++
539++static PyTypeObject HASHXOF_Type = {
540 + PyVarObject_HEAD_INIT(NULL, 0)
541-+ .tp_name = "_hashlib.SHAKE",
542-+ .tp_dealloc = (destructor)SHAKE_dealloc,
543-+ .tp_doc = SHAKE_doc,
544-+ .tp_basicsize = sizeof(SHAKE),
545++ .tp_name = "_hashlib.HASHXOF",
546++ .tp_dealloc = (destructor)HASHXOF_dealloc,
547++ .tp_repr = (reprfunc)HASHXOF_repr,
548++ .tp_doc = HASHXOF_doc,
549++ .tp_basicsize = sizeof(HASHXOF),
550 + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
551-+ .tp_methods = SHAKE_methods,
552-+ .tp_getset = SHAKE_getset,
553++ .tp_methods = HASHXOF_methods,
554++ .tp_getset = HASHXOF_getset,
555 +};
556 +
557 +PyDoc_STRVAR(HMAC_doc,
558@@ -462,10 +476,9 @@ index 0000000000..2d1a76296d
559 +static void
560 +HMAC_dealloc(HMAC *self)
561 +{
562-+ if (self->lock)
563-+ PyThread_free_lock(self->lock);
564 + PyObject_Free(self);
565 +}
566++
567 +/*[clinic input]
568 +_hashlib.HMAC.copy as HMAC_copy
569 +
570@@ -481,11 +494,11 @@ index 0000000000..2d1a76296d
571 + newobj = PyObject_New(HMAC, &HMAC_Type);
572 + if (!newobj)
573 + return NULL;
574-+ newobj->lock = NULL;
575-+ ENTER_HASHLIB(self)
576++ HASHLIB_INIT_MUTEX(newobj);
577++ HASHLIB_ACQUIRE_LOCK(self);
578 + newobj->ctx = self->ctx;
579 + newobj->key = self->key;
580-+ LEAVE_HASHLIB(self)
581++ HASHLIB_RELEASE_LOCK(self);
582 +
583 + return (PyObject *)newobj;
584 +}
585@@ -503,17 +516,10 @@ index 0000000000..2d1a76296d
586 +HMAC_update_impl(HMAC *self, Py_buffer *data)
587 +/*[clinic end generated code: output=d3520ecffa6cc3ab input=827e77e990887267]*/
588 +{
589-+ if (!self->lock && data->len >= HASHLIB_GIL_MINSIZE)
590-+ self->lock = PyThread_allocate_lock();
591-+ if (self->lock) {
592-+ Py_BEGIN_ALLOW_THREADS
593-+ PyThread_acquire_lock(self->lock, 1);
594-+ br_hmac_update(&self->ctx, data->buf, data->len);
595-+ PyThread_release_lock(self->lock);
596-+ Py_END_ALLOW_THREADS
597-+ } else {
598++ HASHLIB_EXTERNAL_INSTRUCTIONS_LOCKED(
599++ self, data->len,
600 + br_hmac_update(&self->ctx, data->buf, data->len);
601-+ }
602++ );
603 + Py_RETURN_NONE;
604 +}
605 +
606@@ -530,14 +536,15 @@ index 0000000000..2d1a76296d
607 + char digest[64];
608 + Py_ssize_t digest_size;
609 +
610-+ ENTER_HASHLIB(self)
611++ HASHLIB_ACQUIRE_LOCK(self);
612 + digest_size = br_hmac_out(&self->ctx, digest);
613-+ LEAVE_HASHLIB(self)
614++ HASHLIB_RELEASE_LOCK(self);
615 +
616 + return PyBytes_FromStringAndSize(digest, digest_size);
617 +}
618 +
619 +/*[clinic input]
620++@permit_long_summary
621 +_hashlib.HMAC.hexdigest as HMAC_hexdigest
622 +
623 +Return hexadecimal digest of the bytes passed to the update() method so far.
624@@ -548,14 +555,14 @@ index 0000000000..2d1a76296d
625 +
626 +static PyObject *
627 +HMAC_hexdigest_impl(HMAC *self)
628-+/*[clinic end generated code: output=9bb0c7abb6940bab input=2471f22b8dba7433]*/
629++/*[clinic end generated code: output=9bb0c7abb6940bab input=60d407178aa9b38b]*/
630 +{
631 + char digest[64];
632 + Py_ssize_t digest_size;
633 +
634-+ ENTER_HASHLIB(self)
635++ HASHLIB_ACQUIRE_LOCK(self);
636 + digest_size = br_hmac_out(&self->ctx, digest);
637-+ LEAVE_HASHLIB(self)
638++ HASHLIB_RELEASE_LOCK(self);
639 +
640 + return _Py_strhex(digest, digest_size);
641 +}
642@@ -616,10 +623,24 @@ index 0000000000..2d1a76296d
643 + {0}
644 +};
645 +
646++static PyObject *
647++HMAC_repr(HASH *self)
648++{
649++ PyObject *name = HASH_get_name(self, NULL);
650++ if (name == NULL) {
651++ return NULL;
652++ }
653++ PyObject *repr = PyUnicode_FromFormat("<%U %T object @ %p>",
654++ name, self, self);
655++ Py_DECREF(name);
656++ return repr;
657++}
658++
659 +static PyTypeObject HMAC_Type = {
660 + PyVarObject_HEAD_INIT(NULL, 0)
661 + .tp_name = "_hashlib.HMAC",
662 + .tp_dealloc = (destructor)HMAC_dealloc,
663++ .tp_repr = (reprfunc)HMAC_repr,
664 + .tp_doc = HMAC_doc,
665 + .tp_basicsize = sizeof(HMAC),
666 + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
667@@ -628,47 +649,39 @@ index 0000000000..2d1a76296d
668 +};
669 +
670 +static PyObject *
671-+Hash_new_vtable(PyObject *module, const br_hash_class *hc,
672-+ Py_buffer *string, int usedforsecurity)
673++HASH_new_vtable(PyObject *module, const br_hash_class *hc,
674++ Py_buffer *data, int usedforsecurity)
675 +{
676-+ Hash *self;
677++ HASH *self;
678 +
679-+ self = PyObject_New(Hash, &Hash_Type);
680++ self = PyObject_New(HASH, &HASH_Type);
681 + if (!self)
682 + return NULL;
683-+ self->lock = NULL;
684 + hc->init(&self->ctx.vtable);
685-+
686-+ if (string->len >= HASHLIB_GIL_MINSIZE) {
687-+ Py_BEGIN_ALLOW_THREADS
688-+ hc->update(&self->ctx.vtable, string->buf, string->len);
689-+ Py_END_ALLOW_THREADS
690-+ } else {
691-+ hc->update(&self->ctx.vtable, string->buf, string->len);
692-+ }
693++ HASHLIB_INIT_MUTEX(self);
694++ HASHLIB_EXTERNAL_INSTRUCTIONS_UNLOCKED(
695++ data->len,
696++ hc->update(&self->ctx.vtable, data->buf, data->len);
697++ );
698 +
699 + return (PyObject *)self;
700 +}
701 +
702 +static PyObject *
703-+SHAKE_new(PyObject *module, int bits, Py_buffer *string, int usedforsecurity)
704++HASHXOF_new(PyObject *module, int bits, Py_buffer *data, int usedforsecurity)
705 +{
706-+ SHAKE *self;
707++ HASHXOF *self;
708 +
709-+ self = PyObject_New(SHAKE, &SHAKE_Type);
710++ self = PyObject_New(HASHXOF, &HASHXOF_Type);
711 + if (!self)
712 + return NULL;
713-+ self->lock = NULL;
714 + self->bits = bits;
715 + br_shake_init(&self->ctx, bits);
716-+
717-+ if (string->len >= HASHLIB_GIL_MINSIZE) {
718-+ Py_BEGIN_ALLOW_THREADS
719-+ br_shake_inject(&self->ctx, string->buf, string->len);
720-+ Py_END_ALLOW_THREADS
721-+ } else {
722-+ br_shake_inject(&self->ctx, string->buf, string->len);
723-+ }
724++ HASHLIB_INIT_MUTEX(self);
725++ HASHLIB_EXTERNAL_INSTRUCTIONS_UNLOCKED(
726++ data->len,
727++ br_shake_inject(&self->ctx, data->buf, data->len);
728++ );
729 +
730 + return (PyObject *)self;
731 +}
732@@ -677,7 +690,7 @@ index 0000000000..2d1a76296d
733 +_hashlib.new
734 +
735 + name: str
736-+ string: Py_buffer = None
737++ data: Py_buffer = NULL
738 + *
739 + usedforsecurity: bool = True
740 +
741@@ -690,9 +703,9 @@ index 0000000000..2d1a76296d
742 +[clinic start generated code]*/
743 +
744 +static PyObject *
745-+_hashlib_new_impl(PyObject *module, const char *name, Py_buffer *string,
746++_hashlib_new_impl(PyObject *module, const char *name, Py_buffer *data,
747 + int usedforsecurity)
748-+/*[clinic end generated code: output=5459beb11946eb8d input=c7e3a9928c6af923]*/
749++/*[clinic end generated code: output=f3016644a1db3557 input=025e0e84c253e3cc]*/
750 +{
751 + const br_hash_class *hc = NULL;
752 + int shake = 0;
753@@ -710,15 +723,15 @@ index 0000000000..2d1a76296d
754 + }
755 +
756 + if (hc)
757-+ return Hash_new_vtable(module, hc, string, usedforsecurity);
758++ return HASH_new_vtable(module, hc, data, usedforsecurity);
759 + if (shake)
760-+ return SHAKE_new(module, shake, string, usedforsecurity);
761++ return HASHXOF_new(module, shake, data, usedforsecurity);
762 +}
763 +
764 +/*[clinic input]
765 +_hashlib.openssl_md5
766 +
767-+ string: Py_buffer = None
768++ data: Py_buffer = NULL
769 + *
770 + usedforsecurity: bool = True
771 +
772@@ -726,17 +739,17 @@ index 0000000000..2d1a76296d
773 +[clinic start generated code]*/
774 +
775 +static PyObject *
776-+_hashlib_openssl_md5_impl(PyObject *module, Py_buffer *string,
777++_hashlib_openssl_md5_impl(PyObject *module, Py_buffer *data,
778 + int usedforsecurity)
779-+/*[clinic end generated code: output=bf0df21c3ecd9d85 input=75e59cc38a292e51]*/
780++/*[clinic end generated code: output=6d004e8d482f12c6 input=724269f0762d2fd4]*/
781 +{
782-+ return Hash_new_vtable(module, &br_md5_vtable, string, usedforsecurity);
783++ return HASH_new_vtable(module, &br_md5_vtable, data, usedforsecurity);
784 +}
785 +
786 +/*[clinic input]
787 +_hashlib.openssl_sha1
788 +
789-+ string: Py_buffer = None
790++ data: Py_buffer = NULL
791 + *
792 + usedforsecurity: bool = True
793 +
794@@ -744,17 +757,17 @@ index 0000000000..2d1a76296d
795 +[clinic start generated code]*/
796 +
797 +static PyObject *
798-+_hashlib_openssl_sha1_impl(PyObject *module, Py_buffer *string,
799++_hashlib_openssl_sha1_impl(PyObject *module, Py_buffer *data,
800 + int usedforsecurity)
801-+/*[clinic end generated code: output=9c468cf3cfdd2e57 input=0f8ad0fa5d988be8]*/
802++/*[clinic end generated code: output=8e06eb1aeb33b307 input=88c8091b662a132d]*/
803 +{
804-+ return Hash_new_vtable(module, &br_sha1_vtable, string, usedforsecurity);
805++ return HASH_new_vtable(module, &br_sha1_vtable, data, usedforsecurity);
806 +}
807 +
808 +/*[clinic input]
809 +_hashlib.openssl_sha224
810 +
811-+ string: Py_buffer = None
812++ data: Py_buffer = NULL
813 + *
814 + usedforsecurity: bool = True
815 +
816@@ -762,17 +775,17 @@ index 0000000000..2d1a76296d
817 +[clinic start generated code]*/
818 +
819 +static PyObject *
820-+_hashlib_openssl_sha224_impl(PyObject *module, Py_buffer *string,
821++_hashlib_openssl_sha224_impl(PyObject *module, Py_buffer *data,
822 + int usedforsecurity)
823-+/*[clinic end generated code: output=9b3fea17aacc8dfe input=21aacab0e6949431]*/
824++/*[clinic end generated code: output=a90080c8e4a51352 input=96ec3828e64ac9e6]*/
825 +{
826-+ return Hash_new_vtable(module, &br_sha224_vtable, string, usedforsecurity);
827++ return HASH_new_vtable(module, &br_sha224_vtable, data, usedforsecurity);
828 +}
829 +
830 +/*[clinic input]
831 +_hashlib.openssl_sha256
832 +
833-+ string: Py_buffer = None
834++ data: Py_buffer = NULL
835 + *
836 + usedforsecurity: bool = True
837 +
838@@ -780,17 +793,17 @@ index 0000000000..2d1a76296d
839 +[clinic start generated code]*/
840 +
841 +static PyObject *
842-+_hashlib_openssl_sha256_impl(PyObject *module, Py_buffer *string,
843++_hashlib_openssl_sha256_impl(PyObject *module, Py_buffer *data,
844 + int usedforsecurity)
845-+/*[clinic end generated code: output=2c0585ccc6dfa22a input=81dd291675e0f6c9]*/
846++/*[clinic end generated code: output=5c7518b7915f17ef input=e95702979596ee26]*/
847 +{
848-+ return Hash_new_vtable(module, &br_sha256_vtable, string, usedforsecurity);
849++ return HASH_new_vtable(module, &br_sha256_vtable, data, usedforsecurity);
850 +}
851 +
852 +/*[clinic input]
853 +_hashlib.openssl_sha384
854 +
855-+ string: Py_buffer = None
856++ data: Py_buffer = NULL
857 + *
858 + usedforsecurity: bool = True
859 +
860@@ -798,17 +811,17 @@ index 0000000000..2d1a76296d
861 +[clinic start generated code]*/
862 +
863 +static PyObject *
864-+_hashlib_openssl_sha384_impl(PyObject *module, Py_buffer *string,
865++_hashlib_openssl_sha384_impl(PyObject *module, Py_buffer *data,
866 + int usedforsecurity)
867-+/*[clinic end generated code: output=196d8d7558cfd155 input=eed0b0128dd67969]*/
868++/*[clinic end generated code: output=4492199f69d4124c input=6e9480f8c631a66a]*/
869 +{
870-+ return Hash_new_vtable(module, &br_sha384_vtable, string, usedforsecurity);
871++ return HASH_new_vtable(module, &br_sha384_vtable, data, usedforsecurity);
872 +}
873 +
874 +/*[clinic input]
875 +_hashlib.openssl_sha512
876 +
877-+ string: Py_buffer = None
878++ data: Py_buffer = NULL
879 + *
880 + usedforsecurity: bool = True
881 +
882@@ -816,17 +829,18 @@ index 0000000000..2d1a76296d
883 +[clinic start generated code]*/
884 +
885 +static PyObject *
886-+_hashlib_openssl_sha512_impl(PyObject *module, Py_buffer *string,
887++_hashlib_openssl_sha512_impl(PyObject *module, Py_buffer *data,
888 + int usedforsecurity)
889-+/*[clinic end generated code: output=7349b37b20ff6f75 input=da1228b585897043]*/
890++/*[clinic end generated code: output=e6cdcd262498123f input=696e89c85ed8fb93]*/
891 +{
892-+ return Hash_new_vtable(module, &br_sha512_vtable, string, usedforsecurity);
893++ return HASH_new_vtable(module, &br_sha512_vtable, data, usedforsecurity);
894 +}
895 +
896 +/*[clinic input]
897++@permit_long_summary
898 +_hashlib.openssl_shake_128
899 +
900-+ string: Py_buffer = None
901++ data: Py_buffer = NULL
902 + *
903 + usedforsecurity: bool = True
904 +
905@@ -834,17 +848,18 @@ index 0000000000..2d1a76296d
906 +[clinic start generated code]*/
907 +
908 +static PyObject *
909-+_hashlib_openssl_shake_128_impl(PyObject *module, Py_buffer *string,
910++_hashlib_openssl_shake_128_impl(PyObject *module, Py_buffer *data,
911 + int usedforsecurity)
912-+/*[clinic end generated code: output=e51cc0e4bded887e input=fb6dce24fc91d53d]*/
913++/*[clinic end generated code: output=4659f2817328725e input=348d765e70cfeb51]*/
914 +{
915-+ return SHAKE_new(module, 128, string, usedforsecurity);
916++ return HASHXOF_new(module, 128, data, usedforsecurity);
917 +}
918 +
919 +/*[clinic input]
920++@permit_long_summary
921 +_hashlib.openssl_shake_256
922 +
923-+ string: Py_buffer = None
924++ data: Py_buffer = NULL
925 + *
926 + usedforsecurity: bool = True
927 +
928@@ -852,11 +867,11 @@ index 0000000000..2d1a76296d
929 +[clinic start generated code]*/
930 +
931 +static PyObject *
932-+_hashlib_openssl_shake_256_impl(PyObject *module, Py_buffer *string,
933++_hashlib_openssl_shake_256_impl(PyObject *module, Py_buffer *data,
934 + int usedforsecurity)
935-+/*[clinic end generated code: output=983a76ff0796751b input=9eb2a133d11e34dc]*/
936++/*[clinic end generated code: output=7b9e5bfe8c1d042e input=45671e5e1ef81b49]*/
937 +{
938-+ return SHAKE_new(module, 256, string, usedforsecurity);
939++ return HASHXOF_new(module, 256, data, usedforsecurity);
940 +}
941 +
942 +static int
943@@ -903,7 +918,7 @@ index 0000000000..2d1a76296d
944 +
945 +static PyObject *
946 +_hashlib_compare_digest_impl(PyObject *module, PyObject *a, PyObject *b)
947-+/*[clinic end generated code: output=6f1c13927480aed9 input=f9cc6da970b1b1d5]*/
948++/*[clinic end generated code: output=6f1c13927480aed9 input=9c40c6e566ca12f5]*/
949 +{
950 + int rc;
951 +
952@@ -987,7 +1002,7 @@ index 0000000000..2d1a76296d
953 + {0}
954 +};
955 +
956-+/* Fast HMAC for hmac.digest() */
957++// --- One-shot HMAC interface ------------------------------------------------
958 +
959 +/*[clinic input]
960 +_hashlib.hmac_digest as _hashlib_hmac_singleshot
961@@ -1015,19 +1030,13 @@ index 0000000000..2d1a76296d
962 + PyErr_SetString(PyExc_ValueError, "unsupported hash type");
963 + return NULL;
964 + }
965-+ if (msg->len >= HASHLIB_GIL_MINSIZE) {
966-+ Py_BEGIN_ALLOW_THREADS
967-+ br_hmac_key_init(&keyctx, hc, key->buf, key->len);
968-+ br_hmac_init(&ctx, &keyctx, 0);
969-+ br_hmac_update(&ctx, msg->buf, msg->len);
970-+ br_hmac_out(&ctx, buf);
971-+ Py_END_ALLOW_THREADS
972-+ } else {
973-+ br_hmac_key_init(&keyctx, hc, key->buf, key->len);
974-+ br_hmac_init(&ctx, &keyctx, 0);
975++ br_hmac_key_init(&keyctx, hc, key->buf, key->len);
976++ br_hmac_init(&ctx, &keyctx, 0);
977++ HASHLIB_EXTERNAL_INSTRUCTIONS_UNLOCKED(
978++ msg->len,
979 + br_hmac_update(&ctx, msg->buf, msg->len);
980-+ br_hmac_out(&ctx, buf);
981-+ }
982++ );
983++ br_hmac_out(&ctx, buf);
984 + buf_len = br_hmac_size(&ctx);
985 +
986 + return PyBytes_FromStringAndSize(buf, buf_len);
987@@ -1037,7 +1046,7 @@ index 0000000000..2d1a76296d
988 +_hashlib.hmac_new
989 +
990 + key: Py_buffer
991-+ msg: Py_buffer = None
992++ msg: Py_buffer = NULL
993 + digestmod: str(c_default="NULL") = None
994 +
995 +Return a new hmac object.
996@@ -1046,13 +1055,11 @@ index 0000000000..2d1a76296d
997 +static PyObject *
998 +_hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, Py_buffer *msg,
999 + const char *digestmod)
1000-+/*[clinic end generated code: output=5733a8600554bba2 input=b0125f4222a0d06d]*/
1001++/*[clinic end generated code: output=5733a8600554bba2 input=76547bd3e681ea5e]*/
1002 +{
1003 + HMAC *self;
1004 + const br_hash_class *hc;
1005 +
1006-+ printf("hmac new\n");
1007-+
1008 + if (!digestmod || !digestmod[0]) {
1009 + PyErr_SetString(
1010 + PyExc_TypeError, "missing required parameter 'digestmod'");
1011@@ -1066,17 +1073,13 @@ index 0000000000..2d1a76296d
1012 + self = PyObject_New(HMAC, &HMAC_Type);
1013 + if (!self)
1014 + return NULL;
1015-+ self->lock = NULL;
1016 + br_hmac_key_init(&self->key, hc, key->buf, key->len);
1017 + br_hmac_init(&self->ctx, &self->key, 0);
1018-+
1019-+ if (msg->len >= HASHLIB_GIL_MINSIZE) {
1020-+ Py_BEGIN_ALLOW_THREADS
1021++ HASHLIB_INIT_MUTEX(self);
1022++ HASHLIB_EXTERNAL_INSTRUCTIONS_UNLOCKED(
1023++ msg->len,
1024 + br_hmac_update(&self->ctx, msg->buf, msg->len);
1025-+ Py_END_ALLOW_THREADS
1026-+ } else {
1027-+ br_hmac_update(&self->ctx, msg->buf, msg->len);
1028-+ }
1029++ );
1030 +
1031 + return (PyObject *)self;
1032 +}
1033@@ -1112,9 +1115,9 @@ index 0000000000..2d1a76296d
1034 + m = PyModule_Create(&_hashlibmodule);
1035 + if (!m)
1036 + goto err;
1037-+ if (PyModule_AddType(m, &Hash_Type) < 0)
1038++ if (PyModule_AddType(m, &HASH_Type) < 0)
1039 + goto err;
1040-+ if (PyModule_AddType(m, &SHAKE_Type) < 0)
1041++ if (PyModule_AddType(m, &HASHXOF_Type) < 0)
1042 + goto err;
1043 + if (PyModule_AddType(m, &HMAC_Type) < 0)
1044 + goto err;
1045@@ -1144,28 +1147,35 @@ index 0000000000..2d1a76296d
1046 +}
1047 diff --git a/Modules/clinic/_hashbearssl.c.h b/Modules/clinic/_hashbearssl.c.h
1048 new file mode 100644
1049-index 0000000000..49bf8f9287
1050+index 00000000000..5fa0c88da6b
1051 --- /dev/null
1052 +++ b/Modules/clinic/_hashbearssl.c.h
1053-@@ -0,0 +1,1113 @@
1054+@@ -0,0 +1,1401 @@
1055 +/*[clinic input]
1056 +preserve
1057 +[clinic start generated code]*/
1058 +
1059-+PyDoc_STRVAR(Hash_update__doc__,
1060++#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1061++# include "pycore_gc.h" // PyGC_Head
1062++# include "pycore_runtime.h" // _Py_ID()
1063++#endif
1064++#include "pycore_abstract.h" // _PyNumber_Index()
1065++#include "pycore_modsupport.h" // _PyArg_BadArgument()
1066++
1067++PyDoc_STRVAR(HASH_update__doc__,
1068 +"update($self, data, /)\n"
1069 +"--\n"
1070 +"\n"
1071 +"Update this hash object\'s state with the provided string.");
1072 +
1073 +#define HASH_UPDATE_METHODDEF \
1074-+ {"update", (PyCFunction)Hash_update, METH_O, Hash_update__doc__},
1075++ {"update", (PyCFunction)HASH_update, METH_O, HASH_update__doc__},
1076 +
1077 +static PyObject *
1078-+Hash_update_impl(Hash *self, Py_buffer *data);
1079++HASH_update_impl(HASH *self, Py_buffer *data);
1080 +
1081 +static PyObject *
1082-+Hash_update(Hash *self, PyObject *arg)
1083++HASH_update(PyObject *self, PyObject *arg)
1084 +{
1085 + PyObject *return_value = NULL;
1086 + Py_buffer data = {NULL, NULL};
1087@@ -1173,11 +1183,7 @@ index 0000000000..49bf8f9287
1088 + if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
1089 + goto exit;
1090 + }
1091-+ if (!PyBuffer_IsContiguous(&data, 'C')) {
1092-+ _PyArg_BadArgument("update", "argument", "contiguous buffer", arg);
1093-+ goto exit;
1094-+ }
1095-+ return_value = Hash_update_impl(self, &data);
1096++ return_value = HASH_update_impl((HASH *)self, &data);
1097 +
1098 +exit:
1099 + /* Cleanup for data */
1100@@ -1188,74 +1194,74 @@ index 0000000000..49bf8f9287
1101 + return return_value;
1102 +}
1103 +
1104-+PyDoc_STRVAR(Hash_digest__doc__,
1105++PyDoc_STRVAR(HASH_digest__doc__,
1106 +"digest($self, /)\n"
1107 +"--\n"
1108 +"\n"
1109 +"Return the digest value as a bytes object.");
1110 +
1111 +#define HASH_DIGEST_METHODDEF \
1112-+ {"digest", (PyCFunction)Hash_digest, METH_NOARGS, Hash_digest__doc__},
1113++ {"digest", (PyCFunction)HASH_digest, METH_NOARGS, HASH_digest__doc__},
1114 +
1115 +static PyObject *
1116-+Hash_digest_impl(Hash *self);
1117++HASH_digest_impl(HASH *self);
1118 +
1119 +static PyObject *
1120-+Hash_digest(Hash *self, PyObject *Py_UNUSED(ignored))
1121++HASH_digest(PyObject *self, PyObject *Py_UNUSED(ignored))
1122 +{
1123-+ return Hash_digest_impl(self);
1124++ return HASH_digest_impl((HASH *)self);
1125 +}
1126 +
1127-+PyDoc_STRVAR(Hash_hexdigest__doc__,
1128++PyDoc_STRVAR(HASH_hexdigest__doc__,
1129 +"hexdigest($self, /)\n"
1130 +"--\n"
1131 +"\n"
1132 +"Return the digest value as a string of hexadecimal digits.");
1133 +
1134 +#define HASH_HEXDIGEST_METHODDEF \
1135-+ {"hexdigest", (PyCFunction)Hash_hexdigest, METH_NOARGS, Hash_hexdigest__doc__},
1136++ {"hexdigest", (PyCFunction)HASH_hexdigest, METH_NOARGS, HASH_hexdigest__doc__},
1137 +
1138 +static PyObject *
1139-+Hash_hexdigest_impl(Hash *self);
1140++HASH_hexdigest_impl(HASH *self);
1141 +
1142 +static PyObject *
1143-+Hash_hexdigest(Hash *self, PyObject *Py_UNUSED(ignored))
1144++HASH_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored))
1145 +{
1146-+ return Hash_hexdigest_impl(self);
1147++ return HASH_hexdigest_impl((HASH *)self);
1148 +}
1149 +
1150-+PyDoc_STRVAR(Hash_copy__doc__,
1151++PyDoc_STRVAR(HASH_copy__doc__,
1152 +"copy($self, /)\n"
1153 +"--\n"
1154 +"\n"
1155 +"Return a copy of the hash object.");
1156 +
1157 +#define HASH_COPY_METHODDEF \
1158-+ {"copy", (PyCFunction)Hash_copy, METH_NOARGS, Hash_copy__doc__},
1159++ {"copy", (PyCFunction)HASH_copy, METH_NOARGS, HASH_copy__doc__},
1160 +
1161 +static PyObject *
1162-+Hash_copy_impl(Hash *self);
1163++HASH_copy_impl(HASH *self);
1164 +
1165 +static PyObject *
1166-+Hash_copy(Hash *self, PyObject *Py_UNUSED(ignored))
1167++HASH_copy(PyObject *self, PyObject *Py_UNUSED(ignored))
1168 +{
1169-+ return Hash_copy_impl(self);
1170++ return HASH_copy_impl((HASH *)self);
1171 +}
1172 +
1173-+PyDoc_STRVAR(SHAKE_update__doc__,
1174++PyDoc_STRVAR(HASHXOF_update__doc__,
1175 +"update($self, data, /)\n"
1176 +"--\n"
1177 +"\n"
1178 +"Update this hash object\'s state with the provided string.");
1179 +
1180-+#define SHAKE_UPDATE_METHODDEF \
1181-+ {"update", (PyCFunction)SHAKE_update, METH_O, SHAKE_update__doc__},
1182++#define HASHXOF_UPDATE_METHODDEF \
1183++ {"update", (PyCFunction)HASHXOF_update, METH_O, HASHXOF_update__doc__},
1184 +
1185 +static PyObject *
1186-+SHAKE_update_impl(SHAKE *self, Py_buffer *data);
1187++HASHXOF_update_impl(HASHXOF *self, Py_buffer *data);
1188 +
1189 +static PyObject *
1190-+SHAKE_update(SHAKE *self, PyObject *arg)
1191++HASHXOF_update(PyObject *self, PyObject *arg)
1192 +{
1193 + PyObject *return_value = NULL;
1194 + Py_buffer data = {NULL, NULL};
1195@@ -1263,11 +1269,7 @@ index 0000000000..49bf8f9287
1196 + if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
1197 + goto exit;
1198 + }
1199-+ if (!PyBuffer_IsContiguous(&data, 'C')) {
1200-+ _PyArg_BadArgument("update", "argument", "contiguous buffer", arg);
1201-+ goto exit;
1202-+ }
1203-+ return_value = SHAKE_update_impl(self, &data);
1204++ return_value = HASHXOF_update_impl((HASHXOF *)self, &data);
1205 +
1206 +exit:
1207 + /* Cleanup for data */
1208@@ -1278,39 +1280,60 @@ index 0000000000..49bf8f9287
1209 + return return_value;
1210 +}
1211 +
1212-+PyDoc_STRVAR(SHAKE_digest__doc__,
1213++PyDoc_STRVAR(HASHXOF_digest__doc__,
1214 +"digest($self, /, length)\n"
1215 +"--\n"
1216 +"\n"
1217 +"Return the digest value as a bytes object.");
1218 +
1219-+#define SHAKE_DIGEST_METHODDEF \
1220-+ {"digest", (PyCFunction)(void(*)(void))SHAKE_digest, METH_FASTCALL|METH_KEYWORDS, SHAKE_digest__doc__},
1221++#define HASHXOF_DIGEST_METHODDEF \
1222++ {"digest", _PyCFunction_CAST(HASHXOF_digest), METH_FASTCALL|METH_KEYWORDS, HASHXOF_digest__doc__},
1223 +
1224 +static PyObject *
1225-+SHAKE_digest_impl(SHAKE *self, Py_ssize_t length);
1226++HASHXOF_digest_impl(HASHXOF *self, Py_ssize_t length);
1227 +
1228 +static PyObject *
1229-+SHAKE_digest(SHAKE *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1230++HASHXOF_digest(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1231 +{
1232 + PyObject *return_value = NULL;
1233++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1234++
1235++ #define NUM_KEYWORDS 1
1236++ static struct {
1237++ PyGC_Head _this_is_not_used;
1238++ PyObject_VAR_HEAD
1239++ Py_hash_t ob_hash;
1240++ PyObject *ob_item[NUM_KEYWORDS];
1241++ } _kwtuple = {
1242++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1243++ .ob_hash = -1,
1244++ .ob_item = { &_Py_ID(length), },
1245++ };
1246++ #undef NUM_KEYWORDS
1247++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1248++
1249++ #else // !Py_BUILD_CORE
1250++ # define KWTUPLE NULL
1251++ #endif // !Py_BUILD_CORE
1252++
1253 + static const char * const _keywords[] = {"length", NULL};
1254-+ static _PyArg_Parser _parser = {NULL, _keywords, "digest", 0};
1255++ static _PyArg_Parser _parser = {
1256++ .keywords = _keywords,
1257++ .fname = "digest",
1258++ .kwtuple = KWTUPLE,
1259++ };
1260++ #undef KWTUPLE
1261 + PyObject *argsbuf[1];
1262 + Py_ssize_t length;
1263 +
1264-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
1265++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1266++ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1267 + if (!args) {
1268 + goto exit;
1269 + }
1270-+ if (PyFloat_Check(args[0])) {
1271-+ PyErr_SetString(PyExc_TypeError,
1272-+ "integer argument expected, got float" );
1273-+ goto exit;
1274-+ }
1275 + {
1276 + Py_ssize_t ival = -1;
1277-+ PyObject *iobj = PyNumber_Index(args[0]);
1278++ PyObject *iobj = _PyNumber_Index(args[0]);
1279 + if (iobj != NULL) {
1280 + ival = PyLong_AsSsize_t(iobj);
1281 + Py_DECREF(iobj);
1282@@ -1319,46 +1342,72 @@ index 0000000000..49bf8f9287
1283 + goto exit;
1284 + }
1285 + length = ival;
1286++ if (length < 0) {
1287++ PyErr_SetString(PyExc_ValueError,
1288++ "length cannot be negative");
1289++ goto exit;
1290++ }
1291 + }
1292-+ return_value = SHAKE_digest_impl(self, length);
1293++ return_value = HASHXOF_digest_impl((HASHXOF *)self, length);
1294 +
1295 +exit:
1296 + return return_value;
1297 +}
1298 +
1299-+PyDoc_STRVAR(SHAKE_hexdigest__doc__,
1300++PyDoc_STRVAR(HASHXOF_hexdigest__doc__,
1301 +"hexdigest($self, /, length)\n"
1302 +"--\n"
1303 +"\n"
1304 +"Return the digest value as a string of hexadecimal digits.");
1305 +
1306-+#define SHAKE_HEXDIGEST_METHODDEF \
1307-+ {"hexdigest", (PyCFunction)(void(*)(void))SHAKE_hexdigest, METH_FASTCALL|METH_KEYWORDS, SHAKE_hexdigest__doc__},
1308++#define HASHXOF_HEXDIGEST_METHODDEF \
1309++ {"hexdigest", _PyCFunction_CAST(HASHXOF_hexdigest), METH_FASTCALL|METH_KEYWORDS, HASHXOF_hexdigest__doc__},
1310 +
1311 +static PyObject *
1312-+SHAKE_hexdigest_impl(SHAKE *self, Py_ssize_t length);
1313++HASHXOF_hexdigest_impl(HASHXOF *self, Py_ssize_t length);
1314 +
1315 +static PyObject *
1316-+SHAKE_hexdigest(SHAKE *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1317++HASHXOF_hexdigest(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1318 +{
1319 + PyObject *return_value = NULL;
1320++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1321++
1322++ #define NUM_KEYWORDS 1
1323++ static struct {
1324++ PyGC_Head _this_is_not_used;
1325++ PyObject_VAR_HEAD
1326++ Py_hash_t ob_hash;
1327++ PyObject *ob_item[NUM_KEYWORDS];
1328++ } _kwtuple = {
1329++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1330++ .ob_hash = -1,
1331++ .ob_item = { &_Py_ID(length), },
1332++ };
1333++ #undef NUM_KEYWORDS
1334++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1335++
1336++ #else // !Py_BUILD_CORE
1337++ # define KWTUPLE NULL
1338++ #endif // !Py_BUILD_CORE
1339++
1340 + static const char * const _keywords[] = {"length", NULL};
1341-+ static _PyArg_Parser _parser = {NULL, _keywords, "hexdigest", 0};
1342++ static _PyArg_Parser _parser = {
1343++ .keywords = _keywords,
1344++ .fname = "hexdigest",
1345++ .kwtuple = KWTUPLE,
1346++ };
1347++ #undef KWTUPLE
1348 + PyObject *argsbuf[1];
1349 + Py_ssize_t length;
1350 +
1351-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
1352++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1353++ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1354 + if (!args) {
1355 + goto exit;
1356 + }
1357-+ if (PyFloat_Check(args[0])) {
1358-+ PyErr_SetString(PyExc_TypeError,
1359-+ "integer argument expected, got float" );
1360-+ goto exit;
1361-+ }
1362 + {
1363 + Py_ssize_t ival = -1;
1364-+ PyObject *iobj = PyNumber_Index(args[0]);
1365++ PyObject *iobj = _PyNumber_Index(args[0]);
1366 + if (iobj != NULL) {
1367 + ival = PyLong_AsSsize_t(iobj);
1368 + Py_DECREF(iobj);
1369@@ -1367,29 +1416,34 @@ index 0000000000..49bf8f9287
1370 + goto exit;
1371 + }
1372 + length = ival;
1373++ if (length < 0) {
1374++ PyErr_SetString(PyExc_ValueError,
1375++ "length cannot be negative");
1376++ goto exit;
1377++ }
1378 + }
1379-+ return_value = SHAKE_hexdigest_impl(self, length);
1380++ return_value = HASHXOF_hexdigest_impl((HASHXOF *)self, length);
1381 +
1382 +exit:
1383 + return return_value;
1384 +}
1385 +
1386-+PyDoc_STRVAR(SHAKE_copy__doc__,
1387++PyDoc_STRVAR(HASHXOF_copy__doc__,
1388 +"copy($self, /)\n"
1389 +"--\n"
1390 +"\n"
1391-+"Return a copy of the SHAKE object.");
1392++"Return a copy of the HASHXOF object.");
1393 +
1394-+#define SHAKE_COPY_METHODDEF \
1395-+ {"copy", (PyCFunction)SHAKE_copy, METH_NOARGS, SHAKE_copy__doc__},
1396++#define HASHXOF_COPY_METHODDEF \
1397++ {"copy", (PyCFunction)HASHXOF_copy, METH_NOARGS, HASHXOF_copy__doc__},
1398 +
1399 +static PyObject *
1400-+SHAKE_copy_impl(SHAKE *self);
1401++HASHXOF_copy_impl(HASHXOF *self);
1402 +
1403 +static PyObject *
1404-+SHAKE_copy(SHAKE *self, PyObject *Py_UNUSED(ignored))
1405++HASHXOF_copy(PyObject *self, PyObject *Py_UNUSED(ignored))
1406 +{
1407-+ return SHAKE_copy_impl(self);
1408++ return HASHXOF_copy_impl((HASHXOF *)self);
1409 +}
1410 +
1411 +PyDoc_STRVAR(HMAC_copy__doc__,
1412@@ -1405,9 +1459,9 @@ index 0000000000..49bf8f9287
1413 +HMAC_copy_impl(HMAC *self);
1414 +
1415 +static PyObject *
1416-+HMAC_copy(HMAC *self, PyObject *Py_UNUSED(ignored))
1417++HMAC_copy(PyObject *self, PyObject *Py_UNUSED(ignored))
1418 +{
1419-+ return HMAC_copy_impl(self);
1420++ return HMAC_copy_impl((HMAC *)self);
1421 +}
1422 +
1423 +PyDoc_STRVAR(HMAC_update__doc__,
1424@@ -1423,7 +1477,7 @@ index 0000000000..49bf8f9287
1425 +HMAC_update_impl(HMAC *self, Py_buffer *data);
1426 +
1427 +static PyObject *
1428-+HMAC_update(HMAC *self, PyObject *arg)
1429++HMAC_update(PyObject *self, PyObject *arg)
1430 +{
1431 + PyObject *return_value = NULL;
1432 + Py_buffer data = {NULL, NULL};
1433@@ -1431,11 +1485,7 @@ index 0000000000..49bf8f9287
1434 + if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
1435 + goto exit;
1436 + }
1437-+ if (!PyBuffer_IsContiguous(&data, 'C')) {
1438-+ _PyArg_BadArgument("update", "argument", "contiguous buffer", arg);
1439-+ goto exit;
1440-+ }
1441-+ return_value = HMAC_update_impl(self, &data);
1442++ return_value = HMAC_update_impl((HMAC *)self, &data);
1443 +
1444 +exit:
1445 + /* Cleanup for data */
1446@@ -1459,9 +1509,9 @@ index 0000000000..49bf8f9287
1447 +HMAC_digest_impl(HMAC *self);
1448 +
1449 +static PyObject *
1450-+HMAC_digest(HMAC *self, PyObject *Py_UNUSED(ignored))
1451++HMAC_digest(PyObject *self, PyObject *Py_UNUSED(ignored))
1452 +{
1453-+ return HMAC_digest_impl(self);
1454++ return HMAC_digest_impl((HMAC *)self);
1455 +}
1456 +
1457 +PyDoc_STRVAR(HMAC_hexdigest__doc__,
1458@@ -1480,13 +1530,13 @@ index 0000000000..49bf8f9287
1459 +HMAC_hexdigest_impl(HMAC *self);
1460 +
1461 +static PyObject *
1462-+HMAC_hexdigest(HMAC *self, PyObject *Py_UNUSED(ignored))
1463++HMAC_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored))
1464 +{
1465-+ return HMAC_hexdigest_impl(self);
1466++ return HMAC_hexdigest_impl((HMAC *)self);
1467 +}
1468 +
1469 +PyDoc_STRVAR(_hashlib_new__doc__,
1470-+"new($module, /, name, string=None, *, usedforsecurity=True)\n"
1471++"new($module, /, name, data=<unrepresentable>, *, usedforsecurity=True)\n"
1472 +"--\n"
1473 +"\n"
1474 +"Return a new hash object using the named algorithm.\n"
1475@@ -1497,25 +1547,51 @@ index 0000000000..49bf8f9287
1476 +"The MD5 and SHA1 algorithms are always supported.");
1477 +
1478 +#define _HASHLIB_NEW_METHODDEF \
1479-+ {"new", (PyCFunction)(void(*)(void))_hashlib_new, METH_FASTCALL|METH_KEYWORDS, _hashlib_new__doc__},
1480++ {"new", _PyCFunction_CAST(_hashlib_new), METH_FASTCALL|METH_KEYWORDS, _hashlib_new__doc__},
1481 +
1482 +static PyObject *
1483-+_hashlib_new_impl(PyObject *module, const char *name, Py_buffer *string,
1484++_hashlib_new_impl(PyObject *module, const char *name, Py_buffer *data,
1485 + int usedforsecurity);
1486 +
1487 +static PyObject *
1488 +_hashlib_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1489 +{
1490 + PyObject *return_value = NULL;
1491-+ static const char * const _keywords[] = {"name", "string", "usedforsecurity", NULL};
1492-+ static _PyArg_Parser _parser = {NULL, _keywords, "new", 0};
1493++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1494++
1495++ #define NUM_KEYWORDS 3
1496++ static struct {
1497++ PyGC_Head _this_is_not_used;
1498++ PyObject_VAR_HEAD
1499++ Py_hash_t ob_hash;
1500++ PyObject *ob_item[NUM_KEYWORDS];
1501++ } _kwtuple = {
1502++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1503++ .ob_hash = -1,
1504++ .ob_item = { &_Py_ID(name), &_Py_ID(data), &_Py_ID(usedforsecurity), },
1505++ };
1506++ #undef NUM_KEYWORDS
1507++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1508++
1509++ #else // !Py_BUILD_CORE
1510++ # define KWTUPLE NULL
1511++ #endif // !Py_BUILD_CORE
1512++
1513++ static const char * const _keywords[] = {"name", "data", "usedforsecurity", NULL};
1514++ static _PyArg_Parser _parser = {
1515++ .keywords = _keywords,
1516++ .fname = "new",
1517++ .kwtuple = KWTUPLE,
1518++ };
1519++ #undef KWTUPLE
1520 + PyObject *argsbuf[3];
1521 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1522 + const char *name;
1523-+ Py_buffer string = {NULL, NULL};
1524++ Py_buffer data = {NULL, NULL};
1525 + int usedforsecurity = 1;
1526 +
1527-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
1528++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1529++ /*minpos*/ 1, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1530 + if (!args) {
1531 + goto exit;
1532 + }
1533@@ -1536,11 +1612,7 @@ index 0000000000..49bf8f9287
1534 + goto skip_optional_pos;
1535 + }
1536 + if (args[1]) {
1537-+ if (PyObject_GetBuffer(args[1], &string, PyBUF_SIMPLE) != 0) {
1538-+ goto exit;
1539-+ }
1540-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
1541-+ _PyArg_BadArgument("new", "argument 'string'", "contiguous buffer", args[1]);
1542++ if (PyObject_GetBuffer(args[1], &data, PyBUF_SIMPLE) != 0) {
1543 + goto exit;
1544 + }
1545 + if (!--noptargs) {
1546@@ -1556,42 +1628,68 @@ index 0000000000..49bf8f9287
1547 + goto exit;
1548 + }
1549 +skip_optional_kwonly:
1550-+ return_value = _hashlib_new_impl(module, name, &string, usedforsecurity);
1551++ return_value = _hashlib_new_impl(module, name, &data, usedforsecurity);
1552 +
1553 +exit:
1554-+ /* Cleanup for string */
1555-+ if (string.obj) {
1556-+ PyBuffer_Release(&string);
1557++ /* Cleanup for data */
1558++ if (data.obj) {
1559++ PyBuffer_Release(&data);
1560 + }
1561 +
1562 + return return_value;
1563 +}
1564 +
1565 +PyDoc_STRVAR(_hashlib_openssl_md5__doc__,
1566-+"openssl_md5($module, /, string=None, *, usedforsecurity=True)\n"
1567++"openssl_md5($module, /, data=<unrepresentable>, *, usedforsecurity=True)\n"
1568 +"--\n"
1569 +"\n"
1570 +"Returns a md5 hash object; optionally initialized with a string.");
1571 +
1572 +#define _HASHLIB_OPENSSL_MD5_METHODDEF \
1573-+ {"openssl_md5", (PyCFunction)(void(*)(void))_hashlib_openssl_md5, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_md5__doc__},
1574++ {"openssl_md5", _PyCFunction_CAST(_hashlib_openssl_md5), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_md5__doc__},
1575 +
1576 +static PyObject *
1577-+_hashlib_openssl_md5_impl(PyObject *module, Py_buffer *string,
1578++_hashlib_openssl_md5_impl(PyObject *module, Py_buffer *data,
1579 + int usedforsecurity);
1580 +
1581 +static PyObject *
1582 +_hashlib_openssl_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1583 +{
1584 + PyObject *return_value = NULL;
1585-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1586-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_md5", 0};
1587++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1588++
1589++ #define NUM_KEYWORDS 2
1590++ static struct {
1591++ PyGC_Head _this_is_not_used;
1592++ PyObject_VAR_HEAD
1593++ Py_hash_t ob_hash;
1594++ PyObject *ob_item[NUM_KEYWORDS];
1595++ } _kwtuple = {
1596++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1597++ .ob_hash = -1,
1598++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
1599++ };
1600++ #undef NUM_KEYWORDS
1601++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1602++
1603++ #else // !Py_BUILD_CORE
1604++ # define KWTUPLE NULL
1605++ #endif // !Py_BUILD_CORE
1606++
1607++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
1608++ static _PyArg_Parser _parser = {
1609++ .keywords = _keywords,
1610++ .fname = "openssl_md5",
1611++ .kwtuple = KWTUPLE,
1612++ };
1613++ #undef KWTUPLE
1614 + PyObject *argsbuf[2];
1615 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1616-+ Py_buffer string = {NULL, NULL};
1617++ Py_buffer data = {NULL, NULL};
1618 + int usedforsecurity = 1;
1619 +
1620-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1621++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1622++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1623 + if (!args) {
1624 + goto exit;
1625 + }
1626@@ -1599,11 +1697,7 @@ index 0000000000..49bf8f9287
1627 + goto skip_optional_pos;
1628 + }
1629 + if (args[0]) {
1630-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1631-+ goto exit;
1632-+ }
1633-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
1634-+ _PyArg_BadArgument("openssl_md5", "argument 'string'", "contiguous buffer", args[0]);
1635++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
1636 + goto exit;
1637 + }
1638 + if (!--noptargs) {
1639@@ -1619,42 +1713,69 @@ index 0000000000..49bf8f9287
1640 + goto exit;
1641 + }
1642 +skip_optional_kwonly:
1643-+ return_value = _hashlib_openssl_md5_impl(module, &string, usedforsecurity);
1644++ return_value = _hashlib_openssl_md5_impl(module, &data, usedforsecurity);
1645 +
1646 +exit:
1647-+ /* Cleanup for string */
1648-+ if (string.obj) {
1649-+ PyBuffer_Release(&string);
1650++ /* Cleanup for data */
1651++ if (data.obj) {
1652++ PyBuffer_Release(&data);
1653 + }
1654 +
1655 + return return_value;
1656 +}
1657 +
1658 +PyDoc_STRVAR(_hashlib_openssl_sha1__doc__,
1659-+"openssl_sha1($module, /, string=None, *, usedforsecurity=True)\n"
1660++"openssl_sha1($module, /, data=<unrepresentable>, *,\n"
1661++" usedforsecurity=True)\n"
1662 +"--\n"
1663 +"\n"
1664 +"Returns a sha1 hash object; optionally initialized with a string.");
1665 +
1666 +#define _HASHLIB_OPENSSL_SHA1_METHODDEF \
1667-+ {"openssl_sha1", (PyCFunction)(void(*)(void))_hashlib_openssl_sha1, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha1__doc__},
1668++ {"openssl_sha1", _PyCFunction_CAST(_hashlib_openssl_sha1), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha1__doc__},
1669 +
1670 +static PyObject *
1671-+_hashlib_openssl_sha1_impl(PyObject *module, Py_buffer *string,
1672++_hashlib_openssl_sha1_impl(PyObject *module, Py_buffer *data,
1673 + int usedforsecurity);
1674 +
1675 +static PyObject *
1676 +_hashlib_openssl_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1677 +{
1678 + PyObject *return_value = NULL;
1679-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1680-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha1", 0};
1681++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1682++
1683++ #define NUM_KEYWORDS 2
1684++ static struct {
1685++ PyGC_Head _this_is_not_used;
1686++ PyObject_VAR_HEAD
1687++ Py_hash_t ob_hash;
1688++ PyObject *ob_item[NUM_KEYWORDS];
1689++ } _kwtuple = {
1690++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1691++ .ob_hash = -1,
1692++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
1693++ };
1694++ #undef NUM_KEYWORDS
1695++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1696++
1697++ #else // !Py_BUILD_CORE
1698++ # define KWTUPLE NULL
1699++ #endif // !Py_BUILD_CORE
1700++
1701++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
1702++ static _PyArg_Parser _parser = {
1703++ .keywords = _keywords,
1704++ .fname = "openssl_sha1",
1705++ .kwtuple = KWTUPLE,
1706++ };
1707++ #undef KWTUPLE
1708 + PyObject *argsbuf[2];
1709 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1710-+ Py_buffer string = {NULL, NULL};
1711++ Py_buffer data = {NULL, NULL};
1712 + int usedforsecurity = 1;
1713 +
1714-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1715++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1716++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1717 + if (!args) {
1718 + goto exit;
1719 + }
1720@@ -1662,11 +1783,7 @@ index 0000000000..49bf8f9287
1721 + goto skip_optional_pos;
1722 + }
1723 + if (args[0]) {
1724-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1725-+ goto exit;
1726-+ }
1727-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
1728-+ _PyArg_BadArgument("openssl_sha1", "argument 'string'", "contiguous buffer", args[0]);
1729++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
1730 + goto exit;
1731 + }
1732 + if (!--noptargs) {
1733@@ -1682,42 +1799,69 @@ index 0000000000..49bf8f9287
1734 + goto exit;
1735 + }
1736 +skip_optional_kwonly:
1737-+ return_value = _hashlib_openssl_sha1_impl(module, &string, usedforsecurity);
1738++ return_value = _hashlib_openssl_sha1_impl(module, &data, usedforsecurity);
1739 +
1740 +exit:
1741-+ /* Cleanup for string */
1742-+ if (string.obj) {
1743-+ PyBuffer_Release(&string);
1744++ /* Cleanup for data */
1745++ if (data.obj) {
1746++ PyBuffer_Release(&data);
1747 + }
1748 +
1749 + return return_value;
1750 +}
1751 +
1752 +PyDoc_STRVAR(_hashlib_openssl_sha224__doc__,
1753-+"openssl_sha224($module, /, string=None, *, usedforsecurity=True)\n"
1754++"openssl_sha224($module, /, data=<unrepresentable>, *,\n"
1755++" usedforsecurity=True)\n"
1756 +"--\n"
1757 +"\n"
1758 +"Returns a sha224 hash object; optionally initialized with a string.");
1759 +
1760 +#define _HASHLIB_OPENSSL_SHA224_METHODDEF \
1761-+ {"openssl_sha224", (PyCFunction)(void(*)(void))_hashlib_openssl_sha224, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha224__doc__},
1762++ {"openssl_sha224", _PyCFunction_CAST(_hashlib_openssl_sha224), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha224__doc__},
1763 +
1764 +static PyObject *
1765-+_hashlib_openssl_sha224_impl(PyObject *module, Py_buffer *string,
1766++_hashlib_openssl_sha224_impl(PyObject *module, Py_buffer *data,
1767 + int usedforsecurity);
1768 +
1769 +static PyObject *
1770 +_hashlib_openssl_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1771 +{
1772 + PyObject *return_value = NULL;
1773-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1774-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha224", 0};
1775++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1776++
1777++ #define NUM_KEYWORDS 2
1778++ static struct {
1779++ PyGC_Head _this_is_not_used;
1780++ PyObject_VAR_HEAD
1781++ Py_hash_t ob_hash;
1782++ PyObject *ob_item[NUM_KEYWORDS];
1783++ } _kwtuple = {
1784++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1785++ .ob_hash = -1,
1786++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
1787++ };
1788++ #undef NUM_KEYWORDS
1789++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1790++
1791++ #else // !Py_BUILD_CORE
1792++ # define KWTUPLE NULL
1793++ #endif // !Py_BUILD_CORE
1794++
1795++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
1796++ static _PyArg_Parser _parser = {
1797++ .keywords = _keywords,
1798++ .fname = "openssl_sha224",
1799++ .kwtuple = KWTUPLE,
1800++ };
1801++ #undef KWTUPLE
1802 + PyObject *argsbuf[2];
1803 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1804-+ Py_buffer string = {NULL, NULL};
1805++ Py_buffer data = {NULL, NULL};
1806 + int usedforsecurity = 1;
1807 +
1808-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1809++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1810++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1811 + if (!args) {
1812 + goto exit;
1813 + }
1814@@ -1725,11 +1869,7 @@ index 0000000000..49bf8f9287
1815 + goto skip_optional_pos;
1816 + }
1817 + if (args[0]) {
1818-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1819-+ goto exit;
1820-+ }
1821-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
1822-+ _PyArg_BadArgument("openssl_sha224", "argument 'string'", "contiguous buffer", args[0]);
1823++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
1824 + goto exit;
1825 + }
1826 + if (!--noptargs) {
1827@@ -1745,42 +1885,69 @@ index 0000000000..49bf8f9287
1828 + goto exit;
1829 + }
1830 +skip_optional_kwonly:
1831-+ return_value = _hashlib_openssl_sha224_impl(module, &string, usedforsecurity);
1832++ return_value = _hashlib_openssl_sha224_impl(module, &data, usedforsecurity);
1833 +
1834 +exit:
1835-+ /* Cleanup for string */
1836-+ if (string.obj) {
1837-+ PyBuffer_Release(&string);
1838++ /* Cleanup for data */
1839++ if (data.obj) {
1840++ PyBuffer_Release(&data);
1841 + }
1842 +
1843 + return return_value;
1844 +}
1845 +
1846 +PyDoc_STRVAR(_hashlib_openssl_sha256__doc__,
1847-+"openssl_sha256($module, /, string=None, *, usedforsecurity=True)\n"
1848++"openssl_sha256($module, /, data=<unrepresentable>, *,\n"
1849++" usedforsecurity=True)\n"
1850 +"--\n"
1851 +"\n"
1852 +"Returns a sha256 hash object; optionally initialized with a string.");
1853 +
1854 +#define _HASHLIB_OPENSSL_SHA256_METHODDEF \
1855-+ {"openssl_sha256", (PyCFunction)(void(*)(void))_hashlib_openssl_sha256, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha256__doc__},
1856++ {"openssl_sha256", _PyCFunction_CAST(_hashlib_openssl_sha256), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha256__doc__},
1857 +
1858 +static PyObject *
1859-+_hashlib_openssl_sha256_impl(PyObject *module, Py_buffer *string,
1860++_hashlib_openssl_sha256_impl(PyObject *module, Py_buffer *data,
1861 + int usedforsecurity);
1862 +
1863 +static PyObject *
1864 +_hashlib_openssl_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1865 +{
1866 + PyObject *return_value = NULL;
1867-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1868-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha256", 0};
1869++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1870++
1871++ #define NUM_KEYWORDS 2
1872++ static struct {
1873++ PyGC_Head _this_is_not_used;
1874++ PyObject_VAR_HEAD
1875++ Py_hash_t ob_hash;
1876++ PyObject *ob_item[NUM_KEYWORDS];
1877++ } _kwtuple = {
1878++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1879++ .ob_hash = -1,
1880++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
1881++ };
1882++ #undef NUM_KEYWORDS
1883++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1884++
1885++ #else // !Py_BUILD_CORE
1886++ # define KWTUPLE NULL
1887++ #endif // !Py_BUILD_CORE
1888++
1889++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
1890++ static _PyArg_Parser _parser = {
1891++ .keywords = _keywords,
1892++ .fname = "openssl_sha256",
1893++ .kwtuple = KWTUPLE,
1894++ };
1895++ #undef KWTUPLE
1896 + PyObject *argsbuf[2];
1897 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1898-+ Py_buffer string = {NULL, NULL};
1899++ Py_buffer data = {NULL, NULL};
1900 + int usedforsecurity = 1;
1901 +
1902-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1903++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1904++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1905 + if (!args) {
1906 + goto exit;
1907 + }
1908@@ -1788,11 +1955,7 @@ index 0000000000..49bf8f9287
1909 + goto skip_optional_pos;
1910 + }
1911 + if (args[0]) {
1912-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
1913-+ goto exit;
1914-+ }
1915-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
1916-+ _PyArg_BadArgument("openssl_sha256", "argument 'string'", "contiguous buffer", args[0]);
1917++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
1918 + goto exit;
1919 + }
1920 + if (!--noptargs) {
1921@@ -1808,42 +1971,69 @@ index 0000000000..49bf8f9287
1922 + goto exit;
1923 + }
1924 +skip_optional_kwonly:
1925-+ return_value = _hashlib_openssl_sha256_impl(module, &string, usedforsecurity);
1926++ return_value = _hashlib_openssl_sha256_impl(module, &data, usedforsecurity);
1927 +
1928 +exit:
1929-+ /* Cleanup for string */
1930-+ if (string.obj) {
1931-+ PyBuffer_Release(&string);
1932++ /* Cleanup for data */
1933++ if (data.obj) {
1934++ PyBuffer_Release(&data);
1935 + }
1936 +
1937 + return return_value;
1938 +}
1939 +
1940 +PyDoc_STRVAR(_hashlib_openssl_sha384__doc__,
1941-+"openssl_sha384($module, /, string=None, *, usedforsecurity=True)\n"
1942++"openssl_sha384($module, /, data=<unrepresentable>, *,\n"
1943++" usedforsecurity=True)\n"
1944 +"--\n"
1945 +"\n"
1946 +"Returns a sha384 hash object; optionally initialized with a string.");
1947 +
1948 +#define _HASHLIB_OPENSSL_SHA384_METHODDEF \
1949-+ {"openssl_sha384", (PyCFunction)(void(*)(void))_hashlib_openssl_sha384, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha384__doc__},
1950++ {"openssl_sha384", _PyCFunction_CAST(_hashlib_openssl_sha384), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha384__doc__},
1951 +
1952 +static PyObject *
1953-+_hashlib_openssl_sha384_impl(PyObject *module, Py_buffer *string,
1954++_hashlib_openssl_sha384_impl(PyObject *module, Py_buffer *data,
1955 + int usedforsecurity);
1956 +
1957 +static PyObject *
1958 +_hashlib_openssl_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1959 +{
1960 + PyObject *return_value = NULL;
1961-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
1962-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha384", 0};
1963++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1964++
1965++ #define NUM_KEYWORDS 2
1966++ static struct {
1967++ PyGC_Head _this_is_not_used;
1968++ PyObject_VAR_HEAD
1969++ Py_hash_t ob_hash;
1970++ PyObject *ob_item[NUM_KEYWORDS];
1971++ } _kwtuple = {
1972++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1973++ .ob_hash = -1,
1974++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
1975++ };
1976++ #undef NUM_KEYWORDS
1977++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1978++
1979++ #else // !Py_BUILD_CORE
1980++ # define KWTUPLE NULL
1981++ #endif // !Py_BUILD_CORE
1982++
1983++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
1984++ static _PyArg_Parser _parser = {
1985++ .keywords = _keywords,
1986++ .fname = "openssl_sha384",
1987++ .kwtuple = KWTUPLE,
1988++ };
1989++ #undef KWTUPLE
1990 + PyObject *argsbuf[2];
1991 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
1992-+ Py_buffer string = {NULL, NULL};
1993++ Py_buffer data = {NULL, NULL};
1994 + int usedforsecurity = 1;
1995 +
1996-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
1997++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1998++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1999 + if (!args) {
2000 + goto exit;
2001 + }
2002@@ -1851,11 +2041,7 @@ index 0000000000..49bf8f9287
2003 + goto skip_optional_pos;
2004 + }
2005 + if (args[0]) {
2006-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
2007-+ goto exit;
2008-+ }
2009-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
2010-+ _PyArg_BadArgument("openssl_sha384", "argument 'string'", "contiguous buffer", args[0]);
2011++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
2012 + goto exit;
2013 + }
2014 + if (!--noptargs) {
2015@@ -1871,42 +2057,69 @@ index 0000000000..49bf8f9287
2016 + goto exit;
2017 + }
2018 +skip_optional_kwonly:
2019-+ return_value = _hashlib_openssl_sha384_impl(module, &string, usedforsecurity);
2020++ return_value = _hashlib_openssl_sha384_impl(module, &data, usedforsecurity);
2021 +
2022 +exit:
2023-+ /* Cleanup for string */
2024-+ if (string.obj) {
2025-+ PyBuffer_Release(&string);
2026++ /* Cleanup for data */
2027++ if (data.obj) {
2028++ PyBuffer_Release(&data);
2029 + }
2030 +
2031 + return return_value;
2032 +}
2033 +
2034 +PyDoc_STRVAR(_hashlib_openssl_sha512__doc__,
2035-+"openssl_sha512($module, /, string=None, *, usedforsecurity=True)\n"
2036++"openssl_sha512($module, /, data=<unrepresentable>, *,\n"
2037++" usedforsecurity=True)\n"
2038 +"--\n"
2039 +"\n"
2040 +"Returns a sha512 hash object; optionally initialized with a string.");
2041 +
2042 +#define _HASHLIB_OPENSSL_SHA512_METHODDEF \
2043-+ {"openssl_sha512", (PyCFunction)(void(*)(void))_hashlib_openssl_sha512, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha512__doc__},
2044++ {"openssl_sha512", _PyCFunction_CAST(_hashlib_openssl_sha512), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha512__doc__},
2045 +
2046 +static PyObject *
2047-+_hashlib_openssl_sha512_impl(PyObject *module, Py_buffer *string,
2048++_hashlib_openssl_sha512_impl(PyObject *module, Py_buffer *data,
2049 + int usedforsecurity);
2050 +
2051 +static PyObject *
2052 +_hashlib_openssl_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2053 +{
2054 + PyObject *return_value = NULL;
2055-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
2056-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_sha512", 0};
2057++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2058++
2059++ #define NUM_KEYWORDS 2
2060++ static struct {
2061++ PyGC_Head _this_is_not_used;
2062++ PyObject_VAR_HEAD
2063++ Py_hash_t ob_hash;
2064++ PyObject *ob_item[NUM_KEYWORDS];
2065++ } _kwtuple = {
2066++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2067++ .ob_hash = -1,
2068++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
2069++ };
2070++ #undef NUM_KEYWORDS
2071++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2072++
2073++ #else // !Py_BUILD_CORE
2074++ # define KWTUPLE NULL
2075++ #endif // !Py_BUILD_CORE
2076++
2077++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
2078++ static _PyArg_Parser _parser = {
2079++ .keywords = _keywords,
2080++ .fname = "openssl_sha512",
2081++ .kwtuple = KWTUPLE,
2082++ };
2083++ #undef KWTUPLE
2084 + PyObject *argsbuf[2];
2085 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
2086-+ Py_buffer string = {NULL, NULL};
2087++ Py_buffer data = {NULL, NULL};
2088 + int usedforsecurity = 1;
2089 +
2090-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
2091++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2092++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2093 + if (!args) {
2094 + goto exit;
2095 + }
2096@@ -1914,11 +2127,7 @@ index 0000000000..49bf8f9287
2097 + goto skip_optional_pos;
2098 + }
2099 + if (args[0]) {
2100-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
2101-+ goto exit;
2102-+ }
2103-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
2104-+ _PyArg_BadArgument("openssl_sha512", "argument 'string'", "contiguous buffer", args[0]);
2105++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
2106 + goto exit;
2107 + }
2108 + if (!--noptargs) {
2109@@ -1934,42 +2143,69 @@ index 0000000000..49bf8f9287
2110 + goto exit;
2111 + }
2112 +skip_optional_kwonly:
2113-+ return_value = _hashlib_openssl_sha512_impl(module, &string, usedforsecurity);
2114++ return_value = _hashlib_openssl_sha512_impl(module, &data, usedforsecurity);
2115 +
2116 +exit:
2117-+ /* Cleanup for string */
2118-+ if (string.obj) {
2119-+ PyBuffer_Release(&string);
2120++ /* Cleanup for data */
2121++ if (data.obj) {
2122++ PyBuffer_Release(&data);
2123 + }
2124 +
2125 + return return_value;
2126 +}
2127 +
2128 +PyDoc_STRVAR(_hashlib_openssl_shake_128__doc__,
2129-+"openssl_shake_128($module, /, string=None, *, usedforsecurity=True)\n"
2130++"openssl_shake_128($module, /, data=<unrepresentable>, *,\n"
2131++" usedforsecurity=True)\n"
2132 +"--\n"
2133 +"\n"
2134 +"Returns a shake-128 variable hash object; optionally initialized with a string.");
2135 +
2136 +#define _HASHLIB_OPENSSL_SHAKE_128_METHODDEF \
2137-+ {"openssl_shake_128", (PyCFunction)(void(*)(void))_hashlib_openssl_shake_128, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_128__doc__},
2138++ {"openssl_shake_128", _PyCFunction_CAST(_hashlib_openssl_shake_128), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_128__doc__},
2139 +
2140 +static PyObject *
2141-+_hashlib_openssl_shake_128_impl(PyObject *module, Py_buffer *string,
2142++_hashlib_openssl_shake_128_impl(PyObject *module, Py_buffer *data,
2143 + int usedforsecurity);
2144 +
2145 +static PyObject *
2146 +_hashlib_openssl_shake_128(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2147 +{
2148 + PyObject *return_value = NULL;
2149-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
2150-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_shake_128", 0};
2151++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2152++
2153++ #define NUM_KEYWORDS 2
2154++ static struct {
2155++ PyGC_Head _this_is_not_used;
2156++ PyObject_VAR_HEAD
2157++ Py_hash_t ob_hash;
2158++ PyObject *ob_item[NUM_KEYWORDS];
2159++ } _kwtuple = {
2160++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2161++ .ob_hash = -1,
2162++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
2163++ };
2164++ #undef NUM_KEYWORDS
2165++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2166++
2167++ #else // !Py_BUILD_CORE
2168++ # define KWTUPLE NULL
2169++ #endif // !Py_BUILD_CORE
2170++
2171++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
2172++ static _PyArg_Parser _parser = {
2173++ .keywords = _keywords,
2174++ .fname = "openssl_shake_128",
2175++ .kwtuple = KWTUPLE,
2176++ };
2177++ #undef KWTUPLE
2178 + PyObject *argsbuf[2];
2179 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
2180-+ Py_buffer string = {NULL, NULL};
2181++ Py_buffer data = {NULL, NULL};
2182 + int usedforsecurity = 1;
2183 +
2184-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
2185++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2186++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2187 + if (!args) {
2188 + goto exit;
2189 + }
2190@@ -1977,11 +2213,7 @@ index 0000000000..49bf8f9287
2191 + goto skip_optional_pos;
2192 + }
2193 + if (args[0]) {
2194-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
2195-+ goto exit;
2196-+ }
2197-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
2198-+ _PyArg_BadArgument("openssl_shake_128", "argument 'string'", "contiguous buffer", args[0]);
2199++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
2200 + goto exit;
2201 + }
2202 + if (!--noptargs) {
2203@@ -1997,42 +2229,69 @@ index 0000000000..49bf8f9287
2204 + goto exit;
2205 + }
2206 +skip_optional_kwonly:
2207-+ return_value = _hashlib_openssl_shake_128_impl(module, &string, usedforsecurity);
2208++ return_value = _hashlib_openssl_shake_128_impl(module, &data, usedforsecurity);
2209 +
2210 +exit:
2211-+ /* Cleanup for string */
2212-+ if (string.obj) {
2213-+ PyBuffer_Release(&string);
2214++ /* Cleanup for data */
2215++ if (data.obj) {
2216++ PyBuffer_Release(&data);
2217 + }
2218 +
2219 + return return_value;
2220 +}
2221 +
2222 +PyDoc_STRVAR(_hashlib_openssl_shake_256__doc__,
2223-+"openssl_shake_256($module, /, string=None, *, usedforsecurity=True)\n"
2224++"openssl_shake_256($module, /, data=<unrepresentable>, *,\n"
2225++" usedforsecurity=True)\n"
2226 +"--\n"
2227 +"\n"
2228 +"Returns a shake-256 variable hash object; optionally initialized with a string.");
2229 +
2230 +#define _HASHLIB_OPENSSL_SHAKE_256_METHODDEF \
2231-+ {"openssl_shake_256", (PyCFunction)(void(*)(void))_hashlib_openssl_shake_256, METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_256__doc__},
2232++ {"openssl_shake_256", _PyCFunction_CAST(_hashlib_openssl_shake_256), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_256__doc__},
2233 +
2234 +static PyObject *
2235-+_hashlib_openssl_shake_256_impl(PyObject *module, Py_buffer *string,
2236++_hashlib_openssl_shake_256_impl(PyObject *module, Py_buffer *data,
2237 + int usedforsecurity);
2238 +
2239 +static PyObject *
2240 +_hashlib_openssl_shake_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2241 +{
2242 + PyObject *return_value = NULL;
2243-+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
2244-+ static _PyArg_Parser _parser = {NULL, _keywords, "openssl_shake_256", 0};
2245++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2246++
2247++ #define NUM_KEYWORDS 2
2248++ static struct {
2249++ PyGC_Head _this_is_not_used;
2250++ PyObject_VAR_HEAD
2251++ Py_hash_t ob_hash;
2252++ PyObject *ob_item[NUM_KEYWORDS];
2253++ } _kwtuple = {
2254++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2255++ .ob_hash = -1,
2256++ .ob_item = { &_Py_ID(data), &_Py_ID(usedforsecurity), },
2257++ };
2258++ #undef NUM_KEYWORDS
2259++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2260++
2261++ #else // !Py_BUILD_CORE
2262++ # define KWTUPLE NULL
2263++ #endif // !Py_BUILD_CORE
2264++
2265++ static const char * const _keywords[] = {"data", "usedforsecurity", NULL};
2266++ static _PyArg_Parser _parser = {
2267++ .keywords = _keywords,
2268++ .fname = "openssl_shake_256",
2269++ .kwtuple = KWTUPLE,
2270++ };
2271++ #undef KWTUPLE
2272 + PyObject *argsbuf[2];
2273 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
2274-+ Py_buffer string = {NULL, NULL};
2275++ Py_buffer data = {NULL, NULL};
2276 + int usedforsecurity = 1;
2277 +
2278-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
2279++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2280++ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2281 + if (!args) {
2282 + goto exit;
2283 + }
2284@@ -2040,11 +2299,7 @@ index 0000000000..49bf8f9287
2285 + goto skip_optional_pos;
2286 + }
2287 + if (args[0]) {
2288-+ if (PyObject_GetBuffer(args[0], &string, PyBUF_SIMPLE) != 0) {
2289-+ goto exit;
2290-+ }
2291-+ if (!PyBuffer_IsContiguous(&string, 'C')) {
2292-+ _PyArg_BadArgument("openssl_shake_256", "argument 'string'", "contiguous buffer", args[0]);
2293++ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
2294 + goto exit;
2295 + }
2296 + if (!--noptargs) {
2297@@ -2060,12 +2315,12 @@ index 0000000000..49bf8f9287
2298 + goto exit;
2299 + }
2300 +skip_optional_kwonly:
2301-+ return_value = _hashlib_openssl_shake_256_impl(module, &string, usedforsecurity);
2302++ return_value = _hashlib_openssl_shake_256_impl(module, &data, usedforsecurity);
2303 +
2304 +exit:
2305-+ /* Cleanup for string */
2306-+ if (string.obj) {
2307-+ PyBuffer_Release(&string);
2308++ /* Cleanup for data */
2309++ if (data.obj) {
2310++ PyBuffer_Release(&data);
2311 + }
2312 +
2313 + return return_value;
2314@@ -2088,7 +2343,7 @@ index 0000000000..49bf8f9287
2315 +"types and lengths of a and b--but not their values.");
2316 +
2317 +#define _HASHLIB_COMPARE_DIGEST_METHODDEF \
2318-+ {"compare_digest", (PyCFunction)(void(*)(void))_hashlib_compare_digest, METH_FASTCALL, _hashlib_compare_digest__doc__},
2319++ {"compare_digest", _PyCFunction_CAST(_hashlib_compare_digest), METH_FASTCALL, _hashlib_compare_digest__doc__},
2320 +
2321 +static PyObject *
2322 +_hashlib_compare_digest_impl(PyObject *module, PyObject *a, PyObject *b);
2323@@ -2118,7 +2373,7 @@ index 0000000000..49bf8f9287
2324 +"Single-shot HMAC.");
2325 +
2326 +#define _HASHLIB_HMAC_SINGLESHOT_METHODDEF \
2327-+ {"hmac_digest", (PyCFunction)(void(*)(void))_hashlib_hmac_singleshot, METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_singleshot__doc__},
2328++ {"hmac_digest", _PyCFunction_CAST(_hashlib_hmac_singleshot), METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_singleshot__doc__},
2329 +
2330 +static PyObject *
2331 +_hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key,
2332@@ -2128,31 +2383,49 @@ index 0000000000..49bf8f9287
2333 +_hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2334 +{
2335 + PyObject *return_value = NULL;
2336++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2337++
2338++ #define NUM_KEYWORDS 3
2339++ static struct {
2340++ PyGC_Head _this_is_not_used;
2341++ PyObject_VAR_HEAD
2342++ Py_hash_t ob_hash;
2343++ PyObject *ob_item[NUM_KEYWORDS];
2344++ } _kwtuple = {
2345++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2346++ .ob_hash = -1,
2347++ .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digest), },
2348++ };
2349++ #undef NUM_KEYWORDS
2350++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2351++
2352++ #else // !Py_BUILD_CORE
2353++ # define KWTUPLE NULL
2354++ #endif // !Py_BUILD_CORE
2355++
2356 + static const char * const _keywords[] = {"key", "msg", "digest", NULL};
2357-+ static _PyArg_Parser _parser = {NULL, _keywords, "hmac_digest", 0};
2358++ static _PyArg_Parser _parser = {
2359++ .keywords = _keywords,
2360++ .fname = "hmac_digest",
2361++ .kwtuple = KWTUPLE,
2362++ };
2363++ #undef KWTUPLE
2364 + PyObject *argsbuf[3];
2365 + Py_buffer key = {NULL, NULL};
2366 + Py_buffer msg = {NULL, NULL};
2367 + const char *digest;
2368 +
2369-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
2370++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2371++ /*minpos*/ 3, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2372 + if (!args) {
2373 + goto exit;
2374 + }
2375 + if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
2376 + goto exit;
2377 + }
2378-+ if (!PyBuffer_IsContiguous(&key, 'C')) {
2379-+ _PyArg_BadArgument("hmac_digest", "argument 'key'", "contiguous buffer", args[0]);
2380-+ goto exit;
2381-+ }
2382 + if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) {
2383 + goto exit;
2384 + }
2385-+ if (!PyBuffer_IsContiguous(&msg, 'C')) {
2386-+ _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]);
2387-+ goto exit;
2388-+ }
2389 + if (!PyUnicode_Check(args[2])) {
2390 + _PyArg_BadArgument("hmac_digest", "argument 'digest'", "str", args[2]);
2391 + goto exit;
2392@@ -2182,13 +2455,13 @@ index 0000000000..49bf8f9287
2393 +}
2394 +
2395 +PyDoc_STRVAR(_hashlib_hmac_new__doc__,
2396-+"hmac_new($module, /, key, msg=None, digestmod=None)\n"
2397++"hmac_new($module, /, key, msg=<unrepresentable>, digestmod=None)\n"
2398 +"--\n"
2399 +"\n"
2400 +"Return a new hmac object.");
2401 +
2402 +#define _HASHLIB_HMAC_NEW_METHODDEF \
2403-+ {"hmac_new", (PyCFunction)(void(*)(void))_hashlib_hmac_new, METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_new__doc__},
2404++ {"hmac_new", _PyCFunction_CAST(_hashlib_hmac_new), METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_new__doc__},
2405 +
2406 +static PyObject *
2407 +_hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, Py_buffer *msg,
2408@@ -2198,25 +2471,47 @@ index 0000000000..49bf8f9287
2409 +_hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2410 +{
2411 + PyObject *return_value = NULL;
2412++ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2413++
2414++ #define NUM_KEYWORDS 3
2415++ static struct {
2416++ PyGC_Head _this_is_not_used;
2417++ PyObject_VAR_HEAD
2418++ Py_hash_t ob_hash;
2419++ PyObject *ob_item[NUM_KEYWORDS];
2420++ } _kwtuple = {
2421++ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2422++ .ob_hash = -1,
2423++ .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digestmod), },
2424++ };
2425++ #undef NUM_KEYWORDS
2426++ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2427++
2428++ #else // !Py_BUILD_CORE
2429++ # define KWTUPLE NULL
2430++ #endif // !Py_BUILD_CORE
2431++
2432 + static const char * const _keywords[] = {"key", "msg", "digestmod", NULL};
2433-+ static _PyArg_Parser _parser = {NULL, _keywords, "hmac_new", 0};
2434++ static _PyArg_Parser _parser = {
2435++ .keywords = _keywords,
2436++ .fname = "hmac_new",
2437++ .kwtuple = KWTUPLE,
2438++ };
2439++ #undef KWTUPLE
2440 + PyObject *argsbuf[3];
2441 + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2442 + Py_buffer key = {NULL, NULL};
2443 + Py_buffer msg = {NULL, NULL};
2444 + const char *digestmod = NULL;
2445 +
2446-+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
2447++ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2448++ /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2449 + if (!args) {
2450 + goto exit;
2451 + }
2452 + if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
2453 + goto exit;
2454 + }
2455-+ if (!PyBuffer_IsContiguous(&key, 'C')) {
2456-+ _PyArg_BadArgument("hmac_new", "argument 'key'", "contiguous buffer", args[0]);
2457-+ goto exit;
2458-+ }
2459 + if (!noptargs) {
2460 + goto skip_optional_pos;
2461 + }
2462@@ -2224,10 +2519,6 @@ index 0000000000..49bf8f9287
2463 + if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) {
2464 + goto exit;
2465 + }
2466-+ if (!PyBuffer_IsContiguous(&msg, 'C')) {
2467-+ _PyArg_BadArgument("hmac_new", "argument 'msg'", "contiguous buffer", args[1]);
2468-+ goto exit;
2469-+ }
2470 + if (!--noptargs) {
2471 + goto skip_optional_pos;
2472 + }
2473@@ -2260,7 +2551,7 @@ index 0000000000..49bf8f9287
2474 +
2475 + return return_value;
2476 +}
2477-+/*[clinic end generated code: output=b4705bad5ece43e9 input=a9049054013a1b77]*/
2478++/*[clinic end generated code: output=6b2c621573a26c54 input=a9049054013a1b77]*/
2479 --
2480-2.32.0
2481+2.54.0
2482
1@@ -1,403 +0,0 @@
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-
+223,
-39
1@@ -4,17 +4,15 @@
2 /* #undef AIX_BUILDDATE */
3 /* #undef AIX_GENUINE_CPLUSPLUS */
4 #define ALIGNOF_LONG 8
5+#define ALIGNOF_MAX_ALIGN_T 16
6 #define ALIGNOF_SIZE_T 8
7 /* #undef ALT_SOABI */
8 /* #undef ANDROID_API_LEVEL */
9-/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
10 /* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
11 #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
12 #define ENABLE_IPV6 1
13-/* #undef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS */
14-/* #undef FLOAT_WORDS_BIGENDIAN */
15-/* #undef FLOCK_NEEDS_LIBBSD */
16 /* #undef GETPGRP_HAVE_ARG */
17+#define HAVE_ACCEPT 1
18 #define HAVE_ACCEPT4 1
19 #define HAVE_ACOSH 1
20 #define HAVE_ADDRINFO 1
21@@ -25,6 +23,8 @@
22 #define HAVE_ASINH 1
23 #define HAVE_ASM_TYPES_H 1
24 #define HAVE_ATANH 1
25+/* #undef HAVE_BACKTRACE */
26+#define HAVE_BIND 1
27 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
28 /* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
29 /* #undef HAVE_BLUETOOTH_H */
30@@ -37,24 +37,30 @@
31 /* #undef HAVE_BROKEN_SEM_GETVALUE */
32 /* #undef HAVE_BROKEN_UNSETENV */
33 #define HAVE_BUILTIN_ATOMIC 1
34+/* #undef HAVE_BZLIB_H */
35 /* #undef HAVE_CHFLAGS */
36+#define HAVE_CHMOD 1
37 #define HAVE_CHOWN 1
38 #define HAVE_CHROOT 1
39+#define HAVE_CLEARENV 1
40 #define HAVE_CLOCK 1
41 #define HAVE_CLOCK_GETRES 1
42 #define HAVE_CLOCK_GETTIME 1
43+#define HAVE_CLOCK_NANOSLEEP 1
44 #define HAVE_CLOCK_SETTIME 1
45+#define HAVE_CLOCK_T 1
46+/* #undef HAVE_CLOSEFROM */
47 /* #undef HAVE_CLOSE_RANGE */
48 #define HAVE_COMPUTED_GOTOS 1
49 #define HAVE_CONFSTR 1
50 /* #undef HAVE_CONIO_H */
51-#define HAVE_COPYSIGN 1
52+#define HAVE_CONNECT 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_ESCDELAY */
59 /* #undef HAVE_CURSES_FILTER */
60+/* #undef HAVE_CURSES_GETMOUSE */
61 /* #undef HAVE_CURSES_H */
62 /* #undef HAVE_CURSES_HAS_KEY */
63 /* #undef HAVE_CURSES_IMMEDOK */
64@@ -62,13 +68,15 @@
65 /* #undef HAVE_CURSES_IS_TERM_RESIZED */
66 /* #undef HAVE_CURSES_RESIZETERM */
67 /* #undef HAVE_CURSES_RESIZE_TERM */
68+/* #undef HAVE_CURSES_SET_ESCDELAY */
69+/* #undef HAVE_CURSES_SET_TABSIZE */
70 /* #undef HAVE_CURSES_SYNCOK */
71+/* #undef HAVE_CURSES_TABSIZE */
72 /* #undef HAVE_CURSES_TYPEAHEAD */
73 /* #undef HAVE_CURSES_USE_ENV */
74 /* #undef HAVE_CURSES_WCHGAT */
75-#define HAVE_DECL_ISFINITE 1
76-#define HAVE_DECL_ISINF 1
77-#define HAVE_DECL_ISNAN 1
78+/* #undef HAVE_DB_H */
79+/* #undef HAVE_DECL_PR_SET_VMA_ANON_NAME */
80 #define HAVE_DECL_RTLD_DEEPBIND 0
81 #define HAVE_DECL_RTLD_GLOBAL 1
82 #define HAVE_DECL_RTLD_LAZY 1
83@@ -78,6 +86,7 @@
84 #define HAVE_DECL_RTLD_NOLOAD 1
85 #define HAVE_DECL_RTLD_NOW 1
86 /* #undef HAVE_DECL_TZNAME */
87+#define HAVE_DECL_UT_NAMESIZE 1
88 #define HAVE_DEVICE_MACROS 1
89 /* #undef HAVE_DEV_PTC */
90 #define HAVE_DEV_PTMX 1
91@@ -85,12 +94,17 @@
92 #define HAVE_DIRENT_D_TYPE 1
93 #define HAVE_DIRENT_H 1
94 #define HAVE_DIRFD 1
95+/* #undef HAVE_DLADDR */
96+/* #undef HAVE_DLADDR1 */
97 #define HAVE_DLFCN_H 1
98 /* #undef HAVE_DLOPEN */
99+/* #undef HAVE_DL_ITERATE_PHDR */
100+#define HAVE_DUP 1
101 #define HAVE_DUP2 1
102 #define HAVE_DUP3 1
103 /* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
104 /* #undef HAVE_DYNAMIC_LOADING */
105+/* #undef HAVE_EDITLINE_READLINE_H */
106 #define HAVE_ENDIAN_H 1
107 #define HAVE_EPOLL 1
108 #define HAVE_EPOLL_CREATE1 1
109@@ -98,6 +112,7 @@
110 #define HAVE_ERFC 1
111 #define HAVE_ERRNO_H 1
112 #define HAVE_EVENTFD 1
113+/* #undef HAVE_EXECINFO_H */
114 #define HAVE_EXECV 1
115 #define HAVE_EXPLICIT_BZERO 1
116 /* #undef HAVE_EXPLICIT_MEMSET */
117@@ -113,9 +128,12 @@
118 #define HAVE_FDOPENDIR 1
119 /* #undef HAVE_FDWALK */
120 #define HAVE_FEXECVE 1
121-#define HAVE_FINITE 1
122+/* #undef HAVE_FFI_CLOSURE_ALLOC */
123+/* #undef HAVE_FFI_PREP_CIF_VAR */
124+/* #undef HAVE_FFI_PREP_CLOSURE_LOC */
125 #define HAVE_FLOCK 1
126 #define HAVE_FORK 1
127+/* #undef HAVE_FORK1 */
128 #define HAVE_FORKPTY 1
129 #define HAVE_FPATHCONF 1
130 /* #undef HAVE_FSEEK64 */
131@@ -131,54 +149,72 @@
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 #ifdef __x86_64__
138 #define HAVE_GCC_ASM_FOR_X64 1
139 #define HAVE_GCC_ASM_FOR_X87 1
140 #endif
141 #define HAVE_GCC_UINT128_T 1
142+/* #undef HAVE_GDBM_DASH_NDBM_H */
143+/* #undef HAVE_GDBM_H */
144+/* #undef HAVE_GDBM_NDBM_H */
145 #define HAVE_GETADDRINFO 1
146 #define HAVE_GETC_UNLOCKED 1
147+#define HAVE_GETEGID 1
148 #define HAVE_GETENTROPY 1
149+#define HAVE_GETEUID 1
150+#define HAVE_GETGID 1
151+#define HAVE_GETGRENT 1
152+#define HAVE_GETGRGID 1
153 #define HAVE_GETGRGID_R 1
154 #define HAVE_GETGRNAM_R 1
155 #define HAVE_GETGROUPLIST 1
156 #define HAVE_GETGROUPS 1
157-/* #undef HAVE_GETHOSTBYNAME */
158+#define HAVE_GETHOSTBYADDR 1
159+#define HAVE_GETHOSTBYNAME 1
160 #define HAVE_GETHOSTBYNAME_R 1
161 /* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
162 /* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
163 #define HAVE_GETHOSTBYNAME_R_6_ARG 1
164+#define HAVE_GETHOSTNAME 1
165 #define HAVE_GETITIMER 1
166 #define HAVE_GETLOADAVG 1
167 #define HAVE_GETLOGIN 1
168+#define HAVE_GETLOGIN_R 1
169 #define HAVE_GETNAMEINFO 1
170 #define HAVE_GETPAGESIZE 1
171 #define HAVE_GETPEERNAME 1
172 #define HAVE_GETPGID 1
173 #define HAVE_GETPGRP 1
174 #define HAVE_GETPID 1
175+#define HAVE_GETPPID 1
176 #define HAVE_GETPRIORITY 1
177+#define HAVE_GETPROTOBYNAME 1
178 #define HAVE_GETPWENT 1
179 #define HAVE_GETPWNAM_R 1
180+#define HAVE_GETPWUID 1
181 #define HAVE_GETPWUID_R 1
182 #define HAVE_GETRANDOM 1
183 #define HAVE_GETRANDOM_SYSCALL 1
184 #define HAVE_GETRESGID 1
185 #define HAVE_GETRESUID 1
186+#define HAVE_GETRUSAGE 1
187+#define HAVE_GETSERVBYNAME 1
188+#define HAVE_GETSERVBYPORT 1
189 #define HAVE_GETSID 1
190+#define HAVE_GETSOCKNAME 1
191 #define HAVE_GETSPENT 1
192 #define HAVE_GETSPNAM 1
193+#define HAVE_GETUID 1
194 /* #undef HAVE_GETWD */
195 /* #undef HAVE_GLIBC_MEMMOVE_BUG */
196+#define HAVE_GRANTPT 1
197 #define HAVE_GRP_H 1
198 #define HAVE_HSTRERROR 1
199 #define HAVE_HTOLE64 1
200-#define HAVE_HYPOT 1
201-/* #undef HAVE_IEEEFP_H */
202 #define HAVE_IF_NAMEINDEX 1
203 #define HAVE_INET_ATON 1
204+#define HAVE_INET_NTOA 1
205 #define HAVE_INET_PTON 1
206 #define HAVE_INITGROUPS 1
207 #define HAVE_INTTYPES_H 1
208@@ -192,42 +228,53 @@
209 /* #undef HAVE_LCHFLAGS */
210 /* #undef HAVE_LCHMOD */
211 #define HAVE_LCHOWN 1
212-#define HAVE_LGAMMA 1
213+/* #undef HAVE_LIBDB */
214 #define HAVE_LIBDL 1
215 /* #undef HAVE_LIBDLD */
216 /* #undef HAVE_LIBIEEE */
217 #define HAVE_LIBINTL_H 1
218-/* #undef HAVE_LIBREADLINE */
219-/* #undef HAVE_LIBRESOLV */
220 /* #undef HAVE_LIBSENDFILE */
221+/* #undef HAVE_LIBSQLITE3 */
222 /* #undef HAVE_LIBUTIL_H */
223 #define HAVE_LINK 1
224 #define HAVE_LINKAT 1
225+#define HAVE_LINK_H 1
226+#define HAVE_LINUX_AUXVEC_H 1
227 #define HAVE_LINUX_CAN_BCM_H 1
228 #define HAVE_LINUX_CAN_H 1
229+#define HAVE_LINUX_CAN_ISOTP_H 1
230 #define HAVE_LINUX_CAN_J1939_H 1
231 #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1
232 #define HAVE_LINUX_CAN_RAW_H 1
233 #define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1
234+#define HAVE_LINUX_FS_H 1
235+#define HAVE_LINUX_LIMITS_H 1
236 #define HAVE_LINUX_MEMFD_H 1
237+#define HAVE_LINUX_NETFILTER_IPV4_H 1
238 #define HAVE_LINUX_NETLINK_H 1
239 #define HAVE_LINUX_QRTR_H 1
240 #define HAVE_LINUX_RANDOM_H 1
241+#define HAVE_LINUX_SCHED_H 1
242+#define HAVE_LINUX_SOUNDCARD_H 1
243 #define HAVE_LINUX_TIPC_H 1
244 #define HAVE_LINUX_VM_SOCKETS_H 1
245 #define HAVE_LINUX_WAIT_H 1
246+#define HAVE_LISTEN 1
247 #define HAVE_LOCKF 1
248 #define HAVE_LOG1P 1
249 #define HAVE_LOG2 1
250+#define HAVE_LOGIN_TTY 1
251 #define HAVE_LONG_DOUBLE 1
252 #define HAVE_LSTAT 1
253 #define HAVE_LUTIMES 1
254+/* #undef HAVE_LZMA_H */
255 #define HAVE_MADVISE 1
256 #define HAVE_MAKEDEV 1
257+/* #undef HAVE_MAXLOGNAME */
258 #define HAVE_MBRTOWC 1
259 #define HAVE_MEMFD_CREATE 1
260-#define HAVE_MEMORY_H 1
261 #define HAVE_MEMRCHR 1
262+/* #undef HAVE_MINIX_CONFIG_H */
263 #define HAVE_MKDIRAT 1
264 #define HAVE_MKFIFO 1
265 #define HAVE_MKFIFOAT 1
266@@ -236,55 +283,91 @@
267 #define HAVE_MKTIME 1
268 #define HAVE_MMAP 1
269 #define HAVE_MREMAP 1
270+#define HAVE_NANOSLEEP 1
271+/* #undef HAVE_NCURSES */
272+/* #undef HAVE_NCURSESW */
273+/* #undef HAVE_NCURSESW_CURSES_H */
274+/* #undef HAVE_NCURSESW_NCURSES_H */
275+/* #undef HAVE_NCURSESW_PANEL_H */
276+/* #undef HAVE_NCURSES_CURSES_H */
277 /* #undef HAVE_NCURSES_H */
278+/* #undef HAVE_NCURSES_NCURSES_H */
279+/* #undef HAVE_NCURSES_PANEL_H */
280+/* #undef HAVE_NDBM_H */
281 /* #undef HAVE_NDIR_H */
282+/* #undef HAVE_NETCAN_CAN_H */
283+#define HAVE_NETDB_H 1
284+#define HAVE_NETINET_IN_H 1
285+/* #undef HAVE_NETLINK_NETLINK_H */
286 #define HAVE_NETPACKET_PACKET_H 1
287+#define HAVE_NET_ETHERNET_H 1
288 #define HAVE_NET_IF_H 1
289 #define HAVE_NICE 1
290 /* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
291 #define HAVE_OPENAT 1
292+#define HAVE_OPENDIR 1
293 #define HAVE_OPENPTY 1
294+/* #undef HAVE_PANEL */
295+/* #undef HAVE_PANELW */
296+/* #undef HAVE_PANEL_H */
297 #define HAVE_PATHCONF 1
298 #define HAVE_PAUSE 1
299+#define HAVE_PIPE 1
300 #define HAVE_PIPE2 1
301 /* #undef HAVE_PLOCK */
302 #define HAVE_POLL 1
303 #define HAVE_POLL_H 1
304 #define HAVE_POSIX_FADVISE 1
305 #define HAVE_POSIX_FALLOCATE 1
306+#define HAVE_POSIX_OPENPT 1
307 #define HAVE_POSIX_SPAWN 1
308 #define HAVE_POSIX_SPAWNP 1
309+/* #undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSEFROM_NP */
310+#define HAVE_PPOLL 1
311 #define HAVE_PREAD 1
312 #define HAVE_PREADV 1
313-/* #undef HAVE_PREADV2 */
314+#define HAVE_PREADV2 1
315 #define HAVE_PRLIMIT 1
316 /* #undef HAVE_PROCESS_H */
317+#define HAVE_PROCESS_VM_READV 1
318 #define HAVE_PROTOTYPES 1
319 #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
320+/* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
321 /* #undef HAVE_PTHREAD_DESTRUCTOR */
322+#define HAVE_PTHREAD_GETATTR_NP 1
323 #define HAVE_PTHREAD_GETCPUCLOCKID 1
324+#define HAVE_PTHREAD_GETNAME_NP 1
325+/* #undef HAVE_PTHREAD_GET_NAME_NP */
326 #define HAVE_PTHREAD_H 1
327 /* #undef HAVE_PTHREAD_INIT */
328 #define HAVE_PTHREAD_KILL 1
329+/* #undef HAVE_PTHREAD_NP_H */
330+#define HAVE_PTHREAD_SETNAME_NP 1
331+/* #undef HAVE_PTHREAD_SET_NAME_NP */
332 #define HAVE_PTHREAD_SIGMASK 1
333+/* #undef HAVE_PTHREAD_STUBS */
334+#define HAVE_PTSNAME 1
335+#define HAVE_PTSNAME_R 1
336 #define HAVE_PTY_H 1
337 #define HAVE_PWRITE 1
338 #define HAVE_PWRITEV 1
339-/* #undef HAVE_PWRITEV2 */
340+#define HAVE_PWRITEV2 1
341+/* #undef HAVE_READLINE_READLINE_H */
342 #define HAVE_READLINK 1
343 #define HAVE_READLINKAT 1
344 #define HAVE_READV 1
345 #define HAVE_REALPATH 1
346+#define HAVE_RECVFROM 1
347 #define HAVE_RENAMEAT 1
348 /* #undef HAVE_RL_APPEND_HISTORY */
349 /* #undef HAVE_RL_CATCH_SIGNAL */
350+/* #undef HAVE_RL_COMPDISP_FUNC_T */
351 /* #undef HAVE_RL_COMPLETION_APPEND_CHARACTER */
352 /* #undef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK */
353 /* #undef HAVE_RL_COMPLETION_MATCHES */
354 /* #undef HAVE_RL_COMPLETION_SUPPRESS_APPEND */
355 /* #undef HAVE_RL_PRE_INPUT_HOOK */
356 /* #undef HAVE_RL_RESIZE_TERMINAL */
357-#define HAVE_ROUND 1
358 /* #undef HAVE_RTPSPAWN */
359 #define HAVE_SCHED_GET_PRIORITY_MAX 1
360 #define HAVE_SCHED_H 1
361@@ -292,18 +375,22 @@
362 #define HAVE_SCHED_SETAFFINITY 1
363 #define HAVE_SCHED_SETPARAM 1
364 #define HAVE_SCHED_SETSCHEDULER 1
365+/* #undef HAVE_SEM_CLOCKWAIT */
366 #define HAVE_SEM_GETVALUE 1
367 #define HAVE_SEM_OPEN 1
368 #define HAVE_SEM_TIMEDWAIT 1
369 #define HAVE_SEM_UNLINK 1
370 #define HAVE_SENDFILE 1
371+#define HAVE_SENDTO 1
372 #define HAVE_SETEGID 1
373 #define HAVE_SETEUID 1
374 #define HAVE_SETGID 1
375 #define HAVE_SETGROUPS 1
376 #define HAVE_SETHOSTNAME 1
377 #define HAVE_SETITIMER 1
378+#define HAVE_SETJMP_H 1
379 #define HAVE_SETLOCALE 1
380+#define HAVE_SETNS 1
381 #define HAVE_SETPGID 1
382 #define HAVE_SETPGRP 1
383 #define HAVE_SETPRIORITY 1
384@@ -312,11 +399,13 @@
385 #define HAVE_SETRESUID 1
386 #define HAVE_SETREUID 1
387 #define HAVE_SETSID 1
388+#define HAVE_SETSOCKOPT 1
389 #define HAVE_SETUID 1
390 #define HAVE_SETVBUF 1
391 #define HAVE_SHADOW_H 1
392 #define HAVE_SHM_OPEN 1
393 #define HAVE_SHM_UNLINK 1
394+#define HAVE_SHUTDOWN 1
395 #define HAVE_SIGACTION 1
396 #define HAVE_SIGALTSTACK 1
397 #define HAVE_SIGFILLSET 1
398@@ -332,15 +421,18 @@
399 #define HAVE_SOCKADDR_ALG 1
400 /* #undef HAVE_SOCKADDR_SA_LEN */
401 #define HAVE_SOCKADDR_STORAGE 1
402+#define HAVE_SOCKET 1
403 #define HAVE_SOCKETPAIR 1
404+#define HAVE_SOCKLEN_T 1
405 #define HAVE_SPAWN_H 1
406 #define HAVE_SPLICE 1
407 #define HAVE_SSIZE_T 1
408 #define HAVE_STATVFS 1
409+#define HAVE_STATX 1
410 #define HAVE_STAT_TV_NSEC 1
411 /* #undef HAVE_STAT_TV_NSEC2 */
412-#define HAVE_STDARG_PROTOTYPES 1
413 #define HAVE_STDINT_H 1
414+#define HAVE_STDIO_H 1
415 #define HAVE_STDLIB_H 1
416 #define HAVE_STD_ATOMIC 1
417 #define HAVE_STRFTIME 1
418@@ -351,6 +443,12 @@
419 #define HAVE_STRSIGNAL 1
420 #define HAVE_STRUCT_PASSWD_PW_GECOS 1
421 #define HAVE_STRUCT_PASSWD_PW_PASSWD 1
422+/* #undef HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT */
423+#define HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MIN 1
424+#define HAVE_STRUCT_STATX_STX_DIO_MEM_ALIGN 1
425+/* #undef HAVE_STRUCT_STATX_STX_DIO_READ_OFFSET_ALIGN */
426+#define HAVE_STRUCT_STATX_STX_MNT_ID 1
427+#define HAVE_STRUCT_STATX_STX_SUBVOL 1
428 /* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */
429 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
430 #define HAVE_STRUCT_STAT_ST_BLOCKS 1
431@@ -362,8 +460,12 @@
432 #define HAVE_SYMLINKAT 1
433 #define HAVE_SYNC 1
434 #define HAVE_SYSCONF 1
435+/* #undef HAVE_SYSCTLBYNAME */
436 #define HAVE_SYSEXITS_H 1
437+#define HAVE_SYSLOG_H 1
438+#define HAVE_SYSTEM 1
439 /* #undef HAVE_SYS_AUDIOIO_H */
440+#define HAVE_SYS_AUXV_H 1
441 /* #undef HAVE_SYS_BSDTTY_H */
442 /* #undef HAVE_SYS_DEVPOLL_H */
443 /* #undef HAVE_SYS_DIR_H */
444@@ -382,18 +484,22 @@
445 /* #undef HAVE_SYS_MODEM_H */
446 /* #undef HAVE_SYS_NDIR_H */
447 #define HAVE_SYS_PARAM_H 1
448+/* #undef HAVE_SYS_PIDFD_H */
449 #define HAVE_SYS_POLL_H 1
450 #define HAVE_SYS_RANDOM_H 1
451 #define HAVE_SYS_RESOURCE_H 1
452 #define HAVE_SYS_SELECT_H 1
453 #define HAVE_SYS_SENDFILE_H 1
454 #define HAVE_SYS_SOCKET_H 1
455+#define HAVE_SYS_SOUNDCARD_H 1
456 #define HAVE_SYS_STATVFS_H 1
457 #define HAVE_SYS_STAT_H 1
458 #define HAVE_SYS_SYSCALL_H 1
459+/* #undef HAVE_SYS_SYSCTL_H */
460 #define HAVE_SYS_SYSMACROS_H 1
461 /* #undef HAVE_SYS_SYS_DOMAIN_H */
462 /* #undef HAVE_SYS_TERMIO_H */
463+#define HAVE_SYS_TIMERFD_H 1
464 #define HAVE_SYS_TIMES_H 1
465 #define HAVE_SYS_TIME_H 1
466 #define HAVE_SYS_TYPES_H 1
467@@ -407,30 +513,37 @@
468 #define HAVE_TEMPNAM 1
469 #define HAVE_TERMIOS_H 1
470 /* #undef HAVE_TERM_H */
471-#define HAVE_TGAMMA 1
472 #define HAVE_TIMEGM 1
473+#define HAVE_TIMERFD_CREATE 1
474 #define HAVE_TIMES 1
475 #define HAVE_TMPFILE 1
476 #define HAVE_TMPNAM 1
477 /* #undef HAVE_TMPNAM_R */
478 #define HAVE_TM_ZONE 1
479 #define HAVE_TRUNCATE 1
480+#define HAVE_TTYNAME_R 1
481 /* #undef HAVE_TZNAME */
482-/* #undef HAVE_UCS4_TCL */
483+#define HAVE_UMASK 1
484 #define HAVE_UNAME 1
485 #define HAVE_UNISTD_H 1
486 #define HAVE_UNLINKAT 1
487+#define HAVE_UNLOCKPT 1
488+#define HAVE_UNSHARE 1
489 /* #undef HAVE_USABLE_WCHAR_T */
490 /* #undef HAVE_UTIL_H */
491 #define HAVE_UTIMENSAT 1
492 #define HAVE_UTIMES 1
493 #define HAVE_UTIME_H 1
494+#define HAVE_UTMP_H 1
495+#define HAVE_UT_NAMESIZE 1
496 /* #undef HAVE_UUID_CREATE */
497 /* #undef HAVE_UUID_ENC_BE */
498 /* #undef HAVE_UUID_GENERATE_TIME_SAFE */
499+/* #undef HAVE_UUID_GENERATE_TIME_SAFE_STABLE_MAC */
500 /* #undef HAVE_UUID_H */
501 /* #undef HAVE_UUID_UUID_H */
502 #define HAVE_VFORK 1
503+#define HAVE_WAIT 1
504 #define HAVE_WAIT3 1
505 #define HAVE_WAIT4 1
506 #define HAVE_WAITID 1
507@@ -442,8 +555,12 @@
508 #define HAVE_WMEMCMP 1
509 #define HAVE_WORKING_TZSET 1
510 #define HAVE_WRITEV 1
511+/* #undef HAVE_ZDICT_H */
512 #define HAVE_ZLIB_COPY 1
513+/* #undef HAVE_ZLIB_H */
514+/* #undef HAVE_ZSTD_H */
515 /* #undef HAVE__GETPTY */
516+#define HAVE___UINT128_T 1
517 /* #undef MAJOR_IN_MKDEV */
518 #define MAJOR_IN_SYSMACROS 1
519 /* #undef MVWDELCH_IS_EXPRESSION */
520@@ -457,18 +574,26 @@
521 #define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
522 #define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
523 /* #undef PYLONG_BITS_IN_DIGIT */
524+/* #undef PYMALLOC_USE_HUGEPAGES */
525 #define PY_BUILTIN_HASHLIB_HASHES "sha3,blake2"
526 #define PY_COERCE_C_LOCALE 1
527-#define PY_FORMAT_SIZE_T "z"
528+/* #undef PY_HAVE_PERF_TRAMPOLINE */
529+/* #undef PY_SQLITE_ENABLE_LOAD_EXTENSION */
530+/* #undef PY_SQLITE_HAVE_SERIALIZE */
531 #define PY_SSL_DEFAULT_CIPHERS 0
532 #define PY_SSL_DEFAULT_CIPHER_STRING "TLSv1.3:TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE"
533+#define PY_SUPPORT_TIER 0
534 /* #undef Py_DEBUG */
535 /* #undef Py_ENABLE_SHARED */
536+/* #undef Py_GIL_DISABLED */
537 /* #undef Py_HASH_ALGORITHM */
538+/* #undef Py_REMOTE_DEBUG */
539+/* #undef Py_RL_STARTUP_HOOK_TAKES_ARGS */
540+/* #undef Py_STATS */
541+/* #undef Py_SUNOS_VERSION */
542 /* #undef Py_TRACE_REFS */
543 #define RETSIGTYPE void
544 /* #undef SETPGRP_HAVE_ARG */
545-/* #undef SHM_NEEDS_LIBRT */
546 /* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
547 #define SIZEOF_DOUBLE 8
548 #define SIZEOF_FLOAT 4
549@@ -488,26 +613,75 @@
550 #define SIZEOF_VOID_P 8
551 #define SIZEOF_WCHAR_T 4
552 #define SIZEOF__BOOL 1
553+/* #undef SOABI_PLATFORM */
554 #define STDC_HEADERS 1
555 #define SYS_SELECT_WITH_SYS_TIME 1
556+/* #undef THREAD_STACK_SIZE */
557 /* #undef TIMEMODULE_LIB */
558-#define TIME_WITH_SYS_TIME 1
559 /* #undef TM_IN_SYS_TIME */
560 /* #undef USE_COMPUTED_GOTOS */
561 #ifndef _ALL_SOURCE
562 # define _ALL_SOURCE 1
563 #endif
564+#ifndef _DARWIN_C_SOURCE
565+# define _DARWIN_C_SOURCE 1
566+#endif
567+#ifndef __EXTENSIONS__
568+# define __EXTENSIONS__ 1
569+#endif
570 #ifndef _GNU_SOURCE
571 # define _GNU_SOURCE 1
572 #endif
573+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
574+# define _HPUX_ALT_XOPEN_SOCKET_API 1
575+#endif
576+#ifndef _MINIX
577+/* # undef _MINIX */
578+#endif
579+#ifndef _NETBSD_SOURCE
580+# define _NETBSD_SOURCE 1
581+#endif
582+#ifndef _OPENBSD_SOURCE
583+# define _OPENBSD_SOURCE 1
584+#endif
585+#ifndef _POSIX_SOURCE
586+/* # undef _POSIX_SOURCE */
587+#endif
588+#ifndef _POSIX_1_SOURCE
589+/* # undef _POSIX_1_SOURCE */
590+#endif
591 #ifndef _POSIX_PTHREAD_SEMANTICS
592 # define _POSIX_PTHREAD_SEMANTICS 1
593 #endif
594+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
595+# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
596+#endif
597+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
598+# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
599+#endif
600+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
601+# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
602+#endif
603+#ifndef __STDC_WANT_IEC_60559_EXT__
604+# define __STDC_WANT_IEC_60559_EXT__ 1
605+#endif
606+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
607+# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
608+#endif
609+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
610+# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
611+#endif
612+#ifndef __STDC_WANT_LIB_EXT2__
613+# define __STDC_WANT_LIB_EXT2__ 1
614+#endif
615+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
616+# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
617+#endif
618 #ifndef _TANDEM_SOURCE
619 # define _TANDEM_SOURCE 1
620 #endif
621-#ifndef __EXTENSIONS__
622-# define __EXTENSIONS__ 1
623+#ifndef _XOPEN_SOURCE
624+# define _XOPEN_SOURCE 800
625 #endif
626 /* #undef WINDOW_HAS_FLAGS */
627 #define WITH_DECIMAL_CONTEXTVAR 1
628@@ -516,6 +690,7 @@
629 /* #undef WITH_DYLD */
630 /* #undef WITH_EDITLINE */
631 /* #undef WITH_LIBINTL */
632+/* #undef WITH_MIMALLOC */
633 /* #undef WITH_NEXT_FRAMEWORK */
634 /* #undef WITH_PYMALLOC */
635 /* #undef WITH_VALGRIND */
636@@ -532,24 +707,33 @@
637 /* #undef _BSD_SOURCE */
638 #define _DARWIN_C_SOURCE 1
639 #define _FILE_OFFSET_BITS 64
640-#define _GNU_SOURCE 1
641 /* #undef _INCLUDE__STDC_A1_SOURCE */
642 #define _LARGEFILE_SOURCE 1
643 /* #undef _LARGE_FILES */
644-/* #undef _MINIX */
645 #define _NETBSD_SOURCE 1
646-/* #undef _POSIX_1_SOURCE */
647-#define _POSIX_C_SOURCE 200809L
648-/* #undef _POSIX_SOURCE */
649+#define _POSIX_C_SOURCE 202405L
650 /* #undef _POSIX_THREADS */
651 #define _PYTHONFRAMEWORK ""
652+#define _PYTHREAD_NAME_MAXLEN 15
653+/* #undef _Py_FFI_SUPPORT_C_COMPLEX */
654+/* #undef _Py_HACL_CAN_COMPILE_VEC128 */
655+/* #undef _Py_HACL_CAN_COMPILE_VEC256 */
656+#define _Py_HAVE_EFFICIENT_BUILTIN_SHUFFLEVECTOR 1
657+#define _Py_HAVE_LIBGCC_EH_FRAME_REGISTRATION 1
658+/* #undef _Py_HAVE_PR_SET_VMA_ANON_NAME */
659+/* #undef _Py_HAVE_PTHREAD_ATTR_GET_NP */
660+#define _Py_HAVE_STRERROR_R 1
661+/* #undef _Py_LINKER_THREAD_STACK_SIZE */
662+#define _Py_STACK_GROWS_DOWN 1
663+/* #undef _Py_TAIL_CALL_INTERP */
664+#define _Py_WITH_FRAME_POINTERS 1
665 #define _REENTRANT 1
666-#define _XOPEN_SOURCE 700
667+/* #undef _WASI_EMULATED_GETPID */
668+/* #undef _WASI_EMULATED_PROCESS_CLOCKS */
669+/* #undef _WASI_EMULATED_SIGNAL */
670+#define _XOPEN_SOURCE 800
671 #define _XOPEN_SOURCE_EXTENDED 1
672 #define __BSD_VISIBLE 1
673-#ifndef __CHAR_UNSIGNED__
674-/* # undef __CHAR_UNSIGNED__ */
675-#endif
676 /* #undef clock_t */
677 /* #undef const */
678 /* #undef gid_t */
+137,
-165
1@@ -1,26 +1,65 @@
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+__hello__.py
6+__phello__/__init__.py
7+__phello__/ham/__init__.py
8+__phello__/ham/eggs.py
9+__phello__/spam.py
10 _aix_support.py
11-_bootsubprocess.py
12+_android_support.py
13+_apple_support.py
14+_ast_unparse.py
15 _collections_abc.py
16+_colorize.py
17 _compat_pickle.py
18-_compression.py
19+_ios_support.py
20 _markupbase.py
21+_opcode_metadata.py
22 _osx_support.py
23 _py_abc.py
24+_py_warnings.py
25+_pydatetime.py
26 _pydecimal.py
27 _pyio.py
28+_pylong.py
29+_pyrepl/__init__.py
30+_pyrepl/__main__.py
31+_pyrepl/_module_completer.py
32+_pyrepl/_threading_handler.py
33+_pyrepl/base_eventqueue.py
34+_pyrepl/commands.py
35+_pyrepl/completing_reader.py
36+_pyrepl/console.py
37+_pyrepl/content.py
38+_pyrepl/fancy_termios.py
39+_pyrepl/fancycompleter.py
40+_pyrepl/historical_reader.py
41+_pyrepl/input.py
42+_pyrepl/keymap.py
43+_pyrepl/layout.py
44+_pyrepl/main.py
45+_pyrepl/pager.py
46+_pyrepl/reader.py
47+_pyrepl/readline.py
48+_pyrepl/render.py
49+_pyrepl/simple_interact.py
50+_pyrepl/terminfo.py
51+_pyrepl/trace.py
52+_pyrepl/types.py
53+_pyrepl/unix_console.py
54+_pyrepl/unix_eventqueue.py
55+_pyrepl/utils.py
56+_pyrepl/windows_console.py
57+_pyrepl/windows_eventqueue.py
58 _sitebuiltins.py
59 _strptime.py
60 _threading_local.py
61 _weakrefset.py
62 abc.py
63-aifc.py
64+annotationlib.py
65 antigravity.py
66 argparse.py
67 ast.py
68-asynchat.py
69 asyncio/__init__.py
70 asyncio/__main__.py
71 asyncio/base_events.py
72@@ -33,6 +72,7 @@ asyncio/events.py
73 asyncio/exceptions.py
74 asyncio/format_helpers.py
75 asyncio/futures.py
76+asyncio/graph.py
77 asyncio/locks.py
78 asyncio/log.py
79 asyncio/mixins.py
80@@ -45,47 +85,57 @@ asyncio/sslproto.py
81 asyncio/staggered.py
82 asyncio/streams.py
83 asyncio/subprocess.py
84+asyncio/taskgroups.py
85 asyncio/tasks.py
86 asyncio/threads.py
87+asyncio/timeouts.py
88+asyncio/tools.py
89 asyncio/transports.py
90 asyncio/trsock.py
91 asyncio/unix_events.py
92 asyncio/windows_events.py
93 asyncio/windows_utils.py
94-asyncore.py
95 base64.py
96 bdb.py
97-binhex.py
98 bisect.py
99 bz2.py
100 cProfile.py
101 calendar.py
102-cgi.py
103-cgitb.py
104-chunk.py
105 cmd.py
106 code.py
107 codecs.py
108 codeop.py
109 collections/__init__.py
110-collections/abc.py
111 colorsys.py
112 compileall.py
113+compression/__init__.py
114+compression/_common/__init__.py
115+compression/_common/_streams.py
116+compression/bz2.py
117+compression/gzip.py
118+compression/lzma.py
119+compression/zlib.py
120+compression/zstd/__init__.py
121+compression/zstd/_zstdfile.py
122 concurrent/__init__.py
123 concurrent/futures/__init__.py
124 concurrent/futures/_base.py
125+concurrent/futures/interpreter.py
126 concurrent/futures/process.py
127 concurrent/futures/thread.py
128+concurrent/interpreters/__init__.py
129+concurrent/interpreters/_crossinterp.py
130+concurrent/interpreters/_queues.py
131 configparser.py
132 contextlib.py
133 contextvars.py
134 copy.py
135 copyreg.py
136-crypt.py
137 csv.py
138 ctypes/__init__.py
139 ctypes/_aix.py
140 ctypes/_endian.py
141+ctypes/_layout.py
142 ctypes/macholib/__init__.py
143 ctypes/macholib/dyld.py
144 ctypes/macholib/dylib.py
145@@ -103,59 +153,10 @@ dbm/__init__.py
146 dbm/dumb.py
147 dbm/gnu.py
148 dbm/ndbm.py
149+dbm/sqlite3.py
150 decimal.py
151 difflib.py
152 dis.py
153-distutils/__init__.py
154-distutils/_msvccompiler.py
155-distutils/archive_util.py
156-distutils/bcppcompiler.py
157-distutils/ccompiler.py
158-distutils/cmd.py
159-distutils/command/__init__.py
160-distutils/command/bdist.py
161-distutils/command/bdist_dumb.py
162-distutils/command/bdist_msi.py
163-distutils/command/bdist_rpm.py
164-distutils/command/build.py
165-distutils/command/build_clib.py
166-distutils/command/build_ext.py
167-distutils/command/build_py.py
168-distutils/command/build_scripts.py
169-distutils/command/check.py
170-distutils/command/clean.py
171-distutils/command/config.py
172-distutils/command/install.py
173-distutils/command/install_data.py
174-distutils/command/install_egg_info.py
175-distutils/command/install_headers.py
176-distutils/command/install_lib.py
177-distutils/command/install_scripts.py
178-distutils/command/register.py
179-distutils/command/sdist.py
180-distutils/command/upload.py
181-distutils/config.py
182-distutils/core.py
183-distutils/cygwinccompiler.py
184-distutils/debug.py
185-distutils/dep_util.py
186-distutils/dir_util.py
187-distutils/dist.py
188-distutils/errors.py
189-distutils/extension.py
190-distutils/fancy_getopt.py
191-distutils/file_util.py
192-distutils/filelist.py
193-distutils/log.py
194-distutils/msvc9compiler.py
195-distutils/msvccompiler.py
196-distutils/spawn.py
197-distutils/sysconfig.py
198-distutils/text_file.py
199-distutils/unixccompiler.py
200-distutils/util.py
201-distutils/version.py
202-distutils/versionpredicate.py
203 doctest.py
204 email/__init__.py
205 email/_encoded_words.py
206@@ -187,6 +188,7 @@ email/policy.py
207 email/quoprimime.py
208 email/utils.py
209 encodings/__init__.py
210+encodings/_win_cp_codecs.py
211 encodings/aliases.py
212 encodings/ascii.py
213 encodings/base64_codec.py
214@@ -310,7 +312,6 @@ encodings/uu_codec.py
215 encodings/zlib_codec.py
216 ensurepip/__init__.py
217 ensurepip/__main__.py
218-ensurepip/_bundled/__init__.py
219 ensurepip/_uninstall.py
220 enum.py
221 filecmp.py
222@@ -393,114 +394,48 @@ idlelib/textview.py
223 idlelib/tooltip.py
224 idlelib/tree.py
225 idlelib/undo.py
226+idlelib/util.py
227 idlelib/window.py
228 idlelib/zoomheight.py
229 idlelib/zzdummy.py
230 imaplib.py
231-imghdr.py
232-imp.py
233 importlib/__init__.py
234 importlib/_abc.py
235-importlib/_adapters.py
236 importlib/_bootstrap.py
237 importlib/_bootstrap_external.py
238-importlib/_common.py
239 importlib/abc.py
240 importlib/machinery.py
241 importlib/metadata/__init__.py
242 importlib/metadata/_adapters.py
243 importlib/metadata/_collections.py
244+importlib/metadata/_context.py
245 importlib/metadata/_functools.py
246 importlib/metadata/_itertools.py
247 importlib/metadata/_meta.py
248 importlib/metadata/_text.py
249+importlib/metadata/_typing.py
250+importlib/metadata/diagnose.py
251 importlib/readers.py
252-importlib/resources.py
253+importlib/resources/__init__.py
254+importlib/resources/_adapters.py
255+importlib/resources/_common.py
256+importlib/resources/_functional.py
257+importlib/resources/_itertools.py
258+importlib/resources/abc.py
259+importlib/resources/readers.py
260+importlib/resources/simple.py
261+importlib/simple.py
262 importlib/util.py
263 inspect.py
264 io.py
265 ipaddress.py
266 json/__init__.py
267+json/__main__.py
268 json/decoder.py
269 json/encoder.py
270 json/scanner.py
271 json/tool.py
272 keyword.py
273-lib2to3/Grammar.txt
274-lib2to3/PatternGrammar.txt
275-lib2to3/__init__.py
276-lib2to3/__main__.py
277-lib2to3/btm_matcher.py
278-lib2to3/btm_utils.py
279-lib2to3/fixer_base.py
280-lib2to3/fixer_util.py
281-lib2to3/fixes/__init__.py
282-lib2to3/fixes/fix_apply.py
283-lib2to3/fixes/fix_asserts.py
284-lib2to3/fixes/fix_basestring.py
285-lib2to3/fixes/fix_buffer.py
286-lib2to3/fixes/fix_dict.py
287-lib2to3/fixes/fix_except.py
288-lib2to3/fixes/fix_exec.py
289-lib2to3/fixes/fix_execfile.py
290-lib2to3/fixes/fix_exitfunc.py
291-lib2to3/fixes/fix_filter.py
292-lib2to3/fixes/fix_funcattrs.py
293-lib2to3/fixes/fix_future.py
294-lib2to3/fixes/fix_getcwdu.py
295-lib2to3/fixes/fix_has_key.py
296-lib2to3/fixes/fix_idioms.py
297-lib2to3/fixes/fix_import.py
298-lib2to3/fixes/fix_imports.py
299-lib2to3/fixes/fix_imports2.py
300-lib2to3/fixes/fix_input.py
301-lib2to3/fixes/fix_intern.py
302-lib2to3/fixes/fix_isinstance.py
303-lib2to3/fixes/fix_itertools.py
304-lib2to3/fixes/fix_itertools_imports.py
305-lib2to3/fixes/fix_long.py
306-lib2to3/fixes/fix_map.py
307-lib2to3/fixes/fix_metaclass.py
308-lib2to3/fixes/fix_methodattrs.py
309-lib2to3/fixes/fix_ne.py
310-lib2to3/fixes/fix_next.py
311-lib2to3/fixes/fix_nonzero.py
312-lib2to3/fixes/fix_numliterals.py
313-lib2to3/fixes/fix_operator.py
314-lib2to3/fixes/fix_paren.py
315-lib2to3/fixes/fix_print.py
316-lib2to3/fixes/fix_raise.py
317-lib2to3/fixes/fix_raw_input.py
318-lib2to3/fixes/fix_reduce.py
319-lib2to3/fixes/fix_reload.py
320-lib2to3/fixes/fix_renames.py
321-lib2to3/fixes/fix_repr.py
322-lib2to3/fixes/fix_set_literal.py
323-lib2to3/fixes/fix_standarderror.py
324-lib2to3/fixes/fix_sys_exc.py
325-lib2to3/fixes/fix_throw.py
326-lib2to3/fixes/fix_tuple_params.py
327-lib2to3/fixes/fix_types.py
328-lib2to3/fixes/fix_unicode.py
329-lib2to3/fixes/fix_urllib.py
330-lib2to3/fixes/fix_ws_comma.py
331-lib2to3/fixes/fix_xrange.py
332-lib2to3/fixes/fix_xreadlines.py
333-lib2to3/fixes/fix_zip.py
334-lib2to3/main.py
335-lib2to3/patcomp.py
336-lib2to3/pgen2/__init__.py
337-lib2to3/pgen2/conv.py
338-lib2to3/pgen2/driver.py
339-lib2to3/pgen2/grammar.py
340-lib2to3/pgen2/literals.py
341-lib2to3/pgen2/parse.py
342-lib2to3/pgen2/pgen.py
343-lib2to3/pgen2/token.py
344-lib2to3/pgen2/tokenize.py
345-lib2to3/pygram.py
346-lib2to3/pytree.py
347-lib2to3/refactor.py
348 linecache.py
349 locale.py
350 logging/__init__.py
351@@ -508,13 +443,8 @@ logging/config.py
352 logging/handlers.py
353 lzma.py
354 mailbox.py
355-mailcap.py
356 mimetypes.py
357 modulefinder.py
358-msilib/__init__.py
359-msilib/schema.py
360-msilib/sequence.py
361-msilib/text.py
362 multiprocessing/__init__.py
363 multiprocessing/connection.py
364 multiprocessing/context.py
365@@ -539,7 +469,6 @@ multiprocessing/spawn.py
366 multiprocessing/synchronize.py
367 multiprocessing/util.py
368 netrc.py
369-nntplib.py
370 ntpath.py
371 nturl2path.py
372 numbers.py
373@@ -547,11 +476,13 @@ opcode.py
374 operator.py
375 optparse.py
376 os.py
377-pathlib.py
378+pathlib/__init__.py
379+pathlib/_local.py
380+pathlib/_os.py
381+pathlib/types.py
382 pdb.py
383 pickle.py
384 pickletools.py
385-pipes.py
386 pkgutil.py
387 platform.py
388 plistlib.py
389@@ -559,17 +490,54 @@ poplib.py
390 posixpath.py
391 pprint.py
392 profile.py
393+profiling/__init__.py
394+profiling/sampling/__init__.py
395+profiling/sampling/__main__.py
396+profiling/sampling/_child_monitor.py
397+profiling/sampling/_css_utils.py
398+profiling/sampling/_format_utils.py
399+profiling/sampling/_sync_coordinator.py
400+profiling/sampling/binary_collector.py
401+profiling/sampling/binary_reader.py
402+profiling/sampling/cli.py
403+profiling/sampling/collector.py
404+profiling/sampling/constants.py
405+profiling/sampling/dump.py
406+profiling/sampling/errors.py
407+profiling/sampling/gecko_collector.py
408+profiling/sampling/heatmap_collector.py
409+profiling/sampling/jsonl_collector.py
410+profiling/sampling/live_collector/__init__.py
411+profiling/sampling/live_collector/collector.py
412+profiling/sampling/live_collector/constants.py
413+profiling/sampling/live_collector/display.py
414+profiling/sampling/live_collector/trend_tracker.py
415+profiling/sampling/live_collector/widgets.py
416+profiling/sampling/module_utils.py
417+profiling/sampling/opcode_utils.py
418+profiling/sampling/pstats_collector.py
419+profiling/sampling/sample.py
420+profiling/sampling/stack_collector.py
421+profiling/sampling/string_table.py
422+profiling/tracing/__init__.py
423+profiling/tracing/__main__.py
424+profiling/tracing/_utils.py
425 pstats.py
426 pty.py
427 py_compile.py
428 pyclbr.py
429 pydoc.py
430 pydoc_data/__init__.py
431+pydoc_data/module_docs.py
432 pydoc_data/topics.py
433 queue.py
434 quopri.py
435 random.py
436-re.py
437+re/__init__.py
438+re/_casefix.py
439+re/_compiler.py
440+re/_constants.py
441+re/_parser.py
442 reprlib.py
443 rlcompleter.py
444 runpy.py
445@@ -581,30 +549,27 @@ shlex.py
446 shutil.py
447 signal.py
448 site.py
449-smtpd.py
450 smtplib.py
451-sndhdr.py
452 socket.py
453 socketserver.py
454 sqlite3/__init__.py
455+sqlite3/__main__.py
456+sqlite3/_completer.py
457 sqlite3/dbapi2.py
458 sqlite3/dump.py
459-sre_compile.py
460-sre_constants.py
461-sre_parse.py
462 ssl.py
463 stat.py
464 statistics.py
465-string.py
466+string/__init__.py
467+string/templatelib.py
468 stringprep.py
469 struct.py
470 subprocess.py
471-sunau.py
472 symtable.py
473-sysconfig.py
474+sysconfig/__init__.py
475+sysconfig/__main__.py
476 tabnanny.py
477 tarfile.py
478-telnetlib.py
479 tempfile.py
480 textwrap.py
481 this.py
482@@ -622,10 +587,13 @@ tkinter/font.py
483 tkinter/messagebox.py
484 tkinter/scrolledtext.py
485 tkinter/simpledialog.py
486-tkinter/tix.py
487 tkinter/ttk.py
488 token.py
489 tokenize.py
490+tomllib/__init__.py
491+tomllib/_parser.py
492+tomllib/_re.py
493+tomllib/_types.py
494 trace.py
495 traceback.py
496 tracemalloc.py
497@@ -673,7 +641,6 @@ urllib/parse.py
498 urllib/request.py
499 urllib/response.py
500 urllib/robotparser.py
501-uu.py
502 uuid.py
503 venv/__init__.py
504 venv/__main__.py
505@@ -685,9 +652,9 @@ wsgiref/__init__.py
506 wsgiref/handlers.py
507 wsgiref/headers.py
508 wsgiref/simple_server.py
509+wsgiref/types.py
510 wsgiref/util.py
511 wsgiref/validate.py
512-xdrlib.py
513 xml/__init__.py
514 xml/dom/NodeFilter.py
515 xml/dom/__init__.py
516@@ -710,11 +677,16 @@ xml/sax/expatreader.py
517 xml/sax/handler.py
518 xml/sax/saxutils.py
519 xml/sax/xmlreader.py
520+xml/utils.py
521 xmlrpc/__init__.py
522 xmlrpc/client.py
523 xmlrpc/server.py
524 zipapp.py
525-zipfile.py
526+zipfile/__init__.py
527+zipfile/__main__.py
528+zipfile/_path/__init__.py
529+zipfile/_path/_functools.py
530+zipfile/_path/glob.py
531 zipimport.py
532 zoneinfo/__init__.py
533 zoneinfo/_common.py
+2,
-1
1@@ -1 +1,2 @@
2-5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002 Python-3.10.0.tar.xz
3+673ae7232d84c894729882c8257d300ef2d26523911bfd3917ec8ce7f526f99b Python-3.15.1.tar.xz
4+41c3804b41b9b3bedf3c8078d70a4a5ccccd3dc5d441d6fe0b1aa50050e67170 Python-frozen_modules-3.15.1.tar.gz
+5,
-1
1@@ -1 +1,5 @@
2-url = "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz"
3+remote-name
4+url = "https://www.python.org/ftp/python/3.15.1/Python-3.15.1.tar.xz"
5+
6+remote-name
7+url = "https://github.com/oasislinux/cpython/releases/download/v3.15.1/Python-frozen_modules-3.15.1.tar.gz"
+1,
-1
1@@ -1 +1 @@
2-3.10.0 r1
3+3.15.1 r0
+1,
-1
1@@ -1,6 +1,6 @@
2 file('bin/yt-dlp', '755', '$dir/yt-dlp')
3 for f in iterlines('pylibs.txt') do
4- file('lib/python3.10/'..f, '644', '$srcdir/'..f)
5+ file('lib/python3.15/'..f, '644', '$srcdir/'..f)
6 end
7 man{'yt-dlp.1'}
8