Documentation ¶
Overview ¶
Package nistec implements the NIST P elliptic curves from FIPS 186-4.
This package uses fiat-crypto for its backend field arithmetic (not math/big) and exposes constant-time, heap allocation-free, byte slice-based safe APIs. Group operations use modern and safe complete addition formulas. The point at infinity is handled and encoded according to SEC 1, Version 2.0, and invalid curve points can't be represented.
Index ¶
- type P224Point
- func (q *P224Point) Add(p1, p2 *P224Point) *P224Point
- func (p *P224Point) Bytes() []byte
- func (q *P224Point) Double(p *P224Point) *P224Point
- func (p *P224Point) ScalarMult(q *P224Point, scalar []byte) *P224Point
- func (q *P224Point) Select(p1, p2 *P224Point, cond int) *P224Point
- func (p *P224Point) Set(q *P224Point) *P224Point
- func (p *P224Point) SetBytes(b []byte) (*P224Point, error)
- type P384Point
- func (q *P384Point) Add(p1, p2 *P384Point) *P384Point
- func (p *P384Point) Bytes() []byte
- func (q *P384Point) Double(p *P384Point) *P384Point
- func (p *P384Point) ScalarMult(q *P384Point, scalar []byte) *P384Point
- func (q *P384Point) Select(p1, p2 *P384Point, cond int) *P384Point
- func (p *P384Point) Set(q *P384Point) *P384Point
- func (p *P384Point) SetBytes(b []byte) (*P384Point, error)
- type P521Point
- func (q *P521Point) Add(p1, p2 *P521Point) *P521Point
- func (p *P521Point) Bytes() []byte
- func (q *P521Point) Double(p *P521Point) *P521Point
- func (p *P521Point) ScalarMult(q *P521Point, scalar []byte) *P521Point
- func (q *P521Point) Select(p1, p2 *P521Point, cond int) *P521Point
- func (p *P521Point) Set(q *P521Point) *P521Point
- func (p *P521Point) SetBytes(b []byte) (*P521Point, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type P224Point ¶
type P224Point struct {
// contains filtered or unexported fields
}
P224Point is a P-224 point. The zero value is NOT valid.
func NewP224Generator ¶
func NewP224Generator() *P224Point
NewP224Generator returns a new P224Point set to the canonical generator.
func NewP224Point ¶
func NewP224Point() *P224Point
NewP224Point returns a new P224Point representing the point at infinity point.
func (*P224Point) Bytes ¶
Bytes returns the uncompressed or infinity encoding of p, as specified in SEC 1, Version 2.0, Section 2.3.3. Note that the encoding of the point at infinity is shorter than all other encodings.
func (*P224Point) ScalarMult ¶
ScalarMult sets p = scalar * q, and returns p.
type P384Point ¶
type P384Point struct {
// contains filtered or unexported fields
}
P384Point is a P-384 point. The zero value is NOT valid.
func NewP384Generator ¶
func NewP384Generator() *P384Point
NewP384Generator returns a new P384Point set to the canonical generator.
func NewP384Point ¶
func NewP384Point() *P384Point
NewP384Point returns a new P384Point representing the point at infinity point.
func (*P384Point) Bytes ¶
Bytes returns the uncompressed or infinity encoding of p, as specified in SEC 1, Version 2.0, Section 2.3.3. Note that the encoding of the point at infinity is shorter than all other encodings.
func (*P384Point) ScalarMult ¶
ScalarMult sets p = scalar * q, and returns p.
type P521Point ¶
type P521Point struct {
// contains filtered or unexported fields
}
P521Point is a P-521 point. The zero value is NOT valid.
func NewP521Generator ¶
func NewP521Generator() *P521Point
NewP521Generator returns a new P521Point set to the canonical generator.
func NewP521Point ¶
func NewP521Point() *P521Point
NewP521Point returns a new P521Point representing the point at infinity point.
func (*P521Point) Bytes ¶
Bytes returns the uncompressed or infinity encoding of p, as specified in SEC 1, Version 2.0, Section 2.3.3. Note that the encoding of the point at infinity is shorter than all other encodings.
func (*P521Point) ScalarMult ¶
ScalarMult sets p = scalar * q, and returns p.