|
|
|
@ -1,83 +1,73 @@
|
|
|
|
|
%global srcname pycryptodomex
|
|
|
|
|
%global common_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), 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.
|
|
|
|
|
|
|
|
|
|
%global _with_python2 1
|
|
|
|
|
%global _with_tests 1
|
|
|
|
|
%global _description %{expand: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.}
|
|
|
|
|
|
|
|
|
|
Name: python-%{srcname}
|
|
|
|
|
Version: 3.10.1
|
|
|
|
|
Version: 3.20.0
|
|
|
|
|
Release: 1%{?dist}
|
|
|
|
|
Summary: A self-contained cryptographic library for Python
|
|
|
|
|
|
|
|
|
|
# PyCrypto-based code is public domain, further PyCryptodome contributions are
|
|
|
|
|
# BSD
|
|
|
|
|
License: BSD and Public Domain
|
|
|
|
|
License: BSD-2-Clause AND LicenseRef-Fedora-Public-Domain
|
|
|
|
|
URL: http://www.pycryptodome.org/
|
|
|
|
|
Source0: https://github.com/Legrandin/pycryptodome/archive/v%{version}/%{srcname}-%{version}.tar.gz
|
|
|
|
|
# Use external libtomcrypt library
|
|
|
|
|
Patch0: %{name}-3.10.1-use_external_libtomcrypt.patch
|
|
|
|
|
Patch0: %{name}-3.15.0-use_external_libtomcrypt.patch
|
|
|
|
|
|
|
|
|
|
BuildRequires: gcc
|
|
|
|
|
BuildRequires: libtomcrypt-devel
|
|
|
|
|
%if 0%{?_with_python2}
|
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
|
BuildRequires: python2-setuptools
|
|
|
|
|
%endif
|
|
|
|
|
BuildRequires: make
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
|
# Needed for documentation
|
|
|
|
|
BuildRequires: python3-sphinx
|
|
|
|
|
BuildRequires: %{py3_dist sphinx}
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
%{common_description}
|
|
|
|
|
%{_description}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?_with_python2}
|
|
|
|
|
%package -n python2-%{srcname}
|
|
|
|
|
%package -n python3-%{srcname}
|
|
|
|
|
Summary: %{summary}
|
|
|
|
|
# GMP library is dl-opened
|
|
|
|
|
Requires: gmp%{?_isa}
|
|
|
|
|
%{?python_provide:%python_provide python2-%{srcname}}
|
|
|
|
|
|
|
|
|
|
%description -n python2-%{srcname}
|
|
|
|
|
%{common_description}
|
|
|
|
|
%endif
|
|
|
|
|
%description -n python3-%{srcname}
|
|
|
|
|
%{_description}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package -n python3-%{srcname}
|
|
|
|
|
Summary: %{summary}
|
|
|
|
|
# GMP library is dl-opened
|
|
|
|
|
Requires: gmp%{?_isa}
|
|
|
|
|
%{?python_provide:%python_provide python3-%{srcname}}
|
|
|
|
|
%package -n python3-%{srcname}-selftest
|
|
|
|
|
Summary: PyCryptodome test suite module
|
|
|
|
|
Requires: python3-%{srcname}%{?_isa}
|
|
|
|
|
|
|
|
|
|
%description -n python3-%{srcname}
|
|
|
|
|
%{common_description}
|
|
|
|
|
%description -n python3-%{srcname}-selftest
|
|
|
|
|
%{_description}
|
|
|
|
|
|
|
|
|
|
This package provides the PyCryptodome test suite module (Cryptodome.SelfTest).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
@ -92,22 +82,21 @@ touch -r lib/Crypto/SelfTest/__main__.py lib/Crypto/SelfTest/__main__.py.new &&
|
|
|
|
|
mv lib/Crypto/SelfTest/__main__.py.new lib/Crypto/SelfTest/__main__.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
|
%pyproject_buildrequires -r
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
touch .separate_namespace
|
|
|
|
|
%if 0%{?_with_python2}
|
|
|
|
|
%py2_build
|
|
|
|
|
%endif
|
|
|
|
|
%py3_build
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
# Build documentation
|
|
|
|
|
%make_build -C Doc/ man SPHINXBUILD=sphinx-build-3
|
|
|
|
|
%make_build -C Doc/ man SPHINXBUILD=sphinx-build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%if 0%{?_with_python2}
|
|
|
|
|
%py2_install
|
|
|
|
|
%endif
|
|
|
|
|
%py3_install
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%pyproject_save_files Cryptodome
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Install man pages
|
|
|
|
@ -115,47 +104,23 @@ install -Dpm 0644 Doc/_build/man/pycryptodome.1 $RPM_BUILD_ROOT%{_mandir}/man1/p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%if 0%{?_with_tests}
|
|
|
|
|
%if 0%{?_with_python2}
|
|
|
|
|
%{__python2} setup.py test
|
|
|
|
|
%endif
|
|
|
|
|
%{__python3} setup.py test
|
|
|
|
|
%endif
|
|
|
|
|
PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch}/ %{__python3} %{py_setup} test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?_with_python2}
|
|
|
|
|
%files -n python2-%{srcname}
|
|
|
|
|
%files -n python3-%{srcname} -f %{pyproject_files}
|
|
|
|
|
%doc AUTHORS.rst Changelog.rst README.rst
|
|
|
|
|
%license LICENSE.rst
|
|
|
|
|
%{python2_sitearch}/Cryptodome/
|
|
|
|
|
%{python2_sitearch}/%{srcname}-*.egg-info/
|
|
|
|
|
%{_mandir}/man1/pycryptodome.1.*
|
|
|
|
|
%endif
|
|
|
|
|
%exclude %{python3_sitearch}/Cryptodome/SelfTest/
|
|
|
|
|
%{_mandir}/man1/pycryptodome.1*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files -n python3-%{srcname}
|
|
|
|
|
%doc AUTHORS.rst Changelog.rst README.rst
|
|
|
|
|
%license LICENSE.rst
|
|
|
|
|
%{python3_sitearch}/Cryptodome/
|
|
|
|
|
%{python3_sitearch}/%{srcname}-*.egg-info/
|
|
|
|
|
%{_mandir}/man1/pycryptodome.1.*
|
|
|
|
|
%files -n python3-%{srcname}-selftest
|
|
|
|
|
%{python3_sitearch}/Cryptodome/SelfTest/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Tue Aug 03 2021 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.10.1-1
|
|
|
|
|
- Update to 3.10.1
|
|
|
|
|
|
|
|
|
|
* Fri Feb 21 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.9.7-1
|
|
|
|
|
- Update to 3.9.7
|
|
|
|
|
|
|
|
|
|
* Mon Feb 03 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.9.6-1
|
|
|
|
|
- Update to 3.9.6
|
|
|
|
|
|
|
|
|
|
* Tue Nov 19 2019 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.9.4-1
|
|
|
|
|
- Update to 3.9.4
|
|
|
|
|
|
|
|
|
|
* Fri Nov 15 2019 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.9.3-1
|
|
|
|
|
- Update to 3.9.3
|
|
|
|
|
* Sun Feb 25 2024 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.20.0-1
|
|
|
|
|
- Update to 3.20.0
|
|
|
|
|
|
|
|
|
|
* Thu Oct 31 2019 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.9.0-1
|
|
|
|
|
- Enable build for EPEL8
|
|
|
|
|
* Wed Feb 02 2022 Mohamed El Morabity <melmorabity@fedoraproject.org> - 3.14.0-1
|
|
|
|
|
- Initial EPEL9 release
|
|
|
|
|