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

BytesKeyEC2: Prepare curve validation #328

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chrysn
Copy link
Collaborator

@chrysn chrysn commented Nov 27, 2024

Contributes-To: #93

A first step is to go from a type alias (which the enum CredentialKey can make no guarantees on, because pub enum variant members are always pub) into a newtype.

This is a breaking API change, so maybe we should prioritize doing the API change even when we can't validate, but this will need a bit more than this single commit.

@chrysn
Copy link
Collaborator Author

chrysn commented Nov 27, 2024

Open points:

  • I'd consider shedding a few derived traits:

    • PartialEq is necessary because CredentialKey has it too. Is this relevant outside of testing? (Doesn't hurt too much, either).
    • I'm conflicted about the try-from-slice -- it's convenient transitionally because most creation happened from slices anyway, but … dunno.
  • How do we do the verification? When the type is created, that's typically far down in the parsing step, and we don't have access to a Cryptography.

@chrysn
Copy link
Collaborator Author

chrysn commented Nov 27, 2024

More precise open question: Should we even be doing this on BytesKeyEC2, or should that not be BytesP256ElemLen that would become a coordinate type?

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.

1 participant