composite

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PubKeyName  = "ostracon/PubKeyComposite"
	PrivKeyName = "ostracon/PrivKeyComposite"

	KeyType               = "composite"
	KeyTypeBlsWithEd25519 = KeyType + "(" + bls.KeyType + "," + ed25519.KeyType + ")"
)

Variables

Functions

This section is empty.

Types

type PrivKey

type PrivKey struct {
	SignKey crypto.PrivKey `json:"sign"`
	VrfKey  crypto.PrivKey `json:"vrf"`
}

func GenPrivKey

func GenPrivKey() *PrivKey

func NewPrivKeyComposite

func NewPrivKeyComposite(sign crypto.PrivKey, vrf crypto.PrivKey) *PrivKey

func PrivKeyFromBytes added in v1.0.2

func PrivKeyFromBytes(bz []byte) *PrivKey

PrivKeyFromBytes depends on PrivKey.Bytes See PrivKey.Bytes

func (PrivKey) Bytes

func (sk PrivKey) Bytes() []byte

func (PrivKey) Equals

func (sk PrivKey) Equals(key crypto.PrivKey) bool

func (PrivKey) Identity

func (sk PrivKey) Identity() crypto.PrivKey

func (PrivKey) PubKey

func (sk PrivKey) PubKey() crypto.PubKey

func (PrivKey) Sign

func (sk PrivKey) Sign(msg []byte) ([]byte, error)

func (PrivKey) Type

func (sk PrivKey) Type() string

func (PrivKey) VRFProve

func (sk PrivKey) VRFProve(message []byte) (crypto.Proof, error)

VRFProve generates a VRF Proof for given message to generate a verifiable random.

type PubKey

type PubKey struct {
	SignKey crypto.PubKey `json:"sign"`
	VrfKey  crypto.PubKey `json:"vrf"`
}

func PubKeyFromBytes added in v1.0.2

func PubKeyFromBytes(bz []byte) PubKey

func (PubKey) Address

func (pk PubKey) Address() crypto.Address

func (PubKey) Bytes

func (pk PubKey) Bytes() []byte

func (PubKey) Equals

func (pk PubKey) Equals(key crypto.PubKey) bool

func (*PubKey) Identity

func (pk *PubKey) Identity() crypto.PubKey

func (PubKey) Type

func (pk PubKey) Type() string

func (PubKey) VRFVerify

func (pk PubKey) VRFVerify(proof crypto.Proof, seed []byte) (crypto.Output, error)

VRFVerify verifies that the given VRF Proof was generated from the seed by the owner of this public key.

func (PubKey) VerifySignature

func (pk PubKey) VerifySignature(msg []byte, sig []byte) bool

Jump to

Keyboard shortcuts

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