%global pypi_name pycryptodomex Summary: A self-contained cryptographic library for Python Name: python-%{pypi_name} Version: 3.20.0 Release: 3 # PyCrypto-based code is public domain, further PyCryptodome contributions are # BSD License: BSD and Public Domain Group: Development/Python URL: https://www.pycryptodome.org Source0: https://github.com/Legrandin/pycryptodome/archive/v%{version}/%{pypi_name}-%{version}.tar.gz Source1000: %{name}.rpmlintrc # Use external libtomcrypt library #Patch0: %{name}-3.15.0-use_external_libtomcrypt.patch # Fix documentation build with Sphinx <= 1.2, especially on EL #Patch1: %{name}-3.7.0-sphinx.patch #BuildRequires: pyproject-rpm-macros BuildRequires: python3egg(pytest) BuildRequires: python3egg(setuptools) BuildRequires: pkgconfig(libtomcrypt) BuildRequires: pkgconfig(libtommath) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(python) BuildRequires: pythonegg(setuptools) BuildRequires: pythonegg(pytest) BuildRequires: python38-devel BuildRequires: python38-setuptools #BuildRequires: python38-pytest Requires: %{_lib}gmp10 Provides: python-%{pypi_name}x = %{EVRD} %description PyCryptodome is a self-contained Python package of low-level cryptographic primitives. It's a fork of PyCrypto. It brings several enhancements with respect to the last official version of PyCrypto (2.6.1). #------------------------------------------------ %package -n python3-%{pypi_name} Summary: %{summary} Group: Development/Python Requires: %{_lib}gmp10 Provides: python3-%{pypi_name} = %{EVRD} %description -n python3-%{pypi_name} PyCryptodome is a self-contained Python package of low-level cryptographic primitives. It's a fork of PyCrypto. It brings several enhancements with respect to the last official version of PyCrypto (2.6.1), for instance: * Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB) * Accelerated AES on Intel platforms via AES-NI * Elliptic curves cryptography (NIST P-256 curve only) * Better and more compact API (nonce and iv attributes for ciphers, automatic generation of random nonces and IVs, simplified CTR cipher mode, and more) * SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms * Salsa20 and ChaCha20 stream ciphers * scrypt and HKDF * Deterministic (EC)DSA * Password-protected PKCS#8 key containers * Shamir's Secret Sharing scheme * Random numbers get sourced directly from the OS (and not from a CSPRNG in userspace) * Cleaner RSA and DSA key generation (largely based on FIPS 186-4) * Major clean ups and simplification of the code base PyCryptodome is not a wrapper to a separate C library like OpenSSL. To the largest possible extent, algorithms are implemented in pure Python. Only the pieces that are extremely critical to performance (e.g. block ciphers) are implemented as C extensions. Note: all modules are installed under the Cryptodome package to avoid conflicts with the PyCrypto library. %files -n python3-%{pypi_name} %doc README.rst LICENSE.rst %exclude %{python3_sitearch}/Crypto/SelfTest %{python3_sitearch}/Crypto %{python3_sitearch}/pycryptodome-%{version}-py%{py3_ver}.egg-info #------------------------------------------------ %package -n python3-%{pypi_name}-selftest Summary: PyCryptodome test suite module Group: Development/Python Requires: python3-%{pypi_name} == %{EVRD} %description -n python3-%{pypi_name}-selftest This package provides the PyCryptodome test suite module (Cryptodome.SelfTest). %files -n python3-%{pypi_name}-selftest %{python3_sitearch}/Crypto/SelfTest #------------------------------------------------ %package -n python38-%{pypi_name} Summary: %{summary} Group: Development/Python Requires: %{_lib}gmp10 Provides: python38-%{pypi_name} = %{EVRD} %description -n python38-%{pypi_name} PyCryptodome is a self-contained Python package of low-level cryptographic primitives. It's a fork of PyCrypto. It brings several enhancements with respect to the last official version of PyCrypto (2.6.1), for instance: * Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB) * Accelerated AES on Intel platforms via AES-NI * Elliptic curves cryptography (NIST P-256 curve only) * Better and more compact API (nonce and iv attributes for ciphers, automatic generation of random nonces and IVs, simplified CTR cipher mode, and more) * SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms * Salsa20 and ChaCha20 stream ciphers * scrypt and HKDF * Deterministic (EC)DSA * Password-protected PKCS#8 key containers * Shamir's Secret Sharing scheme * Random numbers get sourced directly from the OS (and not from a CSPRNG in userspace) * Cleaner RSA and DSA key generation (largely based on FIPS 186-4) * Major clean ups and simplification of the code base PyCryptodome is not a wrapper to a separate C library like OpenSSL. To the largest possible extent, algorithms are implemented in pure Python. Only the pieces that are extremely critical to performance (e.g. block ciphers) are implemented as C extensions. Note: all modules are installed under the Cryptodome package to avoid conflicts with the PyCrypto library. %files -n python38-%{pypi_name} %doc README.rst LICENSE.rst %exclude %{python38_sitearch}/Crypto/SelfTest %{python38_sitearch}/Crypto %{python38_sitearch}/pycryptodome-%{version}-py%{py38_ver}.egg-info #------------------------------------------------ %package -n python38-%{pypi_name}-selftest Summary: PyCryptodome test suite module Group: Development/Python Requires: python38-%{pypi_name} == %{EVRD} %description -n python38-%{pypi_name}-selftest This package provides the PyCryptodome test suite module (Cryptodome.SelfTest). %files -n python38-%{pypi_name}-selftest %{python38_sitearch}/Crypto/SelfTest #------------------------------------------------ %package -n python-%{pypi_name}-selftest Summary: PyCryptodome test suite module Group: Development/Python Requires: python-%{pypi_name} == %{EVRD} %description -n python-%{pypi_name}-selftest This package provides the PyCryptodome test suite module (Cryptodome.SelfTest). %files -n python-%{pypi_name}-selftest %{python_sitearch}/Cryptodome/SelfTest #------------------------------------------------ %prep %setup -qn pycryptodome-%{version} cp -a . %{py3dir} cp -a . %{py38dir} # Drop bundled libraries #rm -r src/libtom/ # Remove shebang #sed '1{\@^#! /usr/bin/env python@d}' lib/Cryptodome/SelfTest/__main__.py >lib/Cryptodome/SelfTest/__main__.py.new && \ #touch -r lib/Cryptodome/SelfTest/__main__.py lib/Cryptodome/SelfTest/__main__.py.new && \ #mv lib/Cryptodome/SelfTest/__main__.py.new lib/Cryptodome/SelfTest/__main__.py #generate_buildrequires #pyproject_buildrequires -r %build touch .separate_namespace %py_build pushd %{py3dir} %py3_build popd pushd %{py38dir} %py38_build popd %install %py_install pushd %{py3dir} %py3_install popd pushd %{py38dir} %py38_install popd %files %doc README.rst LICENSE.rst %exclude %{python_sitearch}/Cryptodome/SelfTest %{python_sitearch}/Cryptodome %{python_sitearch}/pycryptodomex-%{version}-py%{py_ver}.egg-info