mirror of
https://github.com/openwrt/packages.git
synced 2026-06-13 17:11:32 +08:00
python3-cryptodomex: update to 3.23.0
Update package to 3.23.0. pycryptodomex is the same codebase as pycryptodome under the Cryptodome namespace. All changes are identical to python3-cryptodome 3.23.0: 3.19.0: Added ECDH support via Cryptodome.Protocol.DH; TupleHash128/256 update() can now hash multiple items at once. 3.19.1 (security): Patched side-channel leakage in OAEP decryption that could enable a Manger attack. 3.20.0: Added TurboSHAKE128 and TurboSHAKE256; Cryptodome.Hash.new() factory; AES-GCM support for PBES2/PKCS#8 containers. 3.21.0: Added Curve25519/X25519 and Curve448/X448 support; dropped Python 3.5 support. 3.22.0: Added HPKE (RFC 9180) support; dropped Python 3.6 support. 3.23.0: Added Key Wrap (KW/KWP, RFC 3394/5649) cipher modes; Windows ARM wheels; fixed HashEdDSA/Ed448 sign/verify mutating XOF state. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
066225fb1e
commit
a509f32047
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-pycryptodomex ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
from Cryptodome.Cipher import AES
|
||||
from Cryptodome.Random import get_random_bytes
|
||||
from Cryptodome.Hash import SHA256
|
||||
|
||||
# AES-GCM encrypt/decrypt
|
||||
key = get_random_bytes(16)
|
||||
cipher = AES.new(key, AES.MODE_GCM)
|
||||
ciphertext, tag = cipher.encrypt_and_digest(b"hello, world!")
|
||||
|
||||
cipher2 = AES.new(key, AES.MODE_GCM, nonce=cipher.nonce)
|
||||
plaintext = cipher2.decrypt_and_verify(ciphertext, tag)
|
||||
assert plaintext == b"hello, world!"
|
||||
|
||||
# SHA256
|
||||
h = SHA256.new(b"test data")
|
||||
digest = h.hexdigest()
|
||||
assert len(digest) == 64
|
||||
EOF
|
||||
Reference in New Issue
Block a user