Namespace: go.std.crypto.elliptic
v1.0Contents
Summary
Provides a lowlevel interface to the crypto/elliptic package.
Package elliptic implements several standard elliptic curves over prime
fields.
Index
 Curve
 CurveParams
 GenerateKey
 Marshal
 MarshalCompressed
 P224
 P256
 P384
 P521
 Unmarshal
 UnmarshalCompressed
 arrayOfCurve
 arrayOfCurveParams
 refToCurveParams
Legend

Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.
(None.)
Variables

(None.)
Functions, Macros, and Special Forms

GenerateKey
Function v1.0(GenerateKey curve rand)
GenerateKey returns a public/private key pair. The private key is
generated using the given reader, which must return random data.
Go input arguments: (curve Curve, rand io.Reader)
Go returns: (priv []byte, x *math/big.Int, y *math/big.Int, err error)
Joker input arguments: [^Curve curve, ^go.std.io/Reader rand]
Joker returns: [^arrayOfByte priv, ^go.std.math.big/refToInt x, ^go.std.math.big/refToInt y, ^Error err] 
Marshal
Function v1.0(Marshal curve x y)
Marshal converts a point on the curve into the uncompressed form specified in
section 4.3.6 of ANSI X9.62.
Go input arguments: (curve Curve, x *math/big.Int, y *math/big.Int)
Go returns: []byte
Joker input arguments: [^Curve curve, ^go.std.math.big/refToInt x, ^go.std.math.big/refToInt y]
Joker returns: ^arrayOfByte 
MarshalCompressed
Function v1.0(MarshalCompressed curve x y)
MarshalCompressed converts a point on the curve into the compressed form
specified in section 4.3.6 of ANSI X9.62.
Go input arguments: (curve Curve, x *math/big.Int, y *math/big.Int)
Go returns: []byte
Joker input arguments: [^Curve curve, ^go.std.math.big/refToInt x, ^go.std.math.big/refToInt y]
Joker returns: ^arrayOfByte 
P224
Function v1.0(P224)
P224 returns a Curve which implements P224 (see FIPS 1863, section D.2.2).
The cryptographic operations are implemented using constanttime algorithms.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve 
P256
Function v1.0(P256)
P256 returns a Curve which implements NIST P256 (FIPS 1863, section D.2.3),
also known as secp256r1 or prime256v1. The CurveParams.Name of this Curve is
"P256".
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 constanttime algorithms.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve 
P384
Function v1.0(P384)
P384 returns a Curve which implements NIST P384 (FIPS 1863, section D.2.4),
also known as secp384r1. The CurveParams.Name of this Curve is "P384".
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 constanttime algorithms.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve 
P521
Function v1.0(P521)
P521 returns a Curve which implements NIST P521 (FIPS 1863, section D.2.5),
also known as secp521r1. The CurveParams.Name of this Curve is "P521".
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 constanttime algorithms.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve 
Unmarshal
Function v1.0(Unmarshal curve data)
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.
Go input arguments: (curve Curve, data []byte)
Go returns: (x *math/big.Int, y *math/big.Int)
Joker input arguments: [^Curve curve, ^arrayOfByte data]
Joker returns: [^go.std.math.big/refToInt x, ^go.std.math.big/refToInt y] 
UnmarshalCompressed
Function v1.0(UnmarshalCompressed curve data)
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.
Go input arguments: (curve Curve, data []byte)
Go returns: (x *math/big.Int, y *math/big.Int)
Joker input arguments: [^Curve curve, ^arrayOfByte data]
Joker returns: [^go.std.math.big/refToInt x, ^go.std.math.big/refToInt y]
Types

Curve
Abstract Type v1.0A Curve represents a shortform 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.

Add
Method for Curve v1.0([x1 y1 x2 y2])
Add returns the sum of (x1,y1) and (x2,y2)

Double
Method for Curve v1.0([x1 y1])
Double returns 2*(x,y)

IsOnCurve
Method for Curve v1.0([x y])
IsOnCurve reports whether the given (x,y) lies on the curve.

Params
Method for Curve v1.0([])
Params returns the parameters for the curve.

ScalarBaseMult
Method for Curve v1.0([k])
ScalarBaseMult returns k*G, where G is the base point of the group
and k is an integer in bigendian form.

ScalarMult
Method for Curve v1.0([x1 y1 k])
ScalarMult returns k*(Bx,By) where k is a number in bigendian form.

CurveParams
Concrete Type v1.0CurveParams contains the parameters of an elliptic curve and also provides
a generic, nonconstant time implementation of Curve.

arrayOfCurve
Concrete Type v1.0A Curve represents a shortform 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.

arrayOfCurveParams
Concrete Type v1.0CurveParams contains the parameters of an elliptic curve and also provides
a generic, nonconstant time implementation of Curve.

refToCurveParams
Concrete Type v1.0CurveParams contains the parameters of an elliptic curve and also provides
a generic, nonconstant time implementation of Curve.

Add
Receiver for refToCurveParams v1.0([x1 y1 x2 y2])

Double
Receiver for refToCurveParams v1.0([x1 y1])

IsOnCurve
Receiver for refToCurveParams v1.0([x y])

Params
Receiver for refToCurveParams v1.0([])

ScalarBaseMult
Receiver for refToCurveParams v1.0([k])

ScalarMult
Receiver for refToCurveParams v1.0([Bx By k])