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 HKDF to bitcoin_hashes #2644
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 8853654989Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review only, I know nothing about HKDF and am not a cryptographer.
Code looks nice and clean, just a couple questions about the mutable parameter and potential for panics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK with the feature gate fixes! Thanks.
@nyonson just FYI we are in a feature freeze at the moment. This only touches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7d9b21c
Hey @apoelstra bump please. |
ACK 7d9b21c but could you squash all these commits (or most of them) since they are largely part of the same logical change? Also some of these commits don't compile by themselves. |
Woops, I probably should have noticed that. My bad. |
My bad. I crunched down the test ones since they weren't all that interesting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2a9215d
BIP324's peer to peer encryption protocol requires an HMAC-based extract and expand key derivation function (HKDF). HKDFs were not part of many bitcoin protocols before BIP324, but the hope is that the encrypted protocol becomes the dominant standard justifying this implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 67e67c9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 67e67c9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 67e67c9
rustaceanrob and I have been working on a Rust-based BIP324 implementation over at https://github.com/rustaceanrob/bip324. We have been attempting to keep the code pretty clean in hopes of a future "soft landing" in rust-bitcoin. I figured the HKDF implementation is a small, self-contained chunk that might allow us to learn the ropes here first.
There was a mention in the discussion thread on BIP324 that the hashes interface may be changing in the near future. I am not sure the effect that would have on this implementation, but happy to work through any issues.
Closes #2551