Documentation ¶
Overview ¶
Package other wraps an hash-to-curve implementation and exposes functions for operations on points and scalars.
Package other wraps an hash-to-curve implementation and exposes functions for operations on points and scalars.
Package other wraps an hash-to-curve implementation and exposes functions for operations on points and scalars.
Package other wraps an hash-to-curve implementation and exposes functions for operations on points and scalars.
Package other wraps an hash-to-curve implementation and exposes functions for operations on points and scalars.
Package other wraps an hash-to-curve implementation and exposes functions for operations on points and scalars.
Index ¶
- type Hash2Curve
- func (h *Hash2Curve) Base() internal.Point
- func (h *Hash2Curve) ElementLength() int
- func (h *Hash2Curve) HashToGroup(input, dst []byte) internal.Point
- func (h *Hash2Curve) HashToScalar(input, dst []byte) internal.Scalar
- func (h *Hash2Curve) Identity() internal.Point
- func (h *Hash2Curve) MultBytes(scalar, element []byte) (internal.Point, error)
- func (h *Hash2Curve) NewElement() internal.Point
- func (h *Hash2Curve) NewScalar() internal.Scalar
- type Point
- func (p *Point) Add(element internal.Point) internal.Point
- func (p *Point) Bytes() []byte
- func (p *Point) Copy() internal.Point
- func (p *Point) Decode(input []byte) (internal.Point, error)
- func (p *Point) InvertMult(s internal.Scalar) internal.Point
- func (p *Point) IsIdentity() bool
- func (p *Point) Mult(scalar internal.Scalar) internal.Point
- func (p *Point) Sub(element internal.Point) internal.Point
- type Scalar
- func (s *Scalar) Add(scalar internal.Scalar) internal.Scalar
- func (s *Scalar) Bytes() []byte
- func (s *Scalar) Copy() internal.Scalar
- func (s *Scalar) Decode(in []byte) (internal.Scalar, error)
- func (s *Scalar) Equal(s2 *Scalar) bool
- func (s *Scalar) Invert() internal.Scalar
- func (s *Scalar) Mult(scalar internal.Scalar) internal.Scalar
- func (s *Scalar) Random() internal.Scalar
- func (s *Scalar) Sub(scalar internal.Scalar) internal.Scalar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash2Curve ¶
type Hash2Curve struct {
// contains filtered or unexported fields
}
Hash2Curve implements the Group interface to Hash-to-Curve primitives.
func New ¶
func New(id H2C.SuiteID) *Hash2Curve
New returns a pointer to a Hash2Curve structure instantiated for the given Hash-to-Curve identifier. and the domain separation tag.
func (*Hash2Curve) Base ¶
func (h *Hash2Curve) Base() internal.Point
Base returns the group's base point a.k.a. canonical generator.
func (*Hash2Curve) ElementLength ¶
func (h *Hash2Curve) ElementLength() int
ElementLength returns the byte size of an encoded element.
func (*Hash2Curve) HashToGroup ¶
func (h *Hash2Curve) HashToGroup(input, dst []byte) internal.Point
HashToGroup allows arbitrary input to be safely mapped to the curve of the Group.
func (*Hash2Curve) HashToScalar ¶
func (h *Hash2Curve) HashToScalar(input, dst []byte) internal.Scalar
HashToScalar allows arbitrary input to be safely mapped to the field.
func (*Hash2Curve) Identity ¶
func (h *Hash2Curve) Identity() internal.Point
Identity returns the group's identity element.
func (*Hash2Curve) MultBytes ¶
func (h *Hash2Curve) MultBytes(scalar, element []byte) (internal.Point, error)
MultBytes allows []byte encodings of a scalar and an element of the Group to be multiplied.
func (*Hash2Curve) NewElement ¶
func (h *Hash2Curve) NewElement() internal.Point
NewElement returns a new, empty, element.
func (*Hash2Curve) NewScalar ¶
func (h *Hash2Curve) NewScalar() internal.Scalar
NewScalar returns a new, empty, scalar.
type Point ¶
type Point struct { *Hash2Curve // contains filtered or unexported fields }
Point implements the Point interface for Hash-to-Curve points.
func (*Point) Add ¶
Add adds the argument to the receiver, sets the receiver to the result and returns it.
func (*Point) Decode ¶
Decode decodes the input an sets the current element to its value, and returns it.
func (*Point) InvertMult ¶
InvertMult returns the scalar multiplication of the receiver element with the inverse of the given scalar.
func (*Point) IsIdentity ¶
IsIdentity returns whether the element is the Group's identity element.
type Scalar ¶
type Scalar struct {
// contains filtered or unexported fields
}
Scalar implements the Scalar interface for Hash-to-Curve field elements.
func (*Scalar) Decode ¶
Decode decodes the input an sets the current scalar to its value, and returns it.
func (*Scalar) Invert ¶
Invert returns the scalar's modular inverse ( 1 / scalar ), and does not change the receiver.
func (*Scalar) Mult ¶
Mult returns the multiplication of the scalars, and does not change the receiver.