mw

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: ISC Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hashed

func Hashed(tag HashTag, data []byte) *[32]byte

Types

type BlindingFactor

type BlindingFactor [32]byte

func BlindSwitch

func BlindSwitch(blind *BlindingFactor, value uint64) *BlindingFactor

func (*BlindingFactor) Add

func (*BlindingFactor) Sub

type Commitment

type Commitment [33]byte

func NewCommitment

func NewCommitment(blind *BlindingFactor, value uint64) *Commitment

func SwitchCommit

func SwitchCommit(blind *BlindingFactor, value uint64) *Commitment

func (*Commitment) PubKey

func (c *Commitment) PubKey() *PublicKey

type HashTag

type HashTag byte
const (
	HashTagAddress   HashTag = 'A'
	HashTagBlind     HashTag = 'B'
	HashTagDerive    HashTag = 'D'
	HashTagNonce     HashTag = 'N'
	HashTagOutKey    HashTag = 'O'
	HashTagSendKey   HashTag = 'S'
	HashTagTag       HashTag = 'T'
	HashTagNonceMask HashTag = 'X'
	HashTagValueMask HashTag = 'Y'
)

type OutputMask

type OutputMask struct {
	Blind *BlindingFactor
	// contains filtered or unexported fields
}

func OutputMaskFromShared

func OutputMaskFromShared(sharedSecret *SecretKey) *OutputMask

Feeds the shared secret 't' into tagged hash functions to derive:

q - the blinding factor
v' - the value mask
n' - the nonce mask

func (*OutputMask) MaskNonce

func (om *OutputMask) MaskNonce(nonce *big.Int) *big.Int

func (*OutputMask) MaskValue

func (om *OutputMask) MaskValue(value uint64) uint64

type PublicKey

type PublicKey [33]byte

func (*PublicKey) Add

func (pk *PublicKey) Add(p *PublicKey) *PublicKey

func (*PublicKey) Div

func (pk *PublicKey) Div(sk *SecretKey) *PublicKey

func (*PublicKey) Mul

func (pk *PublicKey) Mul(sk *SecretKey) *PublicKey

type SecretKey

type SecretKey [32]byte

func (*SecretKey) Add

func (s *SecretKey) Add(sk *SecretKey) *SecretKey

func (*SecretKey) Mul

func (s *SecretKey) Mul(sk *SecretKey) *SecretKey

func (*SecretKey) PubKey

func (s *SecretKey) PubKey() *PublicKey

func (*SecretKey) Sub

func (s *SecretKey) Sub(sk *SecretKey) *SecretKey

type Signature

type Signature [64]byte

func Sign

func Sign(key *SecretKey, message []byte) (sig Signature)

type StealthAddress

type StealthAddress struct {
	Scan, Spend *PublicKey
}

func (*StealthAddress) A

func (sa *StealthAddress) A() *PublicKey

func (*StealthAddress) B

func (sa *StealthAddress) B() *PublicKey

func (*StealthAddress) Equal

func (sa *StealthAddress) Equal(addr *StealthAddress) bool

Jump to

Keyboard shortcuts

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