dual

package
v0.0.0-...-ff61ee7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDualpriv

func NewDualpriv(newPriv1 func() (sig.Priv, error), newPriv2 func() (sig.Priv, error),
	useForCoin, useForSecondary types.SignType) (sig.Priv, error)

func NewDualprivCustomThresh

func NewDualprivCustomThresh(priv1, priv2 sig.Priv, useForCoin, useForSecondary types.SignType) (sig.Priv, error)

Types

type DualPriv

type DualPriv struct {
	sig.Priv
	sig.ThreshStateInterface
	sig.VRFPriv
	Priv2 sig.Priv
	// contains filtered or unexported fields
}

func (*DualPriv) ComputeSharedSecret

func (priv *DualPriv) ComputeSharedSecret(pub sig.Pub) [32]byte

func (*DualPriv) GenerateSig

func (priv *DualPriv) GenerateSig(header sig.SignedMessage, vrfProof sig.VRFProof,
	signType types.SignType) (*sig.SigItem, error)

GenerateSig signs a message and returns the SigItem object containing the signature

func (*DualPriv) GetPrivForSignType

func (priv *DualPriv) GetPrivForSignType(signType types.SignType) (sig.Priv, error)

Returns key that is used for signing the sign type.

func (*DualPriv) GetPub

func (priv *DualPriv) GetPub() sig.Pub

func (*DualPriv) GetSecondaryPriv

func (priv *DualPriv) GetSecondaryPriv() sig.Priv

func (*DualPriv) SetIndex

func (priv *DualPriv) SetIndex(idx sig.PubKeyIndex)

func (*DualPriv) ShallowCopy

func (priv *DualPriv) ShallowCopy() sig.Priv

type DualPub

type DualPub struct {
	sig.Pub
	sig.VRFPub
	// contains filtered or unexported fields
}

func (*DualPub) CheckSignature

func (pub *DualPub) CheckSignature(msg *sig.MultipleSignedMessage, sigItem *sig.SigItem) error

CheckSignature validates the signature with the public key. If the message type is a coin message, it is verified using CoinProof

func (*DualPub) DeserializeSig

func (pub *DualPub) DeserializeSig(m *messages.Message, signType types.SignType) (*sig.SigItem, int, error)

func (*DualPub) FromPubBytes

func (dpp *DualPub) FromPubBytes(inBuff sig.PubKeyBytes) (sig.Pub, error)

FromPubBytes creates a pub from the bytes created by GetRealPubBytes

func (*DualPub) GetRealPubBytes

func (dpp *DualPub) GetRealPubBytes() (ret sig.PubKeyBytes, err error)

GetRealPubBytes returns a buffer containing the results of GetRealPubBytes on both of the keys

func (*DualPub) New

func (dpp *DualPub) New() sig.Pub

New creates a new empty DualPub object.

func (*DualPub) SetIndex

func (dpp *DualPub) SetIndex(idx sig.PubKeyIndex)

SetIndex sets the index of both the pubs

func (*DualPub) SetPubs

func (pub *DualPub) SetPubs(pub1, pub2 sig.Pub)

func (*DualPub) ShallowCopy

func (dpp *DualPub) ShallowCopy() sig.Pub

ShallowCopy makes a copy of the object without following pointers.

func (*DualPub) VerifySecondarySig

func (dpp *DualPub) VerifySecondarySig(msg sig.SignedMessage, sign sig.Sig) (bool, error)

VerifySecondarySig calls VerifySig using the secondary public key.

Jump to

Keyboard shortcuts

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