-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update custom algorithms example #209
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Orie Steele <[email protected]>
d153ce2
to
223b104
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #209 +/- ##
==========================================
- Coverage 92.35% 91.27% -1.09%
==========================================
Files 12 12
Lines 1622 2005 +383
==========================================
+ Hits 1498 1830 +332
- Misses 68 119 +51
Partials 56 56 ☔ View full report in Codecov by Sentry. |
Thanks @OR13, |
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.
awesome!
I left a couple of typo notes inline.
verify_error := sign1.Verify(nil, verifier) | ||
|
||
if verify_error != nil { |
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.
usual golang typo conventions
verify_error := sign1.Verify(nil, verifier) | |
if verify_error != nil { | |
verifyError := sign1.Verify(nil, verifier) | |
if verifyError != nil { |
if verify_error != nil { | ||
t.Fatalf("Verification failed") | ||
} else { | ||
// fmt.Println(cbor.Diagnose(signature)) |
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.
This is a beauty, isn't it?
var payload = []byte("hello post quantum signatures") | ||
signature, _ := cose.Sign1(nil, ks, headers, payload, nil) | ||
var sign1 cose.Sign1Message | ||
sign1.UnmarshalCBOR(signature) |
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.
maybe ignore error
more explicitly:
sign1.UnmarshalCBOR(signature) | |
_ = sign1.UnmarshalCBOR(signature) |
This pull request updates the readme section describing custom algorithms, and provides an example test.
The current instructions in this section are not very helpful:
https://github.com/search?q=repo%3Averaison%2Fgo-cose%20RegisterAlgorithm&type=code