Skip to content

BytesKeyEC2: Prepare curve validation#328

Draft
chrysn wants to merge 2 commits intolake-rs:mainfrom
chrysn-pull-requests:validate-points
Draft

BytesKeyEC2: Prepare curve validation#328
chrysn wants to merge 2 commits intolake-rs:mainfrom
chrysn-pull-requests:validate-points

Conversation

@chrysn
Copy link
Member

@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
Member 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
Member 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