Skip to content

Commit f70c112

Browse files
authored
Merge branch 'Legrandin:master' into resolve_redundantAssignment
2 parents b8d4415 + 2c3a890 commit f70c112

File tree

12 files changed

+72
-22
lines changed

12 files changed

+72
-22
lines changed

.github/workflows/integration.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
- python-version: "3.13"
2121
cffi: yes
2222
os: windows-latest
23+
- python-version: "3.13"
24+
cffi: no
25+
os: windows-11-arm
26+
- python-version: "3.13"
27+
cffi: yes
28+
os: windows-11-arm
2329
- python-version: pypy2.7
2430
cffi: no
2531
os: ubuntu-latest
@@ -123,6 +129,7 @@ jobs:
123129
else
124130
python -m Crypto.SelfTest
125131
fi
132+
126133
mypy:
127134
runs-on: ubuntu-latest
128135
steps:
@@ -160,12 +167,16 @@ jobs:
160167
make -C build all test
161168
162169
test_c_windows:
163-
runs-on: windows-latest
170+
runs-on: ${{ matrix.os }}
164171
strategy:
165172
matrix:
166-
arch:
167-
- x64
168-
- win32
173+
include:
174+
- os: windows-latest
175+
arch: x64
176+
- os: windows-latest
177+
arch: win32
178+
- os: windows-11-arm
179+
arch: arm64
169180
steps:
170181
- uses: actions/checkout@v4
171182
- name: Set up Python "3.13"

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
os: [ubuntu-22.04, windows-2019, macos-13, ubuntu-22.04-arm]
35+
os: [ubuntu-22.04, windows-2019, macos-13, ubuntu-22.04-arm, windows-11-arm]
3636

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

@@ -49,7 +49,7 @@ jobs:
4949
env:
5050
# cibuildwheel will build wheel once and test it for each CPython version
5151
# and for PyPy > 3.8.
52-
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
52+
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp313t-* pp39-* pp310-*"
5353
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
5454
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
5555
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"

Changelog.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
Changelog
22
=========
33

4-
Under development
4+
3.24.0 (under development)
5+
++++++++++++++++++++++++++
6+
7+
Resolved issues
8+
---------------
9+
* GH#875: Fixed the Object Identifiers (OID) for BLAKE2.
10+
11+
3.23.0 (17 May 2025)
512
++++++++++++++++++++++++++
613

714
New features
815
---------------
916
* Added cipher modes Key Wrap (KW, RFC3394) and Key Wrap with Padding (KWP, RFC5649).
1017
Both are defined also in NIST SP 800-38F.
18+
* Wheels for Windows ARM.
1119

1220
Resolved issues
1321
---------------

Doc/src/faq.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Frequently Asked Questions
22
--------------------------
33

4+
When will support for Python 2.7 stop?
5+
++++++++++++++++++++++++++++++++++++++++
6+
7+
There are no plans to drop support for Python 2.7.
8+
This may change when maintenance becomes too cumbersome.
9+
10+
However, new features will only be tested for Python 3.
11+
12+
How can I encrypt using an ECC key?
13+
++++++++++++++++++++++++++++++++++++
14+
15+
Use Hybrid Public Key Encryption (HPKE, RFC 9180)
16+
and the module :ref:`Crypto.Protocol.HPKE<hpke>`.
17+
418
Is CTR cipher mode compatible with Java?
519
++++++++++++++++++++++++++++++++++++++++++++++++++
620

Doc/src/protocol/hpke.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _hpke:
2+
13
Hybrid Public Key Encryption (HPKE)
24
=====================================
35

lib/Crypto/Hash/BLAKE2b.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, data, key, digest_bytes, update_after_digest):
8383

8484
# See https://tools.ietf.org/html/rfc7693
8585
if digest_bytes in (20, 32, 48, 64) and not key:
86-
self.oid = "1.3.6.1.4.1.1722.12.2.1." + str(digest_bytes)
86+
self.oid = "1.3.6.1.4.1.1722.12.2.1." + str(digest_bytes // 4)
8787

8888
state = VoidPointer()
8989
result = _raw_blake2b_lib.blake2b_init(state.address_of(),

lib/Crypto/Hash/BLAKE2s.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, data, key, digest_bytes, update_after_digest):
8383

8484
# See https://tools.ietf.org/html/rfc7693
8585
if digest_bytes in (16, 20, 28, 32) and not key:
86-
self.oid = "1.3.6.1.4.1.1722.12.2.2." + str(digest_bytes)
86+
self.oid = "1.3.6.1.4.1.1722.12.2.2." + str(digest_bytes // 4)
8787

8888
state = VoidPointer()
8989
result = _raw_blake2s_lib.blake2s_init(state.address_of(),

lib/Crypto/Math/_IntegerNative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def get_bit(self, n):
263263
raise ValueError("negative bit count")
264264
except OverflowError:
265265
result = 0
266-
return result
266+
return bool(result)
267267

268268
# Extra
269269
def is_odd(self):

lib/Crypto/Protocol/HPKE.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,6 @@ def new(*, receiver_key: EccKey,
446446
In the latter case,
447447
correctness of all the keys and parameters will only
448448
be assessed with the first call to ``unseal()``.
449-
450-
.. _HPKE: https://datatracker.ietf.org/doc/rfc9180/
451449
"""
452450

453451
if aead_id not in AEAD:

lib/Crypto/SelfTest/Hash/test_BLAKE2.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,18 @@ def test_oid(self):
158158

159159
prefix = "1.3.6.1.4.1.1722.12.2." + self.oid_variant + "."
160160

161+
suffix = {
162+
128: "4",
163+
160: "5",
164+
224: "7",
165+
256: "8",
166+
384: "12",
167+
512: "16"
168+
}
169+
161170
for digest_bits in self.digest_bits_oid:
162171
h = self.BLAKE2.new(digest_bits=digest_bits)
163-
self.assertEqual(h.oid, prefix + str(digest_bits // 8))
172+
self.assertEqual(h.oid, prefix + suffix[digest_bits])
164173

165174
h = self.BLAKE2.new(digest_bits=digest_bits, key=b"secret")
166175
self.assertRaises(AttributeError, lambda: h.oid)
@@ -477,6 +486,7 @@ def get_tests(config={}):
477486

478487
if __name__ == '__main__':
479488
import unittest
489+
480490
def suite():
481491
return unittest.TestSuite(get_tests())
482492
unittest.main(defaultTest='suite')

0 commit comments

Comments
 (0)