Skip to content
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

Merged
merged 3 commits into from
Jun 2, 2020

Conversation

alexmat2on
Copy link
Contributor

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 flag LIBURSA=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]

@MBoldyrev MBoldyrev force-pushed the feature/runtimecrypto branch from 8066d6d to 62ec017 Compare May 11, 2020 16:49
@MBoldyrev MBoldyrev requested a review from iceseer May 11, 2020 16:50
@MBoldyrev MBoldyrev added this to the 1.2 milestone May 11, 2020
@MBoldyrev MBoldyrev added the 1.x label May 11, 2020
@MBoldyrev MBoldyrev requested a review from lebdron May 11, 2020 16:51
Copy link
Contributor

@lebdron lebdron left a 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;
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

@lebdron lebdron left a 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?

alexmat2on and others added 2 commits June 1, 2020 08:32
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]>
@MBoldyrev MBoldyrev force-pushed the feature/runtimecrypto branch from 57ff160 to f3181fb Compare June 1, 2020 13:38
@lebdron lebdron merged commit 9394136 into hyperledger-iroha:master Jun 2, 2020
@nxsaken nxsaken added the iroha1 The legacy version of Iroha. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x iroha1 The legacy version of Iroha.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants