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/elliptic: document what the "canonical names" for curves are #34193

Closed
mdempsky opened this issue Sep 9, 2019 · 1 comment
Closed
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

mdempsky commented Sep 9, 2019

I needed to write code to distinguish whether a pk *ecdsa.PublicKey refers to a point on P-256, P-384, P-521, or some other curve. It looks like the proper way to do this is to switch on pk.Curve().Name, which provides "the canonical name of the curve". (Aside: If this is not the best way to do this, please let me know.)

However, I'm aware of many possible "canonical" names for P-256; for example, "P256" (the package elliptic function name), "P-256" (what package elliptic's documentation calls it), "Curve P-256" (what FIPS 186-3 calls it), "NIST P256" (what the TCG Algorithm Registry calls it), "prime256v1" (what RFC 3279 calls it), "secp256r1" (what RFC 5480 calls it), "nistp256" (what RFC 5656 calls it), etc.

I had to inspect package elliptic's source to figure out what to expect pk.Curve().Name to return.

/cc @agl @FiloSottile

@FiloSottile FiloSottile added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 9, 2019
@FiloSottile FiloSottile added this to the Go1.14 milestone Sep 9, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@gopherbot
Copy link

Change https://golang.org/cl/218921 mentions this issue: crypto/elliptic: document the Name and names of each curve

@golang golang locked and limited conversation to collaborators Feb 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants