jingtum

package
v0.0.0-...-9a7201b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADDRESS_PREFIX uint8 = 0
	SECRET_PREFIX  uint8 = 33
)

Variables

View Source
var (
	ORDER = btcec.S256().N
	ZERO  = big.NewInt(0)
	ONE   = big.NewInt(1)
)
View Source
var (
	ALPHABET = base58.NewAlphabet("jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz")
)

Functions

func Base58Decode

func Base58Decode(s string) ([]byte, error)

func Base58Encode

func Base58Encode(data []byte) string

func Sha256

func Sha256(b []byte) []byte

func Sha256RipeMD160

func Sha256RipeMD160(data []byte) []byte

func Sha512Half

func Sha512Half(b []byte) []byte

func Sha512Quarter

func Sha512Quarter(b []byte) []byte

Types

type Address

type Address [20]byte

func (Address) MarshalBinary

func (a Address) MarshalBinary() ([]byte, error)

func (Address) MarshalText

func (a Address) MarshalText() ([]byte, error)

func (Address) String

func (a Address) String() string

func (*Address) UnmarshalBinary

func (a *Address) UnmarshalBinary(data []byte) error

func (*Address) UnmarshalText

func (a *Address) UnmarshalText(b []byte) error

type Key

type Key struct {
	// contains filtered or unexported fields
}

func GenerateFamilySeed

func GenerateFamilySeed(password string) (*Key, error)

func (*Key) GetAddress

func (p *Key) GetAddress() (libcore.Address, error)

func (*Key) GetPrivate

func (p *Key) GetPrivate() (libaccount.PrivateKey, error)

func (*Key) GetPublic

func (p *Key) GetPublic() (libaccount.PublicKey, error)

func (*Key) MarshalBinary

func (p *Key) MarshalBinary() ([]byte, error)

func (*Key) MarshalText

func (p *Key) MarshalText() ([]byte, error)

func (*Key) Sign

func (p *Key) Sign(hash libcore.Hash, msg []byte) (libcore.Signature, error)

func (*Key) UnmarshalBinary

func (p *Key) UnmarshalBinary(data []byte) error

func (*Key) UnmarshalText

func (p *Key) UnmarshalText(b []byte) error

func (*Key) Verify

func (p *Key) Verify(hash libcore.Hash, msg []byte, signature libcore.Signature) (bool, error)

type Private

type Private struct {
	*btcec.PrivateKey
	// contains filtered or unexported fields
}

func (*Private) GeneratePublic

func (p *Private) GeneratePublic() (libaccount.PublicKey, error)

func (*Private) GetSecret

func (p *Private) GetSecret() (string, error)

func (*Private) MarshalBinary

func (p *Private) MarshalBinary() ([]byte, error)

func (*Private) MarshalText

func (p *Private) MarshalText() ([]byte, error)

func (*Private) Sign

func (p *Private) Sign(hash libcore.Hash, msg []byte) (libcore.Signature, error)

func (*Private) UnmarshalBinary

func (p *Private) UnmarshalBinary(data []byte) error

func (*Private) UnmarshalText

func (p *Private) UnmarshalText(b []byte) error

type Public

type Public struct {
	*btcec.PublicKey
}

func (*Public) GenerateAddress

func (p *Public) GenerateAddress() (libcore.Address, error)

func (*Public) MarshalBinary

func (p *Public) MarshalBinary() ([]byte, error)

func (*Public) MarshalText

func (p *Public) MarshalText() ([]byte, error)

func (*Public) UnmarshalBinary

func (p *Public) UnmarshalBinary(data []byte) error

func (*Public) UnmarshalText

func (p *Public) UnmarshalText(b []byte) error

func (*Public) Verify

func (p *Public) Verify(hash libcore.Hash, msg []byte, signature libcore.Signature) (bool, error)

Jump to

Keyboard shortcuts

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