diff options
| author | Richard Yu <yurichard3839@gmail.com> | 2019-03-01 14:12:24 +0800 |
|---|---|---|
| committer | Richard Yu <yurichard3839@gmail.com> | 2019-03-01 14:12:24 +0800 |
| commit | 2c63742f25575964628240865134fefd8699a97e (patch) | |
| tree | fcd6e13b08b74290839287f26c08d3ea558a2d20 /lang/python/python-cryptodomex/patches | |
| parent | f81ef698d59fa4b0b2a5aa338395312231a83bd5 (diff) | |
python-cryptodome: add new package
PyCryptodome is an almost drop-in replacement for the old PyCrypto library.
Signed-off-by: Richard Yu <yurichard3839@gmail.com>
Diffstat (limited to 'lang/python/python-cryptodomex/patches')
| -rw-r--r-- | lang/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch | 11 | ||||
| -rw-r--r-- | lang/python/python-cryptodomex/patches/002-omit-tests.patch | 50 |
2 files changed, 61 insertions, 0 deletions
diff --git a/lang/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch b/lang/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch new file mode 100644 index 000000000..e562df0d5 --- /dev/null +++ b/lang/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch @@ -0,0 +1,11 @@ +--- a/lib/Cryptodome/Math/_IntegerGMP.py ++++ b/lib/Cryptodome/Math/_IntegerGMP.py +@@ -92,7 +92,7 @@ gmp_defs = """typedef unsigned long UNIX_ULONG; + int __gmpz_divisible_ui_p (const mpz_t n, UNIX_ULONG d); + """ + +-lib = load_lib("gmp", gmp_defs) ++lib = load_lib("libgmp.so.10", gmp_defs) + implementation = {"library": "gmp", "api": backend} + + if hasattr(lib, "__mpir_version"): diff --git a/lang/python/python-cryptodomex/patches/002-omit-tests.patch b/lang/python/python-cryptodomex/patches/002-omit-tests.patch new file mode 100644 index 000000000..23e264ae3 --- /dev/null +++ b/lang/python/python-cryptodomex/patches/002-omit-tests.patch @@ -0,0 +1,50 @@ +--- a/setup.py ++++ b/setup.py +@@ -245,16 +245,6 @@ + "Crypto.Signature", + "Crypto.Util", + "Crypto.Math", +- "Crypto.SelfTest", +- "Crypto.SelfTest.Cipher", +- "Crypto.SelfTest.Hash", +- "Crypto.SelfTest.IO", +- "Crypto.SelfTest.Protocol", +- "Crypto.SelfTest.PublicKey", +- "Crypto.SelfTest.Random", +- "Crypto.SelfTest.Signature", +- "Crypto.SelfTest.Util", +- "Crypto.SelfTest.Math", + ] + package_dir = {"Crypto": "lib/Crypto"} + package_data = { +@@ -268,30 +258,6 @@ + "Crypto.Signature" : [ "*.pyi" ], + "Crypto.IO" : [ "*.pyi" ], + "Crypto.Util" : [ "*.pyi" ], +- "Crypto.SelfTest.Cipher" : [ +- "test_vectors/AES/*.*", +- "test_vectors/TDES/*.*", +- "test_vectors/wycheproof/*.*", +- ], +- "Crypto.SelfTest.Hash" : [ +- "test_vectors/SHA1/*.*", +- "test_vectors/SHA2/*.*", +- "test_vectors/SHA3/*.*", +- "test_vectors/keccak/*.*", +- "test_vectors/BLAKE2s/*.*", +- "test_vectors/BLAKE2b/*.*", +- "test_vectors/wycheproof/*.*", +- ], +- "Crypto.SelfTest.Signature" : [ +- "test_vectors/DSA/*.*", +- "test_vectors/ECDSA/*.*", +- "test_vectors/PKCS1-v1.5/*.*", +- "test_vectors/PKCS1-PSS/*.*", +- "test_vectors/wycheproof/*.*", +- ], +- "Crypto.SelfTest.PublicKey" : [ +- "test_vectors/ECC/*.*", +- ], + } + + system_bits = 8 * struct.calcsize("P") |
