`package `**elliptic**
Import Path
crypto/elliptic* (on golang.org and go.dev)*
Dependency Relation
imports 3 packages, and imported by 3 packages
Involved Source Files
d-> elliptic.go
p224.go
p256_asm.go
p256_asm_amd64.s
Exported Type Names
type Curve **(interface)
A Curve represents a short-form Weierstrass curve with a=-3.
Note that the point at infinity (0, 0) is not considered on the curve, and
although it can be returned by Add, Double, ScalarMult, or ScalarBaseMult, it
can't be marshaled or unmarshaled, and IsOnCurve will return false for it.
(T) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
(T) Double(x1, y1 *big.Int) (x, y *big.Int)
(T) IsOnCurve(x, y *big.Int) bool
(T) Params() *CurveParams
(T) ScalarBaseMult(k []byte) (x, y *big.Int)
(T) ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int)
*CurveParams
crypto/ecdsa.PrivateKey
crypto/ecdsa.PublicKey
func P224() ****Curve**
func P256() **Curve**
func P384() **Curve**
func P521() **Curve**
func GenerateKey(curve **Curve**, rand io.Reader) (priv []byte, x, y *big.Int, err error)
func Marshal(curve **Curve**, x, y *big.Int) []byte
func MarshalCompressed(curve **Curve**, x, y *big.Int) []byte
func Unmarshal(curve **Curve**, data []byte) (x, y *big.Int)
func UnmarshalCompressed(curve **Curve**, data []byte) (x, y *big.Int)
func crypto/ecdsa.GenerateKey(c **Curve**, rand io.Reader) (*ecdsa.PrivateKey, error)
type CurveParams *(struct)*
CurveParams contains the parameters of an elliptic curve and also provides
a generic, non-constant time implementation of Curve.
B **big.Int*
BitSize *int*
Gx **big.Int*
Gy **big.Int*
N **big.Int*
Name *string*
P **big.Int*
(*T) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
(*T) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
(*T) IsOnCurve(x, y *big.Int) bool
(*T) Params() ***CurveParams**
(*T) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
(*T) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
*T : Curve
func Curve.Params() ***CurveParams**
func (*CurveParams).Params() ***CurveParams**
Exported Values
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 Golds v0.1.6-preview. (GOOS=linux 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. |