Skip to content
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 ability to swap crypto implementation #100

Closed
shizhMSFT opened this issue Aug 18, 2022 · 0 comments · Fixed by #101
Closed

Add ability to swap crypto implementation #100

shizhMSFT opened this issue Aug 18, 2022 · 0 comments · Fixed by #101
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@shizhMSFT
Copy link
Contributor

The v1.0.0-rc.1 version of go-cose computes the digest of CBOR-encoded signature structure using the golang built-in hash implementations regardless of the implementation of Signer and Verifier.

If someone wants to change the implementation of golang built-in crypto packages (e.g. use openssl based implementation) just for go-cose, they can only change for Signer and Verifier but not the hash implementations.

Proposal: Instead of passing digest to Sign() and Verify(), we should pass content (i.e. raw payload). Thus it matches RFC 8152 section 8.

The signature functions for this scheme are:

  signature = Sign(message content, key)

  valid = Verification(message content, key, signature)

It also addresses the weird case that Ed25519 passes CBOR-encoded signature structure instead of digest to Signer as Ed25519 requires the content to be processed twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants