| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f3b46b4 commit 24e4330
38 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,13 +60,9 @@ concatenation of the data fed to it so far using the :meth:`digest` or | |||
| 60 | 60 | ||
| 61 | 61 | Constructors for hash algorithms that are always present in this module are | |
| 62 | 62 | :func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, | |
| 63 | - :func:`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, and | ||
| 64 | - :func:`sha3_512`. Additional algorithms may also be available depending upon | ||
| 63 | + and :func:`sha512`. Additional algorithms may also be available depending upon | ||
| 65 | 64 | the OpenSSL library that Python uses on your platform. | |
| 66 | 65 | ||
| 67 | - .. versionchanged:: 3.4 | ||
| 68 | - Added sha3 family of hash algorithms. | ||
| 69 | - | ||
| 70 | 66 | For example, to obtain the digest of the byte string ``b'Nobody inspects the | |
| 71 | 67 | spammish repetition'``:: | |
| 72 | 68 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -590,25 +590,6 @@ The :mod:`select` and contains the following notice for the kqueue interface:: | |||
| 590 | 590 | SUCH DAMAGE. | |
| 591 | 591 | ||
| 592 | 592 | ||
| 593 | - SHA-3 | ||
| 594 | - ----- | ||
| 595 | - | ||
| 596 | - The module :mod:`_sha3` and :mod:`hashlib` are using the reference | ||
| 597 | - implementation of Keccak. The files at :file:`Modules/_sha3/keccak/` contain | ||
| 598 | - the following note:: | ||
| 599 | - | ||
| 600 | - The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, | ||
| 601 | - Michaël Peeters and Gilles Van Assche. For more information, feedback or | ||
| 602 | - questions, please refer to our website: http://keccak.noekeon.org/ | ||
| 603 | - | ||
| 604 | - Implementation by the designers, | ||
| 605 | - hereby denoted as "the implementer". | ||
| 606 | - | ||
| 607 | - To the extent possible under law, the implementer has waived all copyright | ||
| 608 | - and related or neighboring rights to the source code in this file. | ||
| 609 | - http://creativecommons.org/publicdomain/zero/1.0/ | ||
| 610 | - | ||
| 611 | - | ||
| 612 | 593 | SipHash24 | |
| 613 | 594 | --------- | |
| 614 | 595 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,8 +123,6 @@ Significantly Improved Library Modules: | |||
| 123 | 123 | * :ref:`Single-dispatch generic functions <whatsnew-singledispatch>` in | |
| 124 | 124 | :mod:`functools` (:pep:`443`). | |
| 125 | 125 | * New :mod:`pickle` :ref:`protocol 4 <whatsnew-protocol-4>` (:pep:`3154`). | |
| 126 | - * :ref:`SHA-3 (Keccak) support <whatsnew-sha3>` for :mod:`hashlib` | ||
| 127 | - (:issue:`16113`). | ||
| 128 | 126 | * :ref:`TLSv1.1 and TLSv1.2 support <whatsnew-tls-11-12>` for :mod:`ssl` | |
| 129 | 127 | (:issue:`16692`). | |
| 130 | 128 | * :mod:`multiprocessing` now has :ref:`an option to avoid using os.fork | |
@@ -667,12 +665,6 @@ hashlib | |||
| 667 | 665 | New :func:`hashlib.pbkdf2_hmac` function. | |
| 668 | 666 | (Contributed by Christian Heimes in :issue:`18582`) | |
| 669 | 667 | ||
| 670 | - .. _whatsnew-sha3: | ||
| 671 | - | ||
| 672 | - New :ref:`hash algorithms <hash-algorithms>` ``sha3_224()``, ``sha3_256()``, | ||
| 673 | - ``sha3_384()``, and ``sha3_512()``. (Contributed by Christian Heimes in | ||
| 674 | - :issue:`16113`.) | ||
| 675 | - | ||
| 676 | 668 | ||
| 677 | 669 | html | |
| 678 | 670 | ---- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,8 +54,7 @@ | |||
| 54 | 54 | ||
| 55 | 55 | # This tuple and __get_builtin_constructor() must be modified if a new | |
| 56 | 56 | # always available algorithm is added. | |
| 57 | - __always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', | ||
| 58 | - 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512') | ||
| 57 | + __always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512') | ||
| 59 | 58 | ||
| 60 | 59 | algorithms_guaranteed = set(__always_supported) | |
| 61 | 60 | algorithms_available = set(__always_supported) | |
@@ -86,13 +85,6 @@ def __get_builtin_constructor(name): | |||
| 86 | 85 | import _sha512 | |
| 87 | 86 | cache['SHA384'] = cache['sha384'] = _sha512.sha384 | |
| 88 | 87 | cache['SHA512'] = cache['sha512'] = _sha512.sha512 | |
| 89 | - elif name in {'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', | ||
| 90 | - 'SHA3_224', 'SHA3_256', 'SHA3_384', 'SHA3_512'}: | ||
| 91 | - import _sha3 | ||
| 92 | - cache['SHA3_224'] = cache['sha3_224'] = _sha3.sha3_224 | ||
| 93 | - cache['SHA3_256'] = cache['sha3_256'] = _sha3.sha3_256 | ||
| 94 | - cache['SHA3_384'] = cache['sha3_384'] = _sha3.sha3_384 | ||
| 95 | - cache['SHA3_512'] = cache['sha3_512'] = _sha3.sha3_512 | ||
| 96 | 88 | except ImportError: | |
| 97 | 89 | pass # no extension module, this hash is unsupported. | |
| 98 | 90 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,10 +38,7 @@ def hexstr(s): | |||
| 38 | 38 | class HashLibTestCase(unittest.TestCase): | |
| 39 | 39 | supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1', | |
| 40 | 40 | 'sha224', 'SHA224', 'sha256', 'SHA256', | |
| 41 | - 'sha384', 'SHA384', 'sha512', 'SHA512', | ||
| 42 | - 'sha3_224', 'sha3_256', 'sha3_384', | ||
| 43 | - 'sha3_512', 'SHA3_224', 'SHA3_256', | ||
| 44 | - 'SHA3_384', 'SHA3_512' ) | ||
| 41 | + 'sha384', 'SHA384', 'sha512', 'SHA512') | ||
| 45 | 42 | ||
| 46 | 43 | # Issue #14693: fallback modules are always compiled under POSIX | |
| 47 | 44 | _warn_on_extension_import = os.name == 'posix' or COMPILED_WITH_PYDEBUG | |
@@ -102,12 +99,6 @@ def add_builtin_constructor(name): | |||
| 102 | 99 | if _sha512: | |
| 103 | 100 | add_builtin_constructor('sha384') | |
| 104 | 101 | add_builtin_constructor('sha512') | |
| 105 | - _sha3 = self._conditional_import_module('_sha3') | ||
| 106 | - if _sha3: | ||
| 107 | - add_builtin_constructor('sha3_224') | ||
| 108 | - add_builtin_constructor('sha3_256') | ||
| 109 | - add_builtin_constructor('sha3_384') | ||
| 110 | - add_builtin_constructor('sha3_512') | ||
| 111 | 102 | ||
| 112 | 103 | super(HashLibTestCase, self).__init__(*args, **kwargs) | |
| 113 | 104 | ||
@@ -234,10 +225,6 @@ def test_no_unicode(self): | |||
| 234 | 225 | self.check_no_unicode('sha256') | |
| 235 | 226 | self.check_no_unicode('sha384') | |
| 236 | 227 | self.check_no_unicode('sha512') | |
| 237 | - self.check_no_unicode('sha3_224') | ||
| 238 | - self.check_no_unicode('sha3_256') | ||
| 239 | - self.check_no_unicode('sha3_384') | ||
| 240 | - self.check_no_unicode('sha3_512') | ||
| 241 | 228 | ||
| 242 | 229 | def check_blocksize_name(self, name, block_size=0, digest_size=0): | |
| 243 | 230 | constructors = self.constructors_to_test[name] | |
@@ -257,10 +244,6 @@ def test_blocksize_name(self): | |||
| 257 | 244 | self.check_blocksize_name('sha256', 64, 32) | |
| 258 | 245 | self.check_blocksize_name('sha384', 128, 48) | |
| 259 | 246 | self.check_blocksize_name('sha512', 128, 64) | |
| 260 | - self.check_blocksize_name('sha3_224', NotImplemented, 28) | ||
| 261 | - self.check_blocksize_name('sha3_256', NotImplemented, 32) | ||
| 262 | - self.check_blocksize_name('sha3_384', NotImplemented, 48) | ||
| 263 | - self.check_blocksize_name('sha3_512', NotImplemented, 64) | ||
| 264 | 247 | ||
| 265 | 248 | def test_case_md5_0(self): | |
| 266 | 249 | self.check('md5', b'', 'd41d8cd98f00b204e9800998ecf8427e') | |
@@ -396,27 +379,6 @@ def test_case_sha512_3(self): | |||
| 396 | 379 | "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+ | |
| 397 | 380 | "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b") | |
| 398 | 381 | ||
| 399 | - # SHA-3 family | ||
| 400 | - def test_case_sha3_224_0(self): | ||
| 401 | - self.check('sha3_224', b"", | ||
| 402 | - "F71837502BA8E10837BDD8D365ADB85591895602FC552B48B7390ABD") | ||
| 403 | - | ||
| 404 | - def test_case_sha3_224_1(self): | ||
| 405 | - self.check('sha3_224', bytes.fromhex("CC"), | ||
| 406 | - "A9CAB59EB40A10B246290F2D6086E32E3689FAF1D26B470C899F2802") | ||
| 407 | - | ||
| 408 | - def test_case_sha3_224_2(self): | ||
| 409 | - self.check('sha3_224', bytes.fromhex("41FB"), | ||
| 410 | - "615BA367AFDC35AAC397BC7EB5D58D106A734B24986D5D978FEFD62C") | ||
| 411 | - | ||
| 412 | - def test_case_sha3_224_3(self): | ||
| 413 | - self.check('sha3_224', bytes.fromhex( | ||
| 414 | - "433C5303131624C0021D868A30825475E8D0BD3052A022180398F4CA4423B9"+ | ||
| 415 | - "8214B6BEAAC21C8807A2C33F8C93BD42B092CC1B06CEDF3224D5ED1EC29784"+ | ||
| 416 | - "444F22E08A55AA58542B524B02CD3D5D5F6907AFE71C5D7462224A3F9D9E53"+ | ||
| 417 | - "E7E0846DCBB4CE"), | ||
| 418 | - "62B10F1B6236EBC2DA72957742A8D4E48E213B5F8934604BFD4D2C3A") | ||
| 419 | - | ||
| 420 | 382 | @bigmemtest(size=_4G + 5, memuse=1) | |
| 421 | 383 | def test_case_sha3_224_huge(self, size): | |
| 422 | 384 | if size == _4G + 5: | |
@@ -426,78 +388,6 @@ def test_case_sha3_224_huge(self, size): | |||
| 426 | 388 | except OverflowError: | |
| 427 | 389 | pass # 32-bit arch | |
| 428 | 390 | ||
| 429 | - | ||
| 430 | - def test_case_sha3_256_0(self): | ||
| 431 | - self.check('sha3_256', b"", | ||
| 432 | - "C5D2460186F7233C927E7DB2DCC703C0E500B653CA82273B7BFAD8045D85A470") | ||
| 433 | - | ||
| 434 | - def test_case_sha3_256_1(self): | ||
| 435 | - self.check('sha3_256', bytes.fromhex("CC"), | ||
| 436 | - "EEAD6DBFC7340A56CAEDC044696A168870549A6A7F6F56961E84A54BD9970B8A") | ||
| 437 | - | ||
| 438 | - def test_case_sha3_256_2(self): | ||
| 439 | - self.check('sha3_256', bytes.fromhex("41FB"), | ||
| 440 | - "A8EACEDA4D47B3281A795AD9E1EA2122B407BAF9AABCB9E18B5717B7873537D2") | ||
| 441 | - | ||
| 442 | - def test_case_sha3_256_3(self): | ||
| 443 | - self.check('sha3_256', bytes.fromhex( | ||
| 444 | - "433C5303131624C0021D868A30825475E8D0BD3052A022180398F4CA4423B9"+ | ||
| 445 | - "8214B6BEAAC21C8807A2C33F8C93BD42B092CC1B06CEDF3224D5ED1EC29784"+ | ||
| 446 | - "444F22E08A55AA58542B524B02CD3D5D5F6907AFE71C5D7462224A3F9D9E53"+ | ||
| 447 | - "E7E0846DCBB4CE"), | ||
| 448 | - "CE87A5173BFFD92399221658F801D45C294D9006EE9F3F9D419C8D427748DC41") | ||
| 449 | - | ||
| 450 | - | ||
| 451 | - def test_case_sha3_384_0(self): | ||
| 452 | - self.check('sha3_384', b"", | ||
| 453 | - "2C23146A63A29ACF99E73B88F8C24EAA7DC60AA771780CCC006AFBFA8FE2479B"+ | ||
| 454 | - "2DD2B21362337441AC12B515911957FF") | ||
| 455 | - | ||
| 456 | - def test_case_sha3_384_1(self): | ||
| 457 | - self.check('sha3_384', bytes.fromhex("CC"), | ||
| 458 | - "1B84E62A46E5A201861754AF5DC95C4A1A69CAF4A796AE405680161E29572641"+ | ||
| 459 | - "F5FA1E8641D7958336EE7B11C58F73E9") | ||
| 460 | - | ||
| 461 | - def test_case_sha3_384_2(self): | ||
| 462 | - self.check('sha3_384', bytes.fromhex("41FB"), | ||
| 463 | - "495CCE2714CD72C8C53C3363D22C58B55960FE26BE0BF3BBC7A3316DD563AD1D"+ | ||
| 464 | - "B8410E75EEFEA655E39D4670EC0B1792") | ||
| 465 | - | ||
| 466 | - def test_case_sha3_384_3(self): | ||
| 467 | - self.check('sha3_384', bytes.fromhex( | ||
| 468 | - "433C5303131624C0021D868A30825475E8D0BD3052A022180398F4CA4423B9"+ | ||
| 469 | - "8214B6BEAAC21C8807A2C33F8C93BD42B092CC1B06CEDF3224D5ED1EC29784"+ | ||
| 470 | - "444F22E08A55AA58542B524B02CD3D5D5F6907AFE71C5D7462224A3F9D9E53"+ | ||
| 471 | - "E7E0846DCBB4CE"), | ||
| 472 | - "135114508DD63E279E709C26F7817C0482766CDE49132E3EDF2EEDD8996F4E35"+ | ||
| 473 | - "96D184100B384868249F1D8B8FDAA2C9") | ||
| 474 | - | ||
| 475 | - | ||
| 476 | - def test_case_sha3_512_0(self): | ||
| 477 | - self.check('sha3_512', b"", | ||
| 478 | - "0EAB42DE4C3CEB9235FC91ACFFE746B29C29A8C366B7C60E4E67C466F36A4304"+ | ||
| 479 | - "C00FA9CAF9D87976BA469BCBE06713B435F091EF2769FB160CDAB33D3670680E") | ||
| 480 | - | ||
| 481 | - def test_case_sha3_512_1(self): | ||
| 482 | - self.check('sha3_512', bytes.fromhex("CC"), | ||
| 483 | - "8630C13CBD066EA74BBE7FE468FEC1DEE10EDC1254FB4C1B7C5FD69B646E4416"+ | ||
| 484 | - "0B8CE01D05A0908CA790DFB080F4B513BC3B6225ECE7A810371441A5AC666EB9") | ||
| 485 | - | ||
| 486 | - def test_case_sha3_512_2(self): | ||
| 487 | - self.check('sha3_512', bytes.fromhex("41FB"), | ||
| 488 | - "551DA6236F8B96FCE9F97F1190E901324F0B45E06DBBB5CDB8355D6ED1DC34B3"+ | ||
| 489 | - "F0EAE7DCB68622FF232FA3CECE0D4616CDEB3931F93803662A28DF1CD535B731") | ||
| 490 | - | ||
| 491 | - def test_case_sha3_512_3(self): | ||
| 492 | - self.check('sha3_512', bytes.fromhex( | ||
| 493 | - "433C5303131624C0021D868A30825475E8D0BD3052A022180398F4CA4423B9"+ | ||
| 494 | - "8214B6BEAAC21C8807A2C33F8C93BD42B092CC1B06CEDF3224D5ED1EC29784"+ | ||
| 495 | - "444F22E08A55AA58542B524B02CD3D5D5F6907AFE71C5D7462224A3F9D9E53"+ | ||
| 496 | - "E7E0846DCBB4CE"), | ||
| 497 | - "527D28E341E6B14F4684ADB4B824C496C6482E51149565D3D17226828884306B"+ | ||
| 498 | - "51D6148A72622C2B75F5D3510B799D8BDC03EAEDE453676A6EC8FE03A1AD0EAB") | ||
| 499 | - | ||
| 500 | - | ||
| 501 | 391 | def test_gil(self): | |
| 502 | 392 | # Check things work fine with an input larger than the size required | |
| 503 | 393 | # for multithreaded operation (which is hardwired to 2048). | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -501,7 +501,6 @@ coverage-lcov: | |||
| 501 | 501 | : # remove 3rd party modules and system headers | |
| 502 | 502 | @lcov --remove $(COVERAGE_INFO) \ | |
| 503 | 503 | '*/Modules/_ctypes/libffi*/*' \ | |
| 504 | - '*/Modules/_sha3/keccak/*' \ | ||
| 505 | 504 | '*/Modules/_decimal/libmpdec/*' \ | |
| 506 | 505 | '*/Modules/expat/*' \ | |
| 507 | 506 | '*/Modules/zlib/*' \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,8 @@ Core and Builtins | |||
| 46 | 46 | Library | |
| 47 | 47 | ------- | |
| 48 | 48 | ||
| 49 | + - Issue #16113: Remove sha3 module again. | ||
| 50 | + | ||
| 49 | 51 | - Issue #20111: pathlib.Path.with_suffix() now sanity checks the given suffix. | |
| 50 | 52 | ||
| 51 | 53 | - Fix breakage in TestSuite.countTestCases() introduced by issue #11798. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments