ringtail

package
v1.20.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RingSize is the default size of the anonymity set
	DefaultRingSize = 16

	// SignatureSize is the size of a Ringtail signature in bytes
	SignatureSize = 32 * DefaultRingSize
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct{}

Factory implements a factory for Ringtail keys

func (*Factory) NewPrivateKey

func (*Factory) NewPrivateKey() (*PrivateKey, error)

NewPrivateKey generates a new private key

func (*Factory) ToPublicKey

func (*Factory) ToPublicKey(privKey *PrivateKey) (*PublicKey, error)

ToPublicKey converts a private key to its corresponding public key

type Point

type Point struct {
	X, Y *big.Int
}

Point represents a point on the elliptic curve

type PrivateKey

type PrivateKey struct {
	Scalar *big.Int
}

PrivateKey represents a Ringtail private key

func (*PrivateKey) PublicKey

func (priv *PrivateKey) PublicKey() *PublicKey

PublicKey returns the public key corresponding to the private key

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(message []byte, ring []*PublicKey) (*RingSignature, error)

Sign creates a ring signature

type PublicKey

type PublicKey struct {
	Point *Point
}

PublicKey represents a Ringtail public key

func (*PublicKey) Address

func (pub *PublicKey) Address() ids.ShortID

Address returns the address of the public key

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() []byte

Bytes returns the byte representation of the public key

func (*PublicKey) Equal

func (pub *PublicKey) Equal(other *PublicKey) bool

Equal checks if two public keys are equal

type RingSignature

type RingSignature struct {
	C0          *big.Int
	S           []*big.Int
	KeyImage    *Point
	RingPubKeys []*PublicKey
}

RingSignature represents a Ringtail ring signature

func (*RingSignature) Verify

func (sig *RingSignature) Verify(message []byte) bool

Verify verifies a ring signature

Jump to

Keyboard shortcuts

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