Skip to content

Commit 16349d3

Browse files
committed
refactor: 💡 replace pycrypto with pycryptodome
1 parent 528cb11 commit 16349d3

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"setuptools>=42",
3+
"setuptools >= 42, < 58",
44
"wheel"
55
]
66
build-backend = "setuptools.build_meta"

requirement.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
click==8.0.3
22
Cython==0.29.24
3-
pycrypto==2.6.1
3+
pycryptodome==3.14.1
44
pyminifier==2.1

setup.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers =
1818
Programming Language :: Python :: 3.7
1919
Programming Language :: Python :: 3.8
2020
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: 3.10
2122
Programming Language :: Python :: Implementation :: CPython
2223
Environment :: Console
2324
license_files = LICENSE
@@ -28,9 +29,9 @@ keywords = python-encrypt, import-hook
2829

2930
[options]
3031
install_requires =
31-
Cython
32-
pycrypto
33-
pyminifier
32+
Cython >= 0.29.24
33+
pycryptodome >= 3.14.1
34+
pyminifier >= 2.1
3435
click
3536
python_requires = >=3.6
3637
packages = find:

tests/test_generate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_generate_aes_key(size):
1212
assert isinstance(generate_aes_key(size), bytes)
1313

1414

15-
@pytest.mark.parametrize('bits', [1024, 2048, 4096])
15+
@pytest.mark.parametrize('bits', [1024, 1025, 2045, 2048, 4096])
1616
def test_generate_rsa_number(bits):
1717
numbers = generate_rsa_number(bits)
1818
assert len(numbers) == 5
@@ -24,8 +24,8 @@ def test_generate_rsa_number(bits):
2424
assert pow(pow(plain, e, n), d, n) == plain
2525

2626

27-
@pytest.mark.parametrize('bits', [123, 456, 789])
27+
@pytest.mark.parametrize('bits', [-1, 123])
2828
def test_generate_rsa_number_exception(bits):
2929
with pytest.raises(ValueError) as excinfo:
3030
generate_rsa_number(bits)
31-
assert str(excinfo.value) == "RSA modulus length must be a multiple of 256 and >= 1024"
31+
assert str(excinfo.value) == "RSA modulus length must be >= 1024"

0 commit comments

Comments
 (0)