1
0
mirror of synced 2024-12-22 12:50:33 +01:00

dev-python/pycryptodomex: version bump, unbundled, passing tests

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Horea Christian <chr@chymera.eu>
This commit is contained in:
Horea Christian 2022-03-27 00:12:44 -04:00
parent 382d443556
commit c0ed1ed368
No known key found for this signature in database
GPG Key ID: 161C0BE6255333D3
6 changed files with 126 additions and 63 deletions

View File

@ -1,2 +1,2 @@
DIST pycryptodomex-3.10.1.tar.gz 3787268 SHA256 541cd3e3e252fb19a7b48f420b798b53483302b7fe4d9954c947605d0a263d62 SHA512 0ffd37e75caf6472529bbc231c7e74290267094eb3a6013a55d32dc6e11313017bb8161bdfef6c96e911e788b837caa445a9e1fe3e17e5e0254c139378f2a5e6 WHIRLPOOL e07f6da41f17da89d59d4656aa1c40fe039f6bbb14fb7dde9cfdb0d86c639005f7e87f747c937c3ad4e941b39634c0399ebb905aca05625fc60d4ca5efd7797b
DIST pycryptodomex-3.10.4.tar.gz 3797210 SHA256 acd3498a8ccf8ad20ce7daa5f7f5e6521465eeceb026f28a6adb0228dd9fcc6e SHA512 38a24f8a51c6b3d03e6fc7226921956bfaea4d8839a1e308de417d76931eedc969d913b62d7001bf2116ab613c31e6802194127af25cee2ff83971f871a62111 WHIRLPOOL 60786c71df0a9ca92ebb7a7633676bc6aaf19ebdb69f68a99058252e715462067f53b12cb83277d82d16e3ab4b49c594061e2e0c73a1bddd976b1f51877b626a
DIST pycryptodomex-3.14.1.tar.gz 3372625 SHA256 2ce76ed0081fd6ac8c74edc75b9d14eca2064173af79843c24fa62573263c1f2 SHA512 cd01431b9178bcb27332741097cf020859c48df83219bac9d6ffa1f52db1f112b562478260baa1aed4674e2833d6e0cd5794a43dafb09fda007fdce7a7330495 WHIRLPOOL 678b958ceb09528c8400f4ff65ba526a9b86cb7465e6eab4db0815f5f8b080931f7ef3254efb162ef65d36d82bfa56a313be8294516670b4559a6724ab79c227

View File

@ -0,0 +1,50 @@
diff -dupr a/setup.py b/setup.py
--- a/setup.py 2021-02-09 13:49:46.356455141 +0100
+++ b/setup.py 2021-02-09 13:50:49.351076275 +0100
@@ -367,13 +367,15 @@ ext_modules = [
sources=["src/CAST.c"],
py_limited_api=True),
Extension("Crypto.Cipher._raw_des",
- include_dirs=['src/', 'src/libtom/'],
+ include_dirs=['src/'],
sources=["src/DES.c"],
- py_limited_api=True),
+ py_limited_api=True,
+ extra_link_args=["-ltomcrypt"]),
Extension("Crypto.Cipher._raw_des3",
- include_dirs=['src/', 'src/libtom/'],
+ include_dirs=['src/'],
sources=["src/DES3.c"],
- py_limited_api=True),
+ py_limited_api=True,
+ extra_link_args=["-ltomcrypt"]),
Extension("Crypto.Util._cpuid_c",
include_dirs=['src/'],
sources=['src/cpuid.c'],
@@ -410,9 +412,10 @@ ext_modules = [
sources=["src/ARC4.c"],
py_limited_api=True),
Extension("Crypto.Cipher._Salsa20",
- include_dirs=['src/', 'src/libtom/'],
+ include_dirs=['src/'],
sources=["src/Salsa20.c"],
- py_limited_api=True),
+ py_limited_api=True,
+ extra_link_args=["-ltomcrypt"]),
Extension("Crypto.Cipher._chacha20",
include_dirs=['src/'],
sources=["src/chacha20.c"],
Only in b: setup.py.orig
Only in b: setup.py.rej
diff -dupr a/src/DES.c b/src/DES.c
--- a/src/DES.c 2021-02-09 13:49:46.336454729 +0100
+++ b/src/DES.c 2021-02-09 13:50:02.640123617 +0100
@@ -39,7 +39,7 @@ FAKE_INIT(raw_des3)
/* Include the actial DES implementation */
#define LTC_NO_PROTOTYPES
-#include "libtom/tomcrypt_des.c"
+#include <tomcrypt.h>
struct block_state {
symmetric_key sk;

View File

@ -10,17 +10,12 @@
<name>Gentoo Science Project</name>
</maintainer>
<longdescription lang="en">
PyCryptodome is a self-contained Python package of low-level
cryptographic primitives. It is a fork of PyCrypto, and brings
numerous enhancements with respect to the official versions of
PyCrypto, such as Authenticated encryption modes (GCM, CCM, EAX,
SIV, OCB), Accelerated AES on Intel platforms via AES-NI, Elliptic
curves cryptography (NIST P-256, P-384 and P-521 curves only),
SHA-3 (including SHAKE XOFs), truncated SHA-512 and BLAKE2 hash
algorithms, and many more. 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.
Equivalent package to dev-python/cryptodome which installs
modules under the Cryptodome package, so that PyCrypto and
PyCryptodome can coexist.
</longdescription>
<upstream>
<remote-id type="github">Legrandin/pycryptodome</remote-id>
<remote-id type="pypi">pycryptodomex</remote-id>
</upstream>
</pkgmetadata>

View File

@ -1,34 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1
DESCRIPTION="Cryptographic library for Python"
HOMEPAGE="https://www.pycryptodome.org https://pypi.org/project/pycryptodomex/"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="test"
# Numerous tests fail, reported upstream https://github.com/Legrandin/pycryptodome/issues/549
DOCS="README.rst"
RDEPEND=""
BDEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/nose[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
)"
python_test() {
nosetests --verbose || die
py.test -v -v || die
}

View File

@ -1,9 +1,11 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8..10} pypy3)
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1
@ -11,24 +13,31 @@ DESCRIPTION="Cryptographic library for Python"
HOMEPAGE="https://www.pycryptodome.org https://pypi.org/project/pycryptodomex/"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
LICENSE="BSD-2 Unlicense"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="test"
# Numerous tests fail, reported upstream https://github.com/Legrandin/pycryptodome/issues/549
RESTRICT="!test? ( test )"
DOCS="README.rst"
DEPEND="
dev-libs/gmp:0=
>=dev-libs/libtomcrypt-1.18.2-r1:=
"
BDEPEND="virtual/python-cffi[${PYTHON_USEDEP}]"
RDEPEND="
${DEPEND}
${BDEPEND}
"
RDEPEND=""
BDEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/nose[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
)"
PATCHES=(
"${FILESDIR}/pycryptodome-3.10.1-system-libtomcrypt.patch"
)
python_test() {
nosetests --verbose || die
py.test -v -v || die
distutils_enable_tests setup.py
python_prepare_all() {
# make sure we're unbundling it correctly
rm -r src/libtom || die
distutils-r1_python_prepare_all
}

View File

@ -0,0 +1,43 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8..10} pypy3)
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1
DESCRIPTION="Cryptographic library for Python"
HOMEPAGE="https://www.pycryptodome.org https://pypi.org/project/pycryptodomex/"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD-2 Unlicense"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="
dev-libs/gmp:0=
>=dev-libs/libtomcrypt-1.18.2-r1:=
"
BDEPEND="virtual/python-cffi[${PYTHON_USEDEP}]"
RDEPEND="
${DEPEND}
${BDEPEND}
"
PATCHES=(
"${FILESDIR}/pycryptodome-3.10.1-system-libtomcrypt.patch"
)
distutils_enable_tests setup.py
python_prepare_all() {
# make sure we're unbundling it correctly
rm -r src/libtom || die
distutils-r1_python_prepare_all
}