-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add cryptographic suite instantiation algorithm. #57
Merged
+329
−90
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f61e06b
Add suite selection algorithm.
msporny b7da944
Align Create Proof and Verify Proof for ecdsa-rdfc-2019 with DI.
msporny 69b6b45
Update Instantiate Cryptosuite algorithm.
msporny 94fd162
Update link to "data integrity cryptographic suite instance".
msporny 58cb3f2
Return an empty cryptosuite for invalid identifiers.
msporny 68e36b2
Use `proofConfig` instead of `proof`.
msporny e399b31
Align ecdsa-jcs-2019 create proof algorithm to new interface.
msporny 4d0bb8e
Align ecdsa-sd-2023 create proof algorithm to new interface.
msporny a994106
Align ecdsa-jcs-2019 verify proof algorithm to new interface.
msporny 3ad673c
Align ecdsa-sd-2023 verify proof algorithm to new interface.
msporny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that https://w3c.github.io/vc-data-integrity/#dfn-suite-selection-algorithm expects this to return "failure" for values it can't handle, rather than an empty suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The algorithm was updated to never return a failure. It either returns an empty cryptosuite instance (which doesn't have the functions set) or one that does. The error handling bits were removed to be out of scope in VC-DATA-INTEGRITY as well. This was largely done to simplify the algorithms. The algorithms in VC-DATA-INTEGRITY presume that they're handed a valid cryptosuite instance... if they're not, errors will be thrown. It's up to the implementations to decide how they handle empty cryptosuite instances.
IOW, this feels like implementation-specific stuff that we shouldn't have to spell out to implementers. Unless I'm missing something, I don't think we lose much if we don't return an error here. If you feel strongly about this, we can rework it so it generates an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you'll cause implementation divergence with this or make it significantly more difficult to read the spec, so it doesn't matter a lot, but pedantically, https://w3c.github.io/vc-data-integrity/#dfn-data-integrity-cryptographic-suite-instance doesn't admit the possibility that it could be empty. Both items are just "an algorithm that ..." rather than "null or an algorithm that ...". I think that's the right choice there, so to make the types work here, it'd be better to have this algorithm return a sentinel value instead of an "empty" cryptosuite. I used "failure", matching places like https://url.spec.whatwg.org/#concept-url-parser, but "null" would also work perfectly well. But again, this isn't super important.