Namespace: go.std.crypto.elliptic
v1.0Contents
Summary
Provides a low-level interface to the crypto/elliptic package.
Package elliptic implements the standard NIST P-224, P-256, P-384, and P-521
elliptic curves over prime fields.
Index
- *CurveParams
- Curve
- CurveParams
- GenerateKey
- Marshal
- MarshalCompressed
- P224
- P256
- P384
- P521
- Unmarshal
- UnmarshalCompressed
- arrayOfCurve
- arrayOfCurveParams
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/*Int x, ^go.std.math.big/*Int y, ^Error err] -
Marshal
Function v1.0(Marshal curve x y)
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.
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/*Int x, ^go.std.math.big/*Int 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 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.
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/*Int x, ^go.std.math.big/*Int y]
Joker returns: ^arrayOfByte -
P224
Function v1.0(P224)
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.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve -
P256
Function v1.0(P256)
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.
ScalarMult and ScalarBaseMult are implemented using constant-time algorithms.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve -
P384
Function v1.0(P384)
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.
Go returns: Curve
Joker input arguments: []
Joker returns: ^Curve -
P521
Function v1.0(P521)
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.
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, is not on the curve, or is
the point at infinity. 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/*Int x, ^go.std.math.big/*Int 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, is not
on the curve, or is the point at infinity. 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/*Int x, ^go.std.math.big/*Int y]
Types
-
*CurveParams
Concrete Type v1.0CurveParams contains the parameters of an elliptic curve and also provides
a generic, non-constant time implementation of Curve.
-
Add
Receiver for *CurveParams v1.0([x1 y1 x2 y2])
-
Double
Receiver for *CurveParams v1.0([x1 y1])
-
IsOnCurve
Receiver for *CurveParams v1.0([x y])
-
Params
Receiver for *CurveParams v1.0([])
-
ScalarBaseMult
Receiver for *CurveParams v1.0([k])
-
ScalarMult
Receiver for *CurveParams v1.0([Bx By k])
-
Curve
Abstract Type v1.0A Curve represents a short-form Weierstrass curve with a=-3.
The behavior of Add, Double, and ScalarMult when the input is not a point on
the curve is undefined.
Note that the conventional point at infinity (0, 0) is not considered on the
curve, although it can be returned by Add, Double, ScalarMult, or
ScalarBaseMult (but not the Unmarshal or UnmarshalCompressed functions).
-
Add
Method for Curve v1.0([x1 y1 x2 y2])
-
Double
Method for Curve v1.0([x1 y1])
-
IsOnCurve
Method for Curve v1.0([x y])
-
Params
Method for Curve v1.0([])
-
ScalarBaseMult
Method for Curve v1.0([k])
-
ScalarMult
Method for Curve v1.0([x1 y1 k])
-
CurveParams
Concrete Type v1.0CurveParams contains the parameters of an elliptic curve and also provides
a generic, non-constant time implementation of Curve.
-
arrayOfCurve
Concrete Type v1.0A Curve represents a short-form Weierstrass curve with a=-3.
The behavior of Add, Double, and ScalarMult when the input is not a point on
the curve is undefined.
Note that the conventional point at infinity (0, 0) is not considered on the
curve, although it can be returned by Add, Double, ScalarMult, or
ScalarBaseMult (but not the Unmarshal or UnmarshalCompressed functions).
-
arrayOfCurveParams
Concrete Type v1.0CurveParams contains the parameters of an elliptic curve and also provides
a generic, non-constant time implementation of Curve.