-
Notifications
You must be signed in to change notification settings - Fork 305
Implement de/serialization for SharedSecret #418
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
Conversation
|
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
|
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? |
|
Oh, I think we removed those but github requires that I go manually uncheck them. I'll do that now. |
apoelstra
left a comment
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 d68531d815425bd091855248afcc9c60d490584d
apoelstra
left a comment
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 de65fb2
… 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
… 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
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