bign

package
v1.0.4020 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P256Point

type P256Point struct {
	// contains filtered or unexported fields
}

P256Point is a P256 point. The zero value is NOT valid.

func NewP256Point

func NewP256Point() *P256Point

NewP256Point returns a new P256Point representing the point at infinity point.

func (*P256Point) Add

func (q *P256Point) Add(p1, p2 *P256Point) *P256Point

Add sets q = p1 + p2, and returns q. The points may overlap.

func (*P256Point) Bytes

func (p *P256Point) Bytes() []byte

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 (*P256Point) BytesCompressed

func (p *P256Point) BytesCompressed() []byte

BytesCompressed returns the compressed 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 (*P256Point) BytesX

func (p *P256Point) BytesX() ([]byte, error)

BytesX returns the encoding of the x-coordinate of p, as specified in SEC 1, Version 2.0, Section 2.3.5, or an error if p is the point at infinity.

func (*P256Point) Double

func (q *P256Point) Double(p *P256Point) *P256Point

Double sets q = p + p, and returns q. The points may overlap.

func (*P256Point) ScalarBaseMult

func (p *P256Point) ScalarBaseMult(scalar []byte) (*P256Point, error)

ScalarBaseMult sets p = scalar * B, where B is the canonical generator, and returns p.

func (*P256Point) ScalarMult

func (p *P256Point) ScalarMult(q *P256Point, scalar []byte) (*P256Point, error)

ScalarMult sets p = scalar * q, and returns p.

func (*P256Point) Select

func (q *P256Point) Select(p1, p2 *P256Point, cond int) *P256Point

Select sets q to p1 if cond == 1, and to p2 if cond == 0.

func (*P256Point) Set

func (p *P256Point) Set(q *P256Point) *P256Point

Set sets p = q and returns p.

func (*P256Point) SetBytes

func (p *P256Point) SetBytes(b []byte) (*P256Point, error)

SetBytes sets p to the compressed, uncompressed, or infinity value encoded in b, as specified in SEC 1, Version 2.0, Section 2.3.4. If the point is not on the curve, it returns nil and an error, and the receiver is unchanged. Otherwise, it returns p.

func (*P256Point) SetGenerator

func (p *P256Point) SetGenerator() *P256Point

SetGenerator sets p to the canonical generator and returns p.

type P384Point

type P384Point struct {
	// contains filtered or unexported fields
}

P384Point is a P384 point. The zero value is NOT valid.

func NewP384Point

func NewP384Point() *P384Point

NewP384Point returns a new P384Point representing the point at infinity point.

func (*P384Point) Add

func (q *P384Point) Add(p1, p2 *P384Point) *P384Point

Add sets q = p1 + p2, and returns q. The points may overlap.

func (*P384Point) Bytes

func (p *P384Point) Bytes() []byte

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) BytesCompressed

func (p *P384Point) BytesCompressed() []byte

BytesCompressed returns the compressed 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) BytesX

func (p *P384Point) BytesX() ([]byte, error)

BytesX returns the encoding of the x-coordinate of p, as specified in SEC 1, Version 2.0, Section 2.3.5, or an error if p is the point at infinity.

func (*P384Point) Double

func (q *P384Point) Double(p *P384Point) *P384Point

Double sets q = p + p, and returns q. The points may overlap.

func (*P384Point) ScalarBaseMult

func (p *P384Point) ScalarBaseMult(scalar []byte) (*P384Point, error)

ScalarBaseMult sets p = scalar * B, where B is the canonical generator, and returns p.

func (*P384Point) ScalarMult

func (p *P384Point) ScalarMult(q *P384Point, scalar []byte) (*P384Point, error)

ScalarMult sets p = scalar * q, and returns p.

func (*P384Point) Select

func (q *P384Point) Select(p1, p2 *P384Point, cond int) *P384Point

Select sets q to p1 if cond == 1, and to p2 if cond == 0.

func (*P384Point) Set

func (p *P384Point) Set(q *P384Point) *P384Point

Set sets p = q and returns p.

func (*P384Point) SetBytes

func (p *P384Point) SetBytes(b []byte) (*P384Point, error)

SetBytes sets p to the compressed, uncompressed, or infinity value encoded in b, as specified in SEC 1, Version 2.0, Section 2.3.4. If the point is not on the curve, it returns nil and an error, and the receiver is unchanged. Otherwise, it returns p.

func (*P384Point) SetGenerator

func (p *P384Point) SetGenerator() *P384Point

SetGenerator sets p to the canonical generator and returns p.

type P512Point

type P512Point struct {
	// contains filtered or unexported fields
}

P512Point is a P512 point. The zero value is NOT valid.

func NewP512Point

func NewP512Point() *P512Point

NewP512Point returns a new P512Point representing the point at infinity point.

func (*P512Point) Add

func (q *P512Point) Add(p1, p2 *P512Point) *P512Point

Add sets q = p1 + p2, and returns q. The points may overlap.

func (*P512Point) Bytes

func (p *P512Point) Bytes() []byte

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 (*P512Point) BytesCompressed

func (p *P512Point) BytesCompressed() []byte

BytesCompressed returns the compressed 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 (*P512Point) BytesX

func (p *P512Point) BytesX() ([]byte, error)

BytesX returns the encoding of the x-coordinate of p, as specified in SEC 1, Version 2.0, Section 2.3.5, or an error if p is the point at infinity.

func (*P512Point) Double

func (q *P512Point) Double(p *P512Point) *P512Point

Double sets q = p + p, and returns q. The points may overlap.

func (*P512Point) ScalarBaseMult

func (p *P512Point) ScalarBaseMult(scalar []byte) (*P512Point, error)

ScalarBaseMult sets p = scalar * B, where B is the canonical generator, and returns p.

func (*P512Point) ScalarMult

func (p *P512Point) ScalarMult(q *P512Point, scalar []byte) (*P512Point, error)

ScalarMult sets p = scalar * q, and returns p.

func (*P512Point) Select

func (q *P512Point) Select(p1, p2 *P512Point, cond int) *P512Point

Select sets q to p1 if cond == 1, and to p2 if cond == 0.

func (*P512Point) Set

func (p *P512Point) Set(q *P512Point) *P512Point

Set sets p = q and returns p.

func (*P512Point) SetBytes

func (p *P512Point) SetBytes(b []byte) (*P512Point, error)

SetBytes sets p to the compressed, uncompressed, or infinity value encoded in b, as specified in SEC 1, Version 2.0, Section 2.3.4. If the point is not on the curve, it returns nil and an error, and the receiver is unchanged. Otherwise, it returns p.

func (*P512Point) SetGenerator

func (p *P512Point) SetGenerator() *P512Point

SetGenerator sets p to the canonical generator and returns p.

Directories

Path Synopsis
Code generated by generate.go.
Code generated by generate.go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL