keys

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MPublicKey

func MPublicKey(r *rusk.PublicKey, f *PublicKey)

MPublicKey copies the PublicKey structure into the Rusk equivalent.

func MSecretKey

func MSecretKey(r *rusk.SecretKey, f *SecretKey)

MSecretKey copies the SecretKey structure into the Rusk equivalent.

func MStealthAddress

func MStealthAddress(r *rusk.StealthAddress, f *StealthAddress)

MStealthAddress copies the StealthAddress structure into the Rusk equivalent.

func MViewKey

func MViewKey(r *rusk.ViewKey, f *ViewKey)

MViewKey copies the ViewKey structure into the Rusk equivalent.

func MarshalPublicKey

func MarshalPublicKey(r *bytes.Buffer, f *PublicKey) error

MarshalPublicKey writes the PublicKey struct into a bytes.Buffer.

func MarshalSecretKey

func MarshalSecretKey(r *bytes.Buffer, f *SecretKey) error

MarshalSecretKey writes the SecretKey struct into a bytes.Buffer.

func MarshalStealthAddress

func MarshalStealthAddress(r *bytes.Buffer, f *StealthAddress) error

MarshalStealthAddress writes the StealthAddress struct into a bytes.Buffer.

func MarshalViewKey

func MarshalViewKey(r *bytes.Buffer, f *ViewKey) error

MarshalViewKey writes the ViewKey struct into a bytes.Buffer.

func UPublicKey

func UPublicKey(r *rusk.PublicKey, f *PublicKey)

UPublicKey copies the Rusk PublicKey structure into the native equivalent.

func USecretKey

func USecretKey(r *rusk.SecretKey, f *SecretKey)

USecretKey copies the Rusk SecretKey structure into the native equivalent.

func UStealthAddress

func UStealthAddress(r *rusk.StealthAddress, f *StealthAddress)

UStealthAddress copies the Rusk StealthAddress structure into the native equivalent.

func UViewKey

func UViewKey(r *rusk.ViewKey, f *ViewKey)

UViewKey copies the Rusk ViewKey structure into the native equivalent.

func UnmarshalPublicKey

func UnmarshalPublicKey(r *bytes.Buffer, f *PublicKey) error

UnmarshalPublicKey reads a PublicKey struct from a bytes.Buffer.

func UnmarshalSecretKey

func UnmarshalSecretKey(r *bytes.Buffer, f *SecretKey) error

UnmarshalSecretKey reads a SecretKey struct from a bytes.Buffer.

func UnmarshalStealthAddress

func UnmarshalStealthAddress(r *bytes.Buffer, f *StealthAddress) error

UnmarshalStealthAddress reads a StealthAddress struct from a bytes.Buffer.

func UnmarshalViewKey

func UnmarshalViewKey(r *bytes.Buffer, f *ViewKey) error

UnmarshalViewKey reads a ViewKey struct from a bytes.Buffer.

Types

type PublicKey

type PublicKey struct {
	AG []byte `json:"a_g"`
	BG []byte `json:"b_g"`
}

PublicKey is a Phoenix public key, consisting of two JubJub points.

func NewPublicKey

func NewPublicKey() *PublicKey

NewPublicKey returns a new empty PublicKey struct.

func (*PublicKey) Copy

func (p *PublicKey) Copy() *PublicKey

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

func (PublicKey) ToAddr

func (p PublicKey) ToAddr() []byte

ToAddr concatenates the two points in the PublicKey, and returns them as a hex-encoded slice of bytes.

type SecretKey

type SecretKey struct {
	A []byte `json:"a"`
	B []byte `json:"b"`
}

SecretKey is a Phoenix secret key, consisting of two JubJub scalars.

func NewSecretKey

func NewSecretKey() *SecretKey

NewSecretKey returns a new empty SecretKey struct.

func (*SecretKey) Copy

func (s *SecretKey) Copy() *SecretKey

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type StealthAddress

type StealthAddress struct {
	RG  []byte `json:"r_g"`
	PkR []byte `json:"pk_r"`
}

StealthAddress is a Phoenix stealth address, consisting of two JubJub points.

func NewStealthAddress

func NewStealthAddress() *StealthAddress

NewStealthAddress returns a new empty StealthAddress struct.

func (*StealthAddress) Copy

func (s *StealthAddress) Copy() *StealthAddress

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type ViewKey

type ViewKey struct {
	A  []byte `json:"a"`
	BG []byte `json:"b_g"`
}

ViewKey is a Phoenix view key, consisting of a JubJub scalar, and a JubJub point.

func NewViewKey

func NewViewKey() *ViewKey

NewViewKey returns a new empty ViewKey struct.

func (*ViewKey) Copy

func (v *ViewKey) Copy() *ViewKey

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

Jump to

Keyboard shortcuts

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