crypto/elliptic: document what the "canonical names" for curves are #34193
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
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 onpk.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
The text was updated successfully, but these errors were encountered: