Implement de/serialization for SharedSecret#418
Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom Mar 11, 2022
Merged
Implement de/serialization for SharedSecret#418apoelstra merged 1 commit intorust-bitcoin:masterfrom
apoelstra merged 1 commit intorust-bitcoin:masterfrom
Conversation
Member
|
Will wait for #417 (just needs CI to finish and then I'll merge it) -- but will hold off on publishing the new version until this is in. |
As we do for other keys implement serde de/serialization for the `SharedSecret`. Includes implementation of `from_slice` method that is the borrowed version of `from_bytes` as well as a `FromStr` implementation that parses a hex string.
3c46b65 to
de65fb2
Compare
Member
Author
|
What's the go with the four CI jobs that don't run immediately (seemed this changed a week or two ago)? Was that on purpose or did we botch something? |
Member
|
Oh, I think we removed those but github requires that I go manually uncheck them. I'll do that now. |
apoelstra
previously approved these changes
Mar 11, 2022
Member
apoelstra
left a comment
There was a problem hiding this comment.
ACK d68531d815425bd091855248afcc9c60d490584d
apoelstra
approved these changes
Mar 11, 2022
chain-forgexcr45
added a commit
to chain-forgexcr45/rust-secp256k1
that referenced
this pull request
Sep 28, 2025
… SharedSecret de65fb2f1e4d55ecb04afa621044a96840d449bf Implement de/serialization for SharedSecret (Tobin Harding) Pull request description: As we do for other keys implement serde de/serialization for the `SharedSecret`. Please note, this adds `from_slice` and `from_bytes` (borrowed and owner respectively) because I needed to use them. Doing so treads on @dspicher's toes because he is in the process of implementing an owned conversion method for `SharedSecret`. The fair thing to do would be let rust-bitcoin/rust-secp256k1#417 resolve and merge before merging this one (I can rebase). ~Side note, its kind of rubbish that `BytesVisitor` deserializes into a buffer (presumably) then we reallocate and copy the buffer to use the borrowed conversion method due to the serde function signature `fn visit_bytes<E: de::Error>(self, v: &[u8]) -> Result<Self::Value, E>`~ (I was bumbling nonsense.) Closes: #416 ACKs for top commit: apoelstra: ACK de65fb2f1e4d55ecb04afa621044a96840d449bf Tree-SHA512: 3d484f160d8a459a867f645736713984bad982429236ac5351c20b6c21b42cec86e68009fe7adf062912037cf7e747e5b15357a5fd7900e52169f208a4e56710
william2332-limf
added a commit
to william2332-limf/rust-secp256k1
that referenced
this pull request
Oct 2, 2025
… SharedSecret de65fb2f1e4d55ecb04afa621044a96840d449bf Implement de/serialization for SharedSecret (Tobin Harding) Pull request description: As we do for other keys implement serde de/serialization for the `SharedSecret`. Please note, this adds `from_slice` and `from_bytes` (borrowed and owner respectively) because I needed to use them. Doing so treads on @dspicher's toes because he is in the process of implementing an owned conversion method for `SharedSecret`. The fair thing to do would be let rust-bitcoin/rust-secp256k1#417 resolve and merge before merging this one (I can rebase). ~Side note, its kind of rubbish that `BytesVisitor` deserializes into a buffer (presumably) then we reallocate and copy the buffer to use the borrowed conversion method due to the serde function signature `fn visit_bytes<E: de::Error>(self, v: &[u8]) -> Result<Self::Value, E>`~ (I was bumbling nonsense.) Closes: #416 ACKs for top commit: apoelstra: ACK de65fb2f1e4d55ecb04afa621044a96840d449bf Tree-SHA512: 3d484f160d8a459a867f645736713984bad982429236ac5351c20b6c21b42cec86e68009fe7adf062912037cf7e747e5b15357a5fd7900e52169f208a4e56710
This file contains hidden or 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
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.
As we do for other keys implement serde de/serialization for the
SharedSecret.Please note, this adds
from_sliceandfrom_bytes(borrowed and owner respectively) because I needed to use them. Doing so treads on @dspicher's toes because he is in the process of implementing an owned conversion method forSharedSecret. The fair thing to do would be let #417 resolve and merge before merging this one (I can rebase).Side note, its kind of rubbish that(I was bumbling nonsense.)BytesVisitordeserializes into a buffer (presumably) then we reallocate and copy the buffer to use the borrowed conversion method due to the serde function signaturefn visit_bytes<E: de::Error>(self, v: &[u8]) -> Result<Self::Value, E>Closes: #416