Documentation
¶
Index ¶
- func FlattenECPoints(in []*ECPoint) ([]*big.Int, error)
- func GenerateNTildei(rand io.Reader, safePrimes [2]*big.Int) (NTildei, h1i, h2i *big.Int, err error)
- type ECPoint
- func NewECPoint(curve elliptic.Curve, X, Y *big.Int) (*ECPoint, error)
- func NewECPointNoCurveCheck(curve elliptic.Curve, X, Y *big.Int) *ECPoint
- func ScalarBaseMult(curve elliptic.Curve, k *big.Int) *ECPoint
- func ScalarBaseMultChecked(curve elliptic.Curve, k *big.Int) (*ECPoint, error)
- func UnFlattenECPoints(curve elliptic.Curve, in []*big.Int, noCurveCheck ...bool) ([]*ECPoint, error)
- func (p *ECPoint) Add(p1 *ECPoint) (*ECPoint, error)
- func (p *ECPoint) Curve() elliptic.Curve
- func (p *ECPoint) EightInvEight() *ECPoint
- func (p *ECPoint) Equals(p2 *ECPoint) bool
- func (p *ECPoint) GobDecode(buf []byte) error
- func (p *ECPoint) GobEncode() ([]byte, error)
- func (p *ECPoint) IsOnCurve() bool
- func (p *ECPoint) MarshalJSON() ([]byte, error)
- func (p *ECPoint) ScalarMult(k *big.Int) *ECPoint
- func (p *ECPoint) ScalarMultChecked(k *big.Int) (*ECPoint, error)
- func (p *ECPoint) SetCurve(curve elliptic.Curve) *ECPoint
- func (p *ECPoint) ToECDSAPubKey() *ecdsa.PublicKey
- func (p *ECPoint) UnmarshalJSON(payload []byte) error
- func (p *ECPoint) ValidateBasic() bool
- func (p *ECPoint) X() *big.Int
- func (p *ECPoint) Y() *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ECPoint ¶
type ECPoint struct {
// contains filtered or unexported fields
}
ECPoint convenience helper
func NewECPoint ¶
Creates a new ECPoint and checks that the given coordinates are on the elliptic curve.
func NewECPointNoCurveCheck ¶
Creates a new ECPoint without checking that the coordinates are on the elliptic curve. Only use this function when you are completely sure that the point is already on the curve.
func ScalarBaseMult ¶
ScalarBaseMult multiplies the curve base point by k. Like ScalarMult it panics when the result is the point at infinity; prefer ScalarBaseMultChecked at sites that may receive a zero, order-multiple, or attacker-influenced scalar.
func ScalarBaseMultChecked ¶
ScalarBaseMultChecked multiplies the curve base point by k and returns an error, rather than panicking, when the result is the point at infinity (k ≡ 0 mod N).
func UnFlattenECPoints ¶
func (*ECPoint) EightInvEight ¶
func (*ECPoint) MarshalJSON ¶
crypto.ECPoint is not inherently json marshal-able
func (*ECPoint) ScalarMult ¶
ScalarMult multiplies the point by k. It panics if the result is the point at infinity (which is not a representable ECPoint on a short-Weierstrass curve). Retained for callers that have already established k cannot reduce to 0 mod the group order; prefer ScalarMultChecked at sites that may receive a zero, order-multiple, or otherwise attacker-influenced scalar.
func (*ECPoint) ScalarMultChecked ¶
ScalarMultChecked multiplies the point by k and returns an error, rather than panicking, when the result is the point at infinity. curve.ScalarMult yields the identity for k ≡ 0 mod N (a zero or order-multiple scalar); on a short-Weierstrass curve such as secp256k1 the identity encodes as (0,0), which is off-curve and so is rejected by NewECPoint. Callers that may pass such a scalar should use this variant and handle the error instead of crashing.