Implement secret byte conversions for ecdh::SharedSecret#889
Open
Abeeujah wants to merge 2 commits into
Open
Conversation
Member
|
In 2cb8058: missing deprecations, at least one method has wrong signature |
Member
|
Thanks for the contribution. Patch two needs more attention, please consider reading http://waltermcginnis.com/site/web_links/show/101-chris-beams-how-to-write-a-git-commit-message and for all commits use that format. If you make your changes easy to review you have more chance of getting things merged! |
2fb886c to
dec79e0
Compare
Adds `as_secret_bytes` and `from_secret_bytes` to the `SharedSecret` implementation. These methods provide a standardized way to access and initialize the underlying secret array, enabling the type to pass the `secret_bytes_rtt_test` suite. Removes the FIXME regarding RTT test failures for this type.
Modify SharedSecret::as_secret_bytes() to return &[u8; SHARED_SECRET_SIZE] instead of [u8; SHARED_SECRET_SIZE] to avoid unnecessary copying of the underlying secret. Deprecates the following methods in favor of the newly standardized `secret_bytes` naming convention: - `to_secret_bytes` (use `as_secret_bytes`) - `from_bytes` (use `from_secret_bytes`) This completes the transition to the standardized byte conversion API while maintaining backward compatibility.
dec79e0 to
f542ecb
Compare
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.
Description
This PR implements the missing secret byte accessors and constructors for
ecdh::SharedSecret. These additions allow the type to conform to thesecret_bytes_rtt_test!macro, ensuring consistent handling of shared secrets across the API.Changes
SharedSecret::as_secret_bytes: Provides a way to retrieve the underlying byte array of the secret.SharedSecret::from_secret_bytes: Enables manual construction of aSharedSecretfrom a known byte array.secret_rtt_btest caseChild #885
References #859