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

KeyPair::new invariant check #2121

Closed
mversic opened this issue Apr 19, 2022 · 0 comments
Closed

KeyPair::new invariant check #2121

mversic opened this issue Apr 19, 2022 · 0 comments
Assignees
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@mversic
Copy link
Contributor

mversic commented Apr 19, 2022

When constructing a new KeyPair out of public and private key, it is not verified that the keys actually make a pair, i.e. the given public key doesn't have to correspond with the given private key. The KeyPair::new method should check that this invariant is maintained by the KeyPair container. I would suggest that this can be done by signing some dummy payload with the private key and verifying the signature with the public key. Performance of this check is not of big consideration because this constructor is rarely used and most often cached in the application

@mversic mversic added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Apr 19, 2022
@mversic mversic self-assigned this Apr 19, 2022
mversic added a commit to mversic/iroha that referenced this issue May 2, 2022
…cted (hyperledger-iroha#2130)

Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…cted (hyperledger-iroha#2130)

Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic added a commit to mversic/iroha that referenced this issue May 13, 2022
…cted (hyperledger-iroha#2130)

Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

2 participants