Aptos HSM Signer Testing - #974
Open
mzabaluev wants to merge 7 commits into
Open
Conversation
Provide From conversion impls to construct PrivateKey and Signature from byte arrays. The conversions into PrivateKey are fallible, while a Signature is allowed to be constructed from any 64 bytes.
Add TestSigner providing an in-process Signing implementation for tests.
mzabaluev
force-pushed
the
mikhail/test-signer
branch
from
December 20, 2024 19:13
da28333 to
53e08b7
Compare
TryFromBytes is not needed, neither is the public key as a member of HashiCorpVault state.
mzabaluev
marked this pull request as ready for review
December 23, 2024 11:07
mzabaluev
requested review from
0xmovses,
l-monninger and
musitdev
as code owners
December 23, 2024 11:07
musitdev
reviewed
Dec 23, 2024
| /// Errors that occur when parsing signature or key material from byte sequences. | ||
| #[derive(Debug, thiserror::Error)] | ||
| #[error(transparent)] | ||
| pub struct CryptoMaterialError(Box<dyn Error + Send + Sync>); |
Contributor
There was a problem hiding this comment.
I think it will be easier to have one error type for the crate. It avoids adding map_err every time when you need to extract the publickey from an u8 array, for example, and it eases the error management for external crate.
There's a reason you didn't add a new variant to the SignerError. Perhaps we need to rename it in a more generic name?
Contributor
Author
There was a problem hiding this comment.
I don't like using the "fat" main error type for the much slimmer use case of TryFrom conversions.
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.
Summary
util.Add a movement-signer-test crate, providing a local
TestSigner, initially for the Ed25519 curve.Changelog
Testing
Added a test verifying basic functionality of
TestSignerin the movement-signer-test crate.