-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fallback to pure-python ripemd160 #277
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks!
Tell you what. Since ripemd160 is pretty rarely used, let's just use the pure python implementation all the time rather than use it as a fallback. That'll make testing simpler.
In case I'm wrong, better to just add a new commit to this pull-req that removes the fallback code in case we ever decide to add it back later.
…On July 26, 2022 11:07:42 PM GMT+02:00, windsok ***@***.***> wrote:
Newer versions of OpenSSL have removed support for `ripemd160` by default which results in an `ValueError: unsupported hash type ripemd160` exception being raised any time the `Hash160` function is used within `python-bitcoinlib`.
See bitcoin/bitcoin#23710 for further details of the issue.
This PR adds a fallback to a pure-python implementation of ripemd160. The code is taken from bitcoin/bitcoin#23716, and the implementation here is based on diybitcoinhardware/embit@2e293b0
You can view, comment on, or merge this pull request online at:
#277
-- Commit Summary --
* Add fallback to pure-python ripemd160
-- File Changes --
A bitcoin/core/contrib/__init__.py (0)
A bitcoin/core/contrib/ripemd160.py (110)
M bitcoin/core/serialize.py (16)
A bitcoin/tests/test_ripemd160.py (24)
-- Patch Links --
https://github.com/petertodd/python-bitcoinlib/pull/277.patch
https://github.com/petertodd/python-bitcoinlib/pull/277.diff
--
Reply to this email directly or view it on GitHub:
#277
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Makes sense to me, I have added the new commit |
ACK
…On July 27, 2022 8:55:22 PM GMT+03:00, windsok ***@***.***> wrote:
Makes sense to me, I have added the new commit
--
Reply to this email directly or view it on GitHub:
#277 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
There was actually kinda better version of this with type annotations added. Simplexum#65 |
niftynei
added a commit
to niftynei/lnprototest
that referenced
this pull request
Sep 8, 2022
OpenSSL removed ripemd160, which impacts the default impl of hashlib for most python installs (true as of 22.04 LTS) See also: - openssl/openssl#16994 - bitcoin/bitcoin#23710 - petertodd/python-bitcoinlib#277
niftynei
added a commit
to niftynei/lnprototest
that referenced
this pull request
Sep 8, 2022
OpenSSL removed ripemd160, which impacts the default impl of hashlib for most python installs (true as of 22.04 LTS) See also: - openssl/openssl#16994 - bitcoin/bitcoin#23710 - petertodd/python-bitcoinlib#277
niftynei
added a commit
to niftynei/lnprototest
that referenced
this pull request
Sep 9, 2022
OpenSSL removed ripemd160, which impacts the default impl of hashlib for most python installs (true as of 22.04 LTS) See also: - openssl/openssl#16994 - bitcoin/bitcoin#23710 - petertodd/python-bitcoinlib#277
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Newer versions of OpenSSL have removed support for
ripemd160
by default which results in anValueError: unsupported hash type ripemd160
exception being raised any time theHash160
function is used withinpython-bitcoinlib
.See bitcoin/bitcoin#23710 for further details of the issue.
This PR adds a fallback to a pure-python implementation of ripemd160. The code is taken from bitcoin/bitcoin#23716, and the implementation here is based on diybitcoinhardware/embit@2e293b0