-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #406: Use fixed width serde impls for keys
3ca7f49 Add fixed-width-serde integration tests (Tobin Harding) bf9f556 Add rustdocs describing fixed width serde (Tobin Harding) c28808c Improve rustdocs for KeyPair (Tobin Harding) 6842383 Use fixed width serde impls for keys (Tobin Harding) Pull request description: Currently we serialize keys using the `BytesVisitor`, this causes the serialized data to contain additional metadata encoding the length (an extra 8 bytes) when serialized with [bincode.](https://docs.rs/bincode/latest/bincode/index.html). This extra data is unnecessary since we know in advance the length of these two types. We do not control the data output by serialization of our types because it depends on which crate is used to do the serialization. This PR improves the situation for serialization using the `bincode` crate, and this PR introduces mentions of `bincode` in the rustdocs, is this acceptable? See below for a table that describes binary serialization by other crates. Implement a sequence based visitor that encodes the keys as fixed width data for: - `SecretKey` - `PublicKey` - `KeyPair` - `XOnlyPublicKey` Fixes: #295 **Question**: PR only does keys, do we want to do signatures as well? ACKs for top commit: apoelstra: ACK 3ca7f49 Tree-SHA512: 77babce74fa9f0981bb3b869c4e77a68a4d1ec28d22d2c3be4305e27ef01d4828dac210e20b968cbbe5de8a0563cd985d7969bccf75cfe627a34a116fed1a5df
- Loading branch information
Showing
5 changed files
with
282 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.