Expose P-256 ECDSA crypto builtins#6222
Open
MauScheff wants to merge 6 commits intounisonweb:trunkfrom
Open
Conversation
a01ec38 to
41e6332
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
What does this change accomplish and why?
crypto.P256.publicKey.implcrypto.P256.signSha256.implcrypto.P256.verifySha256.implSHA-256, and verify signatures against message bytes.
Include "before and after" examples if appropriate. (You can copy/paste screenshots directly into this
editor.)
List any Github issues that this PR closes, in [closing-issues-using-keywords](https://help.github.com/
en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords) format.
Implementation approach and notes
This adds a small P-256 helper module in
unison-runtimebacked by the existing Haskell crypto dependencies.The change:
parser-typecheckerunison-runtimeForeign/Function.hsThe builtin surface uses raw byte-oriented formats:
r || sInteresting/controversial decisions
The main API choice here is the shape of the builtin surface.
I kept it narrow and curve-specific:
P256rather than a broader generic ECDSA surfaceThat keeps the initial surface small, but there may be follow-up discussion about whether this should stay
curve-specific or grow into a more general ECC API later.
Test coverage
Have you included tests (which could be a transcript) for this change, or is it somehow covered by
existing tests?
Would you recommend improving the test coverage (either as part of this PR or as a separate issue) or do
you think it’s adequate?
behavior.
If you only tested by hand, because that's all that's practical to do for this change, mention that.
Include screenshots.
Loose ends
Final checklist
make it descriptive of the change itself, which may be different from the initial motivation to make the
change.
.cabalfiles, make sure thepackage.yamlfiles are up-to-date instead.