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

Andrews pop version #7

Open
wants to merge 13 commits into
base: skalman--proof-of-possession-for-all-cryptos
Choose a base branch
from

Conversation

coax1d
Copy link

@coax1d coax1d commented Nov 15, 2024

βœ„ -----------------------------------------------------------------------------

Thank you for your Pull Request! πŸ™ Please make sure it follows the contribution guidelines outlined in this
document
and fill out the
sections below. Once you're ready to submit your PR for review, please delete this section and leave only the text under
the "Description" heading.

Description

A concise description of what your PR is doing, and what potential issue it is solving. Use Github semantic
linking

to link the PR to an issue that must be closed once this is merged.

Integration

In depth notes about how this PR should be integrated by downstream projects. This part is mandatory, and should be
reviewed by reviewers, if the PR does NOT have the R0-Silent label. In case of a R0-Silent, it can be ignored.

Review Notes

In depth notes about the implementation details of your PR. This should be the main guide for reviewers to
understand your approach and effectively review it. If too long, use
<details>
.

Imagine that someone who is depending on the old code wants to integrate your new code and the only information that
they get is this section. It helps to include example usage and default value here, with a diff code-block to show
possibly integration.

Include your leftover TODOs, if any, here.

Checklist

  • My PR includes a detailed description as outlined in the "Description" and its two subsections above.
  • My PR follows the labeling requirements of this project (at minimum one label for T required)
    • External contributors: ask maintainers to put the right label on your PR.
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

You can remove the "Checklist" section once all have been checked. Thank you for your contribution!

βœ„ -----------------------------------------------------------------------------

@coax1d coax1d marked this pull request as ready for review November 21, 2024 08:26
@coax1d
Copy link
Author

coax1d commented Nov 21, 2024

All issues should be handled from check list from the following issue:

https://github.com/orgs/w3f/projects/29/views/1?pane=issue&itemId=70641639&issue=w3f%7Csubstrate%7C18

Bandersnatch left empty let me know if this is ok for now..

@drskalman drskalman self-requested a review November 26, 2024 13:29
Copy link
Collaborator

@drskalman drskalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

/// Dummy implementation. Returns `None`.
fn sign<M: AsRef<[u8]>>(&self, _key_type: KeyTypeId, _msg: &M) -> Option<Self::Signature> {
None
fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll comment on the other pull request to ask @davxy if it is ok to add these given that we are not adding a new host function.

sp_io::crypto::ecdsa_sign(key_type, self, pop_statement.as_slice())
}

fn verify_pop(&self, pop: &Self::Signature) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because they haven't use AppPair::verify for signature verification, perhaps we follow the same path and call ecdsa_verify here.

sp_io::crypto::ed25519_sign(key_type, self, pop_statement.as_slice())
}

fn verify_pop(&self, pop: &Self::Signature) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here calling into sp_io directly.

@@ -135,6 +135,14 @@ impl sp_application_crypto::RuntimeAppPublic for UintAuthorityId {
traits::Verify::verify(signature, msg.as_ref(), &self.0)
}

fn generate_pop(&mut self) -> Option<Self::Signature> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we add a gen and verify test for PoP in primitive/runtime/src/lib.rs for all crypto types.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I looked into this and imo it isnt really making sense to do these tests there. All that will be tested is the generate_pop and verify_pop from sp_core::crypto (Which already these functions have unit tests for) For instance other unit tests with respect to other crypto stuff is like a MultiSignature for ecdsa and a few other non-crypto related things. Perhaps we should look for somewhere else to add some tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants