util

package
v0.0.0-...-4fa03f3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostAndPort

func HostAndPort(address string) (string, int, error)

HostAndPort will parse the `address` into it's host and port. An error is returned if address is in the incorrect format, expected; "host:port"

func IDToAddress

func IDToAddress(id string) sdk.AccAddress

IDToAddress will deterministically calculate an `sdk.AccAddress` using the given `id`

func Secp256k1FromHex

func Secp256k1FromHex(key string) (tmcrypto.PrivKey, error)

Secp256k1FromHex parses the hex-encoded `key` string

func TrimHex

func TrimHex(hexStr string) string

TrimHex will remove the "0x" hex prefix if present and also 0-pad the hex string to an even length

Types

type Commitment

type Commitment []byte

Commitment is the Pedersen Commitmentment

func CreateCommitment

func CreateCommitment() (secret string, commitment Commitment)

CreateCommitment will return a newly generated secret with it's corresponding Commitment

func NewCommitment

func NewCommitment(secret []byte) Commitment

NewCommitment will create a Commitmentment using `secret`

func (Commitment) Bytes

func (c Commitment) Bytes() []byte

Bytes returns the underlying bytes of this commitment

func (Commitment) Empty

func (c Commitment) Empty() bool

Empty is an indicator for a nil Commitment

func (Commitment) Equals

func (c Commitment) Equals(c2 Commitment) bool

Equals checks if c == c2

func (Commitment) Len

func (c Commitment) Len() int

Len returns the byte length of this commitment {

func (Commitment) VerifyReveal

func (c Commitment) VerifyReveal(secret string) bool

VerifyReveal will verify the Commitmentment against `reveal`

func (Commitment) VerifyRevealBytes

func (c Commitment) VerifyRevealBytes(secret []byte) bool

VerifyRevealBytes will verifty against `reveal`

Jump to

Keyboard shortcuts

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