Add fully specified algorithms - #225
kentakayama wants to merge 12 commits into
Conversation
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
…ecting one Algorithm for a Curve Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
…elated issues Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
|
Can any of the others reviewers have a look if we can merge this? |
thomas-fossati
left a comment
There was a problem hiding this comment.
LGTM, thanks very much!
I have flagged a couple of minor things and a slightly more important missing condition.
There was a problem hiding this comment.
shouldn't this accept AlgorithmEd25519EdDSA?
| } | ||
| return fmt.Errorf( | ||
| "found algorithm %q (expected %q)", | ||
| "found algorithm %q (expected one of {%q})", |
There was a problem hiding this comment.
I suspect this would not format the list in the way you wanted ;-)
| return nil | ||
| } | ||
|
|
||
| func containsAlg(algs []Algorithm, target Algorithm) bool { |
There was a problem hiding this comment.
I believe there is no need to define our own function; we could just use the slices.Contains here.
| // As stated in RFC 8152 section 8.2, only the pure EdDSA version is | ||
| // used for COSE. |
There was a problem hiding this comment.
I've resolved these 4 review comments in 80e06c3 .
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
Signed-off-by: Ken Takayama <ken.takayama.ietf@gmail.com>
|
I added five follow-up commits to improve the implementation and test coverage for the fully specified algorithms. The main changes are:
The other two commits are small preparatory cleanups:
All tests, including the race detector, pass after these changes. |
|
Tested this PR against Ed25519 (-19) COSE_Sign1 records produced by a different implementation (TypeScript, not go-cose): six decision records from verax-ai/verax, signed with
The suite also passes here on Go 1.21.13 and 1.22.12. Thanks for carrying this. |
Resolve #224 based on the Option A.
Key modifications are:
AlgorithmESP256,AlgorithmESP384,AlgorithmESP512andAlgorithmEd25519EdDSAare addedalgfield, and it is returned inAlgorithm()deriveAlgorithmis changed toderiveAlgorithms, now it returns the slice of possibleAlgorithms (at least one Algorithm is included for better error handling)