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

crypto/ecdsa: Expose ecdsaSignature class #18520

Closed
stevenroose opened this issue Jan 5, 2017 · 1 comment
Closed

crypto/ecdsa: Expose ecdsaSignature class #18520

stevenroose opened this issue Jan 5, 2017 · 1 comment

Comments

@stevenroose
Copy link

Currently the ecdsa.Sign method returns the r and s values. However, there is a struct for the signature

type ecdsaSignature struct {
	R, S *big.Int
}

Verification of a signature also requires these two values. However, signatures are usually communicated as byte strings, being the ASN.1 encoded form of both these values in a SEQUENCE. This is exactly what the ecdsaSignature struct provides.

So it would be a lot more convenient to have this struct provided by the library instead of individual implementations having to define this struct themselves, making their structs incompatible with other people's code.

So, the suggestion I put forward is expose the struct as EcdsaSignature and alter the ecdsa.Sign and ecdsa.Verify methods to not take r and s as arguments, but an EcdsaSignature.

@bradfitz
Copy link
Contributor

bradfitz commented Jan 5, 2017

Sorry, but for better or worse, https://golang.org/doc/go1compat precludes changing the API at this point.

@bradfitz bradfitz closed this as completed Jan 5, 2017
@golang golang locked and limited conversation to collaborators Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants