Issue 26834: Add truncated SHA512/224 and SHA512/256
Created on 2016-04-23 19:27 by christian.heimes, last changed 2022-04-11 14:58 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| cpython-cheimes-0001-Add-truncate-SHA512-224-and-SHA512-256-hash-algorith.patch | christian.heimes, 2016-04-23 19:27 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg264068 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2016-04-23 19:27 | |
SHA512/224 and SHA512/256 are truncated versions of SHA512. Just like SHA384 they use the same algorithm but different initial values and a smaller digest. I took the start vectors and test values from libtomcrypt. Like in my blake2 branch I have add tp_new to the types and removed the old factory methods. Now it is possible to instantiate the types. The code is also in my github fork https://github.com/tiran/cpython/tree/feature/sha512truncated |
|||
| msg266471 - (view) | Author: Martin Panter (martin.panter) * ![]() |
Date: 2016-05-27 03:18 | |
Would it be appropriate to mention these hashes higher up in the documentation, e.g. where it lists the names of the always-present constructors? I haven’t had a close look at the C code. It looks like you are also adding better multithreading support for SHA-512 objects (? related to Issue 4821). |
|||
| msg316086 - (view) | Author: Nick Timkovich (nicktimko) * | Date: 2018-05-02 19:36 | |
Was this patch mostly ready to go? The additional SHA512 variants are appealing because they run ~40% faster than SHA256 on 64-bit hardware for longer messages. |
|||
| msg404598 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2021-10-21 13:11 | |
OpenSSL 1.1.1 comes with sha512_256 and sha512_224. I propose that we use the OpenSSL implementation and don't add the variants to our _sha512 module.
>>> hashlib.new("sha512_256").hexdigest()
'c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a'
>>> hashlib.new("sha512_224").hexdigest()
'6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4'
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:30 | admin | set | github: 71021 |
| 2021-10-21 13:11:03 | christian.heimes | set | versions:
+ Python 3.11, - Python 3.8 nosy: + docs@python messages: + msg404598 assignee: docs@python |
| 2020-08-07 07:39:42 | sir-sigurd | set | nosy:
+ sir-sigurd |
| 2018-05-02 21:44:12 | gregory.p.smith | set | versions: + Python 3.8, - Python 3.6 |
| 2018-05-02 19:36:01 | nicktimko | set | nosy:
+ nicktimko messages: + msg316086 |
| 2016-05-27 03:18:22 | martin.panter | set | nosy:
+ martin.panter messages: + msg266471 |
| 2016-04-23 19:27:41 | christian.heimes | create | |
