-
Notifications
You must be signed in to change notification settings - Fork 277
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
Use the crypto provider corresponding to public key type during runtime #315
Use the crypto provider corresponding to public key type during runtime #315
Conversation
8066d6d
to
62ec017
Compare
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.
template <typename Container> | ||
inline auto hexstringToBytestringSize(Container const &c) | ||
-> decltype(c.size()) { | ||
return (c.size() + 1) / 2; |
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.
I wonder if strings with odd size were encountered somewhere
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.
I would prefere general logic where it is cheap.
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.
Should we replace shared_model::crypto::CryptoModelSigner<CurrentCryptoProvider> signer
in crypto_usage_test.cpp
with shared_model::crypto::CryptoSigner
?
use the correct crypto provider during runtime, depending on public key type Signed-off-by: Alexander Matson <[email protected]> Signed-off-by: Mikhail Boldyrev <[email protected]>
Signed-off-by: Mikhail Boldyrev <[email protected]>
57ff160
to
f3181fb
Compare
Description of the Change
Note: This PR is based on the changes in #263, so that should be reviewed before this one.
This change modifies the
CryptoSigner
to run the correct signing implementation, depending on the input public key type.KeysManagerImpl
also had to be changed so it can correctly load both ursa-keys and iroha-keys from files, depending only on the imported public key. This also assumes Iroha is compiled with the build flagLIBURSA=ON
.Benefits
During runtime, Iroha can correctly load ursa-generated keys or iroha-generated keys from files, and use them to sign and verify blocks.
Possible Drawbacks
None
Usage Examples or Tests [optional]
Alternate Designs [optional]