Skip to content

Commit b8d4415

Browse files
authored
Merge branch 'Legrandin:master' into resolve_redundantAssignment
2 parents 1c46bce + 64506f7 commit b8d4415

File tree

95 files changed

+6713
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+6713
-499
lines changed

.github/workflows/integration.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13-dev" ]
10+
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13" ]
1111
cffi: [ yes, no ]
12-
os: [ ubuntu-20.04 ]
12+
os: [ ubuntu-22.04 ]
1313
include:
14-
- python-version: "3.12"
14+
- python-version: "3.13"
1515
cffi: yes
16-
os: macos-12
17-
- python-version: "3.12"
16+
os: macos-13
17+
- python-version: "3.13"
1818
cffi: no
1919
os: windows-latest
20-
- python-version: "3.12"
20+
- python-version: "3.13"
2121
cffi: yes
2222
os: windows-latest
2323
- python-version: pypy2.7
@@ -26,14 +26,17 @@ jobs:
2626
- python-version: pypy3.9
2727
cffi: no
2828
os: ubuntu-latest
29+
- python-version: "3.13"
30+
cffi: yes
31+
os: ubuntu-22.04-arm
2932
env:
3033
CFLAGS: "-Wconversion"
3134

3235
steps:
33-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3437

3538
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@v5
3740
with:
3841
python-version: ${{ matrix.python-version }}
3942

@@ -66,18 +69,18 @@ jobs:
6669
runs-on: ${{ matrix.os }}
6770
strategy:
6871
matrix:
69-
os: [ ubuntu-20.04, windows-latest]
72+
os: [ ubuntu-22.04, windows-latest]
7073
cffi: [ yes, no ]
7174
include:
72-
- os: ubuntu-20.04
75+
- os: ubuntu-22.04
7376
container: python:2.7.18-buster
7477
container:
7578
image: ${{ matrix.container }}
7679
env:
7780
CFLAGS: "-Wconversion"
7881

7982
steps:
80-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
8184

8285
- name: Install Python 2
8386
if: matrix.os == 'windows-latest'
@@ -123,9 +126,9 @@ jobs:
123126
mypy:
124127
runs-on: ubuntu-latest
125128
steps:
126-
- uses: actions/checkout@v3
129+
- uses: actions/checkout@v4
127130
- name: Set up Python
128-
uses: actions/setup-python@v4
131+
uses: actions/setup-python@v5
129132
with:
130133
python-version: "3.x"
131134
- name: Install dependencies
@@ -142,7 +145,7 @@ jobs:
142145
sse: [0, 1]
143146
arch: [x64, x32]
144147
steps:
145-
- uses: actions/checkout@v3
148+
- uses: actions/checkout@v4
146149
- name: Install dependencies
147150
run: |
148151
sudo apt-get update
@@ -164,11 +167,11 @@ jobs:
164167
- x64
165168
- win32
166169
steps:
167-
- uses: actions/checkout@v3
168-
- name: Set up Python "3.12"
169-
uses: actions/setup-python@v4
170+
- uses: actions/checkout@v4
171+
- name: Set up Python "3.13"
172+
uses: actions/setup-python@v5
170173
with:
171-
python-version: "3.12"
174+
python-version: "3.13"
172175
- name: Install MSVC
173176
uses: ilammy/msvc-dev-cmd@v1
174177
with:
@@ -186,11 +189,11 @@ jobs:
186189
env:
187190
CFLAGS: "-Wconversion"
188191
steps:
189-
- uses: actions/checkout@v2
192+
- uses: actions/checkout@v4
190193
- name: No-GIL Python
191194
uses: deadsnakes/action@v3.1.0
192195
with:
193-
python-version: "3.13-dev"
196+
python-version: "3.13"
194197
nogil: true
195198

196199
- name: Install dependencies (testing only)

.github/workflows/wheels.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
name: Build source package
1111
runs-on: [ ubuntu-latest ]
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

15-
- uses: actions/setup-python@v4
15+
- uses: actions/setup-python@v5
1616
name: Install Python
1717
with:
1818
python-version: '3.x'
@@ -22,39 +22,41 @@ jobs:
2222
python -m pip install setuptools
2323
python setup.py sdist
2424
25-
- uses: actions/upload-artifact@v3
25+
- uses: actions/upload-artifact@v4
2626
with:
27-
name: source
27+
name: source-${{ github.ref_name }}
2828
path: ./dist/*.tar.gz
2929

3030
build_python3_wheels:
3131
name: Build Python 3 wheels on ${{ matrix.os }}
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
os: [ubuntu-20.04, windows-2019, macos-12]
35+
os: [ubuntu-22.04, windows-2019, macos-13, ubuntu-22.04-arm]
3636

3737
if: github.actor == 'Legrandin'
3838

3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141

4242
- name: Select architecture for MacOS
4343
run: |
4444
echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV
4545
if: runner.os == 'macOS'
4646

47-
- uses: pypa/cibuildwheel@v2.21.1
47+
- uses: pypa/cibuildwheel@v2.22.0
4848
name: Build wheels
4949
env:
5050
# cibuildwheel will build wheel once and test it for each CPython version
5151
# and for PyPy > 3.8.
52-
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
52+
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
5353
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
5454
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
55+
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
5556
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014"
5657
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014"
57-
CIBW_FREE_THREADED_SUPPORT: "true"
58+
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: "manylinux2014"
59+
CIBW_ENABLE: "cpython-freethreading pypy"
5860
CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true"
5961

6062
# Set pycryptodome/x test command according to built package
@@ -66,20 +68,20 @@ jobs:
6668
- name: Delete manylinux1 wheels
6769
if: runner.os == 'Linux'
6870
run: |
69-
rm -f wheelhouse/*-manylinux1_i686.whl
70-
rm -f wheelhouse/*-manylinux1_x86_64.whl
71+
rm -f wheelhouse/*-manylinux1_*.whl
7172
72-
- uses: actions/upload-artifact@v3
73+
- uses: actions/upload-artifact@v4
7374
with:
74-
name: wheels
75+
name: wheels-python3-${{ matrix.os }}-${{ github.ref_name }}
76+
overwrite: true
7577
path: ./wheelhouse/*.whl
7678

7779
build_legacy_wheels:
7880
name: Build legacy Python wheels on ${{ matrix.os }} (${{ matrix.arch }})
7981
runs-on: ${{ matrix.os }}
8082
strategy:
8183
matrix:
82-
os: [ ubuntu-20.04, windows-2019, macos-12 ]
84+
os: [ ubuntu-22.04, windows-2019, macos-13 ]
8385
arch: [ multi-arch ]
8486
# Python 2 on Windows requires manual toolchain setup (per-arch) due to newer MSVC used here
8587
exclude:
@@ -94,7 +96,7 @@ jobs:
9496
if: github.actor == 'Legrandin'
9597

9698
steps:
97-
- uses: actions/checkout@v3
99+
- uses: actions/checkout@v4
98100

99101
- name: Install MSVC
100102
if: runner.os == 'Windows'
@@ -136,10 +138,10 @@ jobs:
136138
- name: Delete manylinux1 wheels
137139
if: runner.os == 'Linux'
138140
run: |
139-
rm -f wheelhouse/*-manylinux1_i686.whl
140-
rm -f wheelhouse/*-manylinux1_x86_64.whl
141+
rm -f wheelhouse/*-manylinux1_*.whl
141142
142-
- uses: actions/upload-artifact@v3
143+
- uses: actions/upload-artifact@v4
143144
with:
144-
name: wheels
145+
name: wheels-legacy-${{ matrix.os }}-${{ github.ref_name }}
146+
overwrite: true
145147
path: ./wheelhouse/*.whl

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
python:
33
install:
4-
- requirements: Doc/requirements.txt
4+
- requirements: Doc/requirements-docs.txt
55
build:
66
os: ubuntu-22.04
77
tools:

Changelog.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
Changelog
22
=========
33

4+
Under development
5+
++++++++++++++++++++++++++
6+
7+
New features
8+
---------------
9+
* Added cipher modes Key Wrap (KW, RFC3394) and Key Wrap with Padding (KWP, RFC5649).
10+
Both are defined also in NIST SP 800-38F.
11+
12+
Resolved issues
13+
---------------
14+
* GH#862: For HashEdDSA and Ed448, sign() and verify() modified the state of the XOF.
15+
16+
3.22.0 (16 March 2025)
17+
++++++++++++++++++++++++++
18+
19+
New features
20+
---------------
21+
* Added support for HPKE (RFC 9180).
22+
23+
Resolved issues
24+
---------------
25+
* GH#812: CCM ciphers will now fail before encrypting (or decrypting)
26+
data beyond the limit imposed by the nonce length.
27+
* GH#846: fix infinite loop with RC4 for data larger than 4GB.
28+
* GH#852: handle correctly invalid PEM files with less than 3 lines.
29+
30+
Other changes
31+
-------------
32+
* Remove support for Python 3.6.
33+
434
3.21.0 (30 September 2024)
535
++++++++++++++++++++++++++
636

Doc/Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1414
# the i18n builder cannot share the environment and doctrees with the others
1515
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1616

17-
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
17+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp latex latexpdf text man changes linkcheck doctest gettext
1818

1919
help:
2020
@echo "Please use \`make <target>' where <target> is one of"
@@ -26,7 +26,6 @@ help:
2626
@echo " htmlhelp to make HTML files and a HTML help project"
2727
@echo " qthelp to make HTML files and a qthelp project"
2828
@echo " devhelp to make HTML files and a Devhelp project"
29-
@echo " epub to make an epub"
3029
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
3130
@echo " latexpdf to make LaTeX files and run them through pdflatex"
3231
@echo " text to make text files"
@@ -90,11 +89,6 @@ devhelp:
9089
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PyCryptodome"
9190
@echo "# devhelp"
9291

93-
epub:
94-
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
95-
@echo
96-
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
97-
9892
latex:
9993
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
10094
@echo

Doc/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ def have_aes_ni(self):
5454
# Add any Sphinx extension module names here, as strings. They can be extensions
5555
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
5656
extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon',
57-
'sphinx.ext.mathjax' ]
57+
'sphinx.ext.mathjax', 'sphinx_autodoc_typehints',
58+
'sphinx_rtd_theme' ]
5859

5960
# Add any paths that contain templates here, relative to this directory.
6061
templates_path = ['_templates']
6162

6263
# The suffix of source filenames.
63-
source_suffix = '.rst'
64+
source_suffix = {'.rst': 'restructuredtext'}
6465

6566
# The encoding of source files.
6667
#source_encoding = 'utf-8-sig'
@@ -70,7 +71,7 @@ def have_aes_ni(self):
7071

7172
# General information about the project.
7273
project = 'PyCryptodome'
73-
copyright = '2022, Helder Eijs'
74+
copyright = '2025, Helder Eijs'
7475

7576
# The version info for the project you're documenting, acts as replacement for
7677
# |version| and |release|, also used in various other places throughout the

Doc/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Welcome to PyCryptodome's documentation
33

44
.. toctree::
55
:maxdepth: 3
6-
6+
77
src/introduction
88
src/features
99
src/installation
@@ -12,6 +12,5 @@ Welcome to PyCryptodome's documentation
1212
src/examples
1313
src/faq
1414
src/contribute_support
15-
src/future
1615
src/changelog
1716
src/license

Doc/reqs.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

Doc/requirements-docs.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx==8.2.3
2+
sphinx-autodoc-typehints==3.1.0
3+
sphinx-rtd-theme

Doc/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)