bip32: add PrivateKey::derive_tweak()
and PublicKey::derive_tweak()
#1186
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.
Closes #1185
Adds
PublicKey::derive_tweak()
andPrivateKey::derive_tweak()
exposing the tweak-generation API that extended keys use. These methods have default implementations, so it's not a breaking change. This is the minimum that I need to use BIP-32 with DKG shares.Alternatively, these can be separate functions, to illustrate that the implementation is standardized and should not be overridden.
Possible further work:
PrivateKey
orPublicKey
. I currently do it manually in my own code.ZeroizeOnDrop
-able type instead of using plainPrivateKeyBytes
. This will be a breaking change.ecdsa
andelliptic-curve
traits. This will be a major breaking change, given how many hardcoded constant-sized arrays are there now. In particular this will allow us to have tweaks ofScalar
type instead of just byte arrays, which will mean more localized error checking and an ability to sum them.