Documentation ¶
Overview ¶
Package group exposes a prime-order elliptic curve groups with additional hash-to-curve operations.
It implements the latest hash-to-curve specification to date (https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11).
Package group exposes a prime-order elliptic curve groups with additional hash-to-curve operations.
Package group exposes a prime-order elliptic curve groups with additional hash-to-curve operations.
Package group exposes a prime-order elliptic curve groups with additional hash-to-curve operations.
Index ¶
- type Group
- func (i Group) Available() bool
- func (i Group) Base() *Point
- func (i Group) ElementLength() int
- func (i Group) HashToGroup(input, dst []byte) *Point
- func (i Group) HashToScalar(input, dst []byte) *Scalar
- func (i Group) Identity() *Point
- func (i Group) MakeDST(app, version string) ([]byte, error)
- func (i Group) MultBytes(scalar, element []byte) (*Point, error)
- func (i Group) NewElement() *Point
- func (i Group) NewScalar() *Scalar
- func (i Group) String() string
- type Point
- func (p *Point) Add(point *Point) *Point
- func (p *Point) Bytes() []byte
- func (p *Point) Copy() *Point
- func (p *Point) Decode(in []byte) (*Point, error)
- func (p *Point) InvertMult(scalar *Scalar) *Point
- func (p *Point) IsIdentity() bool
- func (p *Point) Mult(scalar *Scalar) *Point
- func (p *Point) Sub(point *Point) *Point
- type Scalar
- func (s *Scalar) Add(scalar *Scalar) *Scalar
- func (s *Scalar) Bytes() []byte
- func (s *Scalar) Copy() *Scalar
- func (s *Scalar) Decode(in []byte) (*Scalar, error)
- func (s *Scalar) Invert() *Scalar
- func (s *Scalar) Mult(scalar *Scalar) *Scalar
- func (s *Scalar) Random() *Scalar
- func (s *Scalar) Sub(scalar *Scalar) *Scalar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group byte
Group defines registered groups for use in the implementation.
const ( // Ristretto255Sha512 identifies the Ristretto255 group with SHA2-512 hash-to-group hashing. Ristretto255Sha512 Group = 1 + iota // P256Sha256 identifies a group over P256 with SHA2-512 hash-to-group hashing. P256Sha256 // P384Sha512 identifies a group over P384 with SHA2-512 hash-to-group hashing. P384Sha512 // P521Sha512 identifies a group over P521 with SHA2-512 hash-to-group hashing. P521Sha512 // Curve25519Sha512 identifies a group over Curve25519 with SHA2-512 hash-to-group hashing. Curve25519Sha512 // Edwards25519Sha512 identifies a group over Edwards25519 with SHA2-512 hash-to-group hashing. Edwards25519Sha512 // Curve448Sha512 identifies a group over Curve448 with SHA2-512 hash-to-group hashing. Curve448Sha512 // Edwards448Sha512 identifies a group over Edwards448 with SHA2-512 hash-to-group hashing. Edwards448Sha512 // Secp256k1Sha256 identifies a group over Secp256k1 with SHA2-512 hash-to-group hashing. Secp256k1Sha256 )
func (Group) ElementLength ¶
ElementLength returns the byte size of an encoded element.
func (Group) HashToGroup ¶
HashToGroup allows arbitrary input to be safely mapped to the curve of the Group.
func (Group) HashToScalar ¶
HashToScalar allows arbitrary input to be safely mapped to the field.
func (Group) MakeDST ¶
MakeDST builds a domain separation tag in the form of <app>-V<version>-CS<id>-<hash-to-curve-ID>, or returns an error.
func (Group) MultBytes ¶
MultBytes allows []byte encodings of a scalar and an element of the Group to be multiplied.
func (Group) NewElement ¶
NewElement returns a new, empty, element.
type Point ¶
Point represents a point on the curve of the prime-order group.
func (*Point) Decode ¶
Decode decodes the input an sets the current point to its value, and returns it.
func (*Point) InvertMult ¶
InvertMult returns the scalar multiplication of the receiver point with the inverse of the given scalar.
func (*Point) IsIdentity ¶
IsIdentity returns whether the point is the Group's identity point.
type Scalar ¶
Scalar represents a scalar in the prime-order group.
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.
Directories ¶
Path | Synopsis |
---|---|
Package curve25519 implements a prime-order group over Curve25519 with hash-to-curve.
|
Package curve25519 implements a prime-order group over Curve25519 with hash-to-curve. |
Package edwards25519 wraps filippo.io/edwards25519 and exposes a simple prime-order group API with hash-to-curve.
|
Package edwards25519 wraps filippo.io/edwards25519 and exposes a simple prime-order group API with hash-to-curve. |
Package hash2curve provides hash-to-curve compatible hashing over arbitrary input.
|
Package hash2curve provides hash-to-curve compatible hashing over arbitrary input. |
Package internal defines simple and abstract APIs to group Elements and Scalars.
|
Package internal defines simple and abstract APIs to group Elements 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 ristretto allows simple and abstracted operations in the Ristretto255 group Package ristretto wraps "github.com/gtank/ristretto255" and exposes a simple prime-order group API with hash-to-curve.
|
Package ristretto allows simple and abstracted operations in the Ristretto255 group Package ristretto wraps "github.com/gtank/ristretto255" and exposes a simple prime-order group API with hash-to-curve. |