From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1498888-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 1B0E915A7D9
	for <garchives@archives.gentoo.org>; Tue, 21 Mar 2023 02:30:37 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id B8FF2E0798;
	Tue, 21 Mar 2023 02:30:35 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4B1A8E0794
	for <gentoo-commits@lists.gentoo.org>; Tue, 21 Mar 2023 02:30:35 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 1786B34121D
	for <gentoo-commits@lists.gentoo.org>; Tue, 21 Mar 2023 02:30:34 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 57A428EE
	for <gentoo-commits@lists.gentoo.org>; Tue, 21 Mar 2023 02:30:32 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1679365824.85b71d3379575cb8a5f2f79f3fc534d82c3bbf09.sam@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/
X-VCS-Repository: proj/portage
X-VCS-Files: lib/portage/checksum.py
X-VCS-Directories: lib/portage/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 85b71d3379575cb8a5f2f79f3fc534d82c3bbf09
X-VCS-Branch: master
Date: Tue, 21 Mar 2023 02:30:32 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 6a2c2389-2b7a-42be-8f7c-c8e465c42c0d
X-Archives-Hash: b14a572aed71f7b94c24d35da42df018

commit:     85b71d3379575cb8a5f2f79f3fc534d82c3bbf09
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 20 03:34:08 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 02:30:24 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=85b71d33

checksum: drop pycrypto/pycryptodome fallback for BLAKE2/SHA3

Included with >= Python 3.6 and we weren't testing these codepaths anyway.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/checksum.py | 55 ++++---------------------------------------------
 1 file changed, 4 insertions(+), 51 deletions(-)

diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py
index 11b83a1fc..96f3939c9 100644
--- a/lib/portage/checksum.py
+++ b/lib/portage/checksum.py
@@ -27,10 +27,10 @@ from portage.localization import _
 # SHA512: hashlib
 # RMD160: hashlib, pycrypto, mhash
 # WHIRLPOOL: hashlib, mhash, bundled (C), bundled (Python)
-# BLAKE2B (512): hashlib, pycrypto
-# BLAKE2S (512): hashlib,pycrypto
-# SHA3_256: hashlib, pycrypto
-# SHA3_512: hashlib, pycrypto
+# BLAKE2B (512): hashlib
+# BLAKE2S (512): hashlib
+# SHA3_256: hashlib
+# SHA3_512: hashlib
 
 
 # Dict of all available hash functions
@@ -138,53 +138,6 @@ if "RMD160" not in hashfunc_map:
     except ImportError:
         pass
 
-# The following hashes were added in pycryptodome (pycrypto fork)
-if "BLAKE2B" not in hashfunc_map:
-    try:
-        from Crypto.Hash import BLAKE2b
-
-        blake2bhash_ = getattr(BLAKE2b, "new", None)
-        if blake2bhash_ is not None:
-            _generate_hash_function(
-                "BLAKE2B",
-                functools.partial(blake2bhash_, digest_bytes=64),
-                origin="pycrypto",
-            )
-    except ImportError:
-        pass
-
-if "BLAKE2S" not in hashfunc_map:
-    try:
-        from Crypto.Hash import BLAKE2s
-
-        blake2shash_ = getattr(BLAKE2s, "new", None)
-        if blake2shash_ is not None:
-            _generate_hash_function(
-                "BLAKE2S",
-                functools.partial(blake2shash_, digest_bytes=32),
-                origin="pycrypto",
-            )
-    except ImportError:
-        pass
-
-if "SHA3_256" not in hashfunc_map:
-    try:
-        from Crypto.Hash import SHA3_256
-
-        sha3_256hash_ = getattr(SHA3_256, "new", None)
-        if sha3_256hash_ is not None:
-            _generate_hash_function("SHA3_256", sha3_256hash_, origin="pycrypto")
-    except ImportError:
-        pass
-
-if "SHA3_512" not in hashfunc_map:
-    try:
-        from Crypto.Hash import SHA3_512
-
-        sha3_512hash_ = getattr(SHA3_512, "new", None)
-        if sha3_512hash_ is not None:
-            _generate_hash_function("SHA3_512", sha3_512hash_, origin="pycrypto")
-    except ImportError:
         pass