type Curve … var mask … // GenerateKey returns a public/private key pair. The private key is // generated using the given reader, which must return random data. // // Deprecated: for ECDH, use the GenerateKey methods of the [crypto/ecdh] package; // for ECDSA, use the GenerateKey function of the crypto/ecdsa package. func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error) { … } // Marshal converts a point on the curve into the uncompressed form specified in // SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is // the conventional point at infinity), the behavior is undefined. // // Deprecated: for ECDH, use the crypto/ecdh package. This function returns an // encoding equivalent to that of PublicKey.Bytes in crypto/ecdh. func Marshal(curve Curve, x, y *big.Int) []byte { … } // MarshalCompressed converts a point on the curve into the compressed form // specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the // curve (or is the conventional point at infinity), the behavior is undefined. func MarshalCompressed(curve Curve, x, y *big.Int) []byte { … } type unmarshaler … var _ … // Unmarshal converts a point, serialized by [Marshal], into an x, y pair. It is // an error if the point is not in uncompressed form, is not on the curve, or is // the point at infinity. On error, x = nil. // // Deprecated: for ECDH, use the crypto/ecdh package. This function accepts an // encoding equivalent to that of the NewPublicKey methods in crypto/ecdh. func Unmarshal(curve Curve, data []byte) (x, y *big.Int) { … } // UnmarshalCompressed converts a point, serialized by [MarshalCompressed], into // an x, y pair. It is an error if the point is not in compressed form, is not // on the curve, or is the point at infinity. On error, x = nil. func UnmarshalCompressed(curve Curve, data []byte) (x, y *big.Int) { … } func panicIfNotOnCurve(curve Curve, x, y *big.Int) { … } var initonce … func initAll() { … } // P224 returns a [Curve] which implements NIST P-224 (FIPS 186-3, section D.2.2), // also known as secp224r1. The CurveParams.Name of this [Curve] is "P-224". // // Multiple invocations of this function will return the same value, so it can // be used for equality checks and switch statements. // // The cryptographic operations are implemented using constant-time algorithms. func P224() Curve { … } // P256 returns a [Curve] which implements NIST P-256 (FIPS 186-3, section D.2.3), // also known as secp256r1 or prime256v1. The CurveParams.Name of this [Curve] is // "P-256". // // Multiple invocations of this function will return the same value, so it can // be used for equality checks and switch statements. // // The cryptographic operations are implemented using constant-time algorithms. func P256() Curve { … } // P384 returns a [Curve] which implements NIST P-384 (FIPS 186-3, section D.2.4), // also known as secp384r1. The CurveParams.Name of this [Curve] is "P-384". // // Multiple invocations of this function will return the same value, so it can // be used for equality checks and switch statements. // // The cryptographic operations are implemented using constant-time algorithms. func P384() Curve { … } // P521 returns a [Curve] which implements NIST P-521 (FIPS 186-3, section D.2.5), // also known as secp521r1. The CurveParams.Name of this [Curve] is "P-521". // // Multiple invocations of this function will return the same value, so it can // be used for equality checks and switch statements. // // The cryptographic operations are implemented using constant-time algorithms. func P521() Curve { … }