func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error)
GenerateKey returns a public/private key pair. The private key is
generated using the given reader, which must return random data.
func Marshal(curve Curve, x, y *big.Int) []byte
Marshal converts a point on the curve into the uncompressed form specified in
section 4.3.6 of ANSI X9.62.
func MarshalCompressed(curve Curve, x, y *big.Int) []byte
MarshalCompressed converts a point on the curve into the compressed form
specified in section 4.3.6 of ANSI X9.62.
func P224() Curve
P224 returns a Curve which implements P-224 (see FIPS 186-3, section D.2.2).
The cryptographic operations are implemented using constant-time algorithms.
func P256() 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 P384() 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 do not use constant-time algorithms.
func P521() 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 do not use constant-time algorithms.
func Unmarshal(curve Curve, data []byte) (x, y *big.Int)
Unmarshal converts a point, serialized by Marshal, into an x, y pair.
It is an error if the point is not in uncompressed form or is not on the curve.
On error, x = nil.
func UnmarshalCompressed(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 or is not on the curve.
On error, x = nil.
The pages are generated with Goldsv0.1.6. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.