types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: LGPL-3.0 Imports: 0 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Curve

type Curve interface {
	BitSize() uint64
	CompressedPointSize() int
	BasePoint() Point
	AltBasePoint() Point
	NewRandomScalar() Scalar
	ScalarFromInt(uint32) Scalar
	ScalarFromBytes([32]byte) Scalar
	HashToScalar([]byte) (Scalar, error)
	ScalarBaseMul(Scalar) Point
	ScalarMul(Scalar, Point) Point
	Sign(s Scalar, p Point) ([]byte, error)
	Verify(pubkey, msgPoint Point, sig []byte) bool

	// the following two functions MUST copy the byte slice
	// before decoding.
	DecodeToPoint([]byte) (Point, error)
	DecodeToScalar([]byte) (Scalar, error)
}

type Point

type Point interface {
	Copy() Point
	Add(Point) Point
	Sub(Point) Point
	ScalarMul(Scalar) Point
	Encode() []byte
	IsZero() bool
	Equals(other Point) bool
}

type Scalar

type Scalar interface {
	Add(Scalar) Scalar
	Sub(Scalar) Scalar
	Negate() Scalar
	Mul(Scalar) Scalar
	Inverse() Scalar
	Encode() []byte
	Eq(Scalar) bool
	IsZero() bool
}

Jump to

Keyboard shortcuts

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