shmsg

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package shmsg contains the protocol buffer defined messages and auto-generated code as well as some utility code to work with those 'shutter messages'.

Index

Constants

This section is empty.

Variables

View Source
var File_shmsg_shmsg_proto protoreflect.FileDescriptor

Functions

func GetSigner

func GetSigner(signedMessage []byte) (common.Address, error)

GetSigner returns the signer address of a signed message.

func SignMessage

func SignMessage(msg proto.Message, privkey *ecdsa.PrivateKey) ([]byte, error)

SignMessage signs the given Message with the given private key.

Types

type Accusation

type Accusation struct {
	Eon     uint64   `protobuf:"varint,1,opt,name=eon,proto3" json:"eon,omitempty"`
	Accused [][]byte `protobuf:"bytes,2,rep,name=accused,proto3" json:"accused,omitempty"`
	// contains filtered or unexported fields
}

func (*Accusation) Descriptor deprecated

func (*Accusation) Descriptor() ([]byte, []int)

Deprecated: Use Accusation.ProtoReflect.Descriptor instead.

func (*Accusation) GetAccused

func (x *Accusation) GetAccused() [][]byte

func (*Accusation) GetEon

func (x *Accusation) GetEon() uint64

func (*Accusation) ProtoMessage

func (*Accusation) ProtoMessage()

func (*Accusation) ProtoReflect

func (x *Accusation) ProtoReflect() protoreflect.Message

func (*Accusation) Reset

func (x *Accusation) Reset()

func (*Accusation) String

func (x *Accusation) String() string

type Apology

type Apology struct {
	Eon       uint64   `protobuf:"varint,1,opt,name=eon,proto3" json:"eon,omitempty"`
	Accusers  [][]byte `protobuf:"bytes,2,rep,name=accusers,proto3" json:"accusers,omitempty"`
	PolyEvals [][]byte `protobuf:"bytes,3,rep,name=poly_evals,json=polyEvals,proto3" json:"poly_evals,omitempty"`
	// contains filtered or unexported fields
}

func (*Apology) Descriptor deprecated

func (*Apology) Descriptor() ([]byte, []int)

Deprecated: Use Apology.ProtoReflect.Descriptor instead.

func (*Apology) GetAccusers

func (x *Apology) GetAccusers() [][]byte

func (*Apology) GetEon

func (x *Apology) GetEon() uint64

func (*Apology) GetPolyEvals

func (x *Apology) GetPolyEvals() [][]byte

func (*Apology) ProtoMessage

func (*Apology) ProtoMessage()

func (*Apology) ProtoReflect

func (x *Apology) ProtoReflect() protoreflect.Message

func (*Apology) Reset

func (x *Apology) Reset()

func (*Apology) String

func (x *Apology) String() string

type BatchConfig

type BatchConfig struct {
	StartBatchIndex       uint64   `protobuf:"varint,1,opt,name=start_batch_index,json=startBatchIndex,proto3" json:"start_batch_index,omitempty"`
	Keypers               [][]byte `protobuf:"bytes,2,rep,name=keypers,proto3" json:"keypers,omitempty"`
	Threshold             uint64   `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"`
	ConfigContractAddress []byte   `` /* 126-byte string literal not displayed */
	ConfigIndex           uint64   `protobuf:"varint,5,opt,name=config_index,json=configIndex,proto3" json:"config_index,omitempty"`
	Started               bool     `protobuf:"varint,6,opt,name=started,proto3" json:"started,omitempty"`
	ValidatorsUpdated     bool     `protobuf:"varint,7,opt,name=validatorsUpdated,proto3" json:"validatorsUpdated,omitempty"`
	// contains filtered or unexported fields
}

func (*BatchConfig) Descriptor deprecated

func (*BatchConfig) Descriptor() ([]byte, []int)

Deprecated: Use BatchConfig.ProtoReflect.Descriptor instead.

func (*BatchConfig) GetConfigContractAddress

func (x *BatchConfig) GetConfigContractAddress() []byte

func (*BatchConfig) GetConfigIndex

func (x *BatchConfig) GetConfigIndex() uint64

func (*BatchConfig) GetKeypers

func (x *BatchConfig) GetKeypers() [][]byte

func (*BatchConfig) GetStartBatchIndex

func (x *BatchConfig) GetStartBatchIndex() uint64

func (*BatchConfig) GetStarted

func (x *BatchConfig) GetStarted() bool

func (*BatchConfig) GetThreshold

func (x *BatchConfig) GetThreshold() uint64

func (*BatchConfig) GetValidatorsUpdated

func (x *BatchConfig) GetValidatorsUpdated() bool

func (*BatchConfig) ProtoMessage

func (*BatchConfig) ProtoMessage()

func (*BatchConfig) ProtoReflect

func (x *BatchConfig) ProtoReflect() protoreflect.Message

func (*BatchConfig) Reset

func (x *BatchConfig) Reset()

func (*BatchConfig) String

func (x *BatchConfig) String() string

type BatchConfigStarted

type BatchConfigStarted struct {
	BatchConfigIndex uint64 `protobuf:"varint,1,opt,name=batch_config_index,json=batchConfigIndex,proto3" json:"batch_config_index,omitempty"`
	// contains filtered or unexported fields
}

func (*BatchConfigStarted) Descriptor deprecated

func (*BatchConfigStarted) Descriptor() ([]byte, []int)

Deprecated: Use BatchConfigStarted.ProtoReflect.Descriptor instead.

func (*BatchConfigStarted) GetBatchConfigIndex

func (x *BatchConfigStarted) GetBatchConfigIndex() uint64

func (*BatchConfigStarted) ProtoMessage

func (*BatchConfigStarted) ProtoMessage()

func (*BatchConfigStarted) ProtoReflect

func (x *BatchConfigStarted) ProtoReflect() protoreflect.Message

func (*BatchConfigStarted) Reset

func (x *BatchConfigStarted) Reset()

func (*BatchConfigStarted) String

func (x *BatchConfigStarted) String() string

type CheckIn

type CheckIn struct {
	ValidatorPublicKey  []byte `protobuf:"bytes,1,opt,name=validator_public_key,json=validatorPublicKey,proto3" json:"validator_public_key,omitempty"`    // 32 byte ed25519 public key
	EncryptionPublicKey []byte `protobuf:"bytes,2,opt,name=encryption_public_key,json=encryptionPublicKey,proto3" json:"encryption_public_key,omitempty"` // compressed ecies public key
	// contains filtered or unexported fields
}

func (*CheckIn) Descriptor deprecated

func (*CheckIn) Descriptor() ([]byte, []int)

Deprecated: Use CheckIn.ProtoReflect.Descriptor instead.

func (*CheckIn) GetEncryptionPublicKey

func (x *CheckIn) GetEncryptionPublicKey() []byte

func (*CheckIn) GetValidatorPublicKey

func (x *CheckIn) GetValidatorPublicKey() []byte

func (*CheckIn) ProtoMessage

func (*CheckIn) ProtoMessage()

func (*CheckIn) ProtoReflect

func (x *CheckIn) ProtoReflect() protoreflect.Message

func (*CheckIn) Reset

func (x *CheckIn) Reset()

func (*CheckIn) String

func (x *CheckIn) String() string

type DecryptionSignature

type DecryptionSignature struct {
	BatchIndex uint64 `protobuf:"varint,1,opt,name=batch_index,json=batchIndex,proto3" json:"batch_index,omitempty"`
	Signature  []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*DecryptionSignature) Descriptor deprecated

func (*DecryptionSignature) Descriptor() ([]byte, []int)

Deprecated: Use DecryptionSignature.ProtoReflect.Descriptor instead.

func (*DecryptionSignature) GetBatchIndex

func (x *DecryptionSignature) GetBatchIndex() uint64

func (*DecryptionSignature) GetSignature

func (x *DecryptionSignature) GetSignature() []byte

func (*DecryptionSignature) ProtoMessage

func (*DecryptionSignature) ProtoMessage()

func (*DecryptionSignature) ProtoReflect

func (x *DecryptionSignature) ProtoReflect() protoreflect.Message

func (*DecryptionSignature) Reset

func (x *DecryptionSignature) Reset()

func (*DecryptionSignature) String

func (x *DecryptionSignature) String() string

type EonStartVote

type EonStartVote struct {
	StartBatchIndex uint64 `protobuf:"varint,1,opt,name=start_batch_index,json=startBatchIndex,proto3" json:"start_batch_index,omitempty"`
	// contains filtered or unexported fields
}

func (*EonStartVote) Descriptor deprecated

func (*EonStartVote) Descriptor() ([]byte, []int)

Deprecated: Use EonStartVote.ProtoReflect.Descriptor instead.

func (*EonStartVote) GetStartBatchIndex

func (x *EonStartVote) GetStartBatchIndex() uint64

func (*EonStartVote) ProtoMessage

func (*EonStartVote) ProtoMessage()

func (*EonStartVote) ProtoReflect

func (x *EonStartVote) ProtoReflect() protoreflect.Message

func (*EonStartVote) Reset

func (x *EonStartVote) Reset()

func (*EonStartVote) String

func (x *EonStartVote) String() string

type EpochSecretKeyShare

type EpochSecretKeyShare struct {
	Eon   uint64 `protobuf:"varint,1,opt,name=eon,proto3" json:"eon,omitempty"`
	Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"`
	Share []byte `protobuf:"bytes,3,opt,name=share,proto3" json:"share,omitempty"`
	// contains filtered or unexported fields
}

func (*EpochSecretKeyShare) Descriptor deprecated

func (*EpochSecretKeyShare) Descriptor() ([]byte, []int)

Deprecated: Use EpochSecretKeyShare.ProtoReflect.Descriptor instead.

func (*EpochSecretKeyShare) GetEon

func (x *EpochSecretKeyShare) GetEon() uint64

func (*EpochSecretKeyShare) GetEpoch

func (x *EpochSecretKeyShare) GetEpoch() uint64

func (*EpochSecretKeyShare) GetShare

func (x *EpochSecretKeyShare) GetShare() []byte

func (*EpochSecretKeyShare) ProtoMessage

func (*EpochSecretKeyShare) ProtoMessage()

func (*EpochSecretKeyShare) ProtoReflect

func (x *EpochSecretKeyShare) ProtoReflect() protoreflect.Message

func (*EpochSecretKeyShare) Reset

func (x *EpochSecretKeyShare) Reset()

func (*EpochSecretKeyShare) String

func (x *EpochSecretKeyShare) String() string

type G1

type G1 struct {
	G1Bytes []byte `protobuf:"bytes,1,opt,name=g1bytes,proto3" json:"g1bytes,omitempty"` // Unmarshal with new(G1).Unmarshal(msg.g1bytes)
	// contains filtered or unexported fields
}

func (*G1) Descriptor deprecated

func (*G1) Descriptor() ([]byte, []int)

Deprecated: Use G1.ProtoReflect.Descriptor instead.

func (*G1) Get

func (g1 *G1) Get() (*bn256.G1, error)

Get unmarshals the marshaled value.

func (*G1) GetG1Bytes

func (x *G1) GetG1Bytes() []byte

func (*G1) ProtoMessage

func (*G1) ProtoMessage()

func (*G1) ProtoReflect

func (x *G1) ProtoReflect() protoreflect.Message

func (*G1) Reset

func (x *G1) Reset()

func (*G1) Set

func (g1 *G1) Set(v *bn256.G1)

Set marshals the given value and stores the byte array.

func (*G1) String

func (x *G1) String() string

type G2

type G2 struct {
	G2Bytes []byte `protobuf:"bytes,1,opt,name=g2bytes,proto3" json:"g2bytes,omitempty"` // Unmarshal with new(G2).Unmarshal(msg.g2bytes)
	// contains filtered or unexported fields
}

func (*G2) Descriptor deprecated

func (*G2) Descriptor() ([]byte, []int)

Deprecated: Use G2.ProtoReflect.Descriptor instead.

func (*G2) Get

func (g2 *G2) Get() (*bn256.G2, error)

Get unmarshals the marshaled value.

func (*G2) GetG2Bytes

func (x *G2) GetG2Bytes() []byte

func (*G2) ProtoMessage

func (*G2) ProtoMessage()

func (*G2) ProtoReflect

func (x *G2) ProtoReflect() protoreflect.Message

func (*G2) Reset

func (x *G2) Reset()

func (*G2) Set

func (g2 *G2) Set(v *bn256.G2)

Set marshals the given value and stores the byte array.

func (*G2) String

func (x *G2) String() string

type GT

type GT struct {
	Gtbytes []byte `protobuf:"bytes,1,opt,name=gtbytes,proto3" json:"gtbytes,omitempty"` // Unmarshal with new(GT).Unmarshal(msg.g2bytes)
	// contains filtered or unexported fields
}

func (*GT) Descriptor deprecated

func (*GT) Descriptor() ([]byte, []int)

Deprecated: Use GT.ProtoReflect.Descriptor instead.

func (*GT) Get

func (gt *GT) Get() (*bn256.GT, error)

Get unmarshals the marshaled value.

func (*GT) GetGtbytes

func (x *GT) GetGtbytes() []byte

func (*GT) ProtoMessage

func (*GT) ProtoMessage()

func (*GT) ProtoReflect

func (x *GT) ProtoReflect() protoreflect.Message

func (*GT) Reset

func (x *GT) Reset()

func (*GT) Set

func (gt *GT) Set(v *bn256.GT)

Set marshals the given value and stores the byte array.

func (*GT) String

func (x *GT) String() string

type Message

type Message struct {

	// Types that are assignable to Payload:
	//	*Message_BatchConfig
	//	*Message_BatchConfigStarted
	//	*Message_CheckIn
	//	*Message_DecryptionSignature
	//	*Message_PolyEval
	//	*Message_PolyCommitment
	//	*Message_Accusation
	//	*Message_Apology
	//	*Message_EonStartVote
	//	*Message_EpochSecretKeyShare
	Payload isMessage_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

func NewAccusation

func NewAccusation(eon uint64, accused []common.Address) *Message

func NewApology

func NewApology(eon uint64, accusers []common.Address, polyEvals []*big.Int) *Message

NewApology creates a new apology message used in the DKG process. This message reveals the polyEvals, that where sent encrypted via the PolyEval messages to each accuser.

func NewBatchConfig

func NewBatchConfig(
	startBatchIndex uint64,
	keypers []common.Address,
	threshold uint64,
	configContractAddress common.Address,
	configIndex uint64,
	started bool,
	validatorsUpdated bool,
) *Message

NewBatchConfig creates a new BatchConfig message.

func NewBatchConfigStarted

func NewBatchConfigStarted(configIndex uint64) *Message

NewBatchConfigStarted creates a new BatchConfigStarted message.

func NewCheckIn

func NewCheckIn(validatorPublicKey []byte, encryptionKey *ecies.PublicKey) *Message

NewCheckIn creates a new CheckIn message.

func NewDecryptionSignature

func NewDecryptionSignature(batchIndex uint64, signature []byte) *Message

NewDecryptionSignature creates a new DecryptionSignature message.

func NewEonStartVote

func NewEonStartVote(startBatchIndex uint64) *Message

NewEonStartVote creates a new eon start vote message.

func NewEpochSecretKeyShare

func NewEpochSecretKeyShare(eon, epoch uint64, share *shcrypto.EpochSecretKeyShare) *Message

func NewPolyCommitment

func NewPolyCommitment(eon uint64, gammas *shcrypto.Gammas) *Message

NewPolyCommitment creates a new poly commitment message containing gamma values.

func NewPolyEval

func NewPolyEval(eon uint64, receivers []common.Address, encryptedEvals [][]byte) *Message

NewPolyEval creates a new poly eval message.

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetAccusation

func (x *Message) GetAccusation() *Accusation

func (*Message) GetApology

func (x *Message) GetApology() *Apology

func (*Message) GetBatchConfig

func (x *Message) GetBatchConfig() *BatchConfig

func (*Message) GetBatchConfigStarted

func (x *Message) GetBatchConfigStarted() *BatchConfigStarted

func (*Message) GetCheckIn

func (x *Message) GetCheckIn() *CheckIn

func (*Message) GetDecryptionSignature

func (x *Message) GetDecryptionSignature() *DecryptionSignature

func (*Message) GetEonStartVote

func (x *Message) GetEonStartVote() *EonStartVote

func (*Message) GetEpochSecretKeyShare

func (x *Message) GetEpochSecretKeyShare() *EpochSecretKeyShare

func (*Message) GetPayload

func (m *Message) GetPayload() isMessage_Payload

func (*Message) GetPolyCommitment

func (x *Message) GetPolyCommitment() *PolyCommitment

func (*Message) GetPolyEval

func (x *Message) GetPolyEval() *PolyEval

func (*Message) GobDecode

func (m *Message) GobDecode(data []byte) error

func (*Message) GobEncode

func (m *Message) GobEncode() ([]byte, error)

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessageWithNonce

type MessageWithNonce struct {
	Msg         *Message `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	ChainId     []byte   `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	RandomNonce uint64   `protobuf:"varint,3,opt,name=random_nonce,json=randomNonce,proto3" json:"random_nonce,omitempty"`
	// contains filtered or unexported fields
}

func GetMessage

func GetMessage(signedMessage []byte) (*MessageWithNonce, error)

GetMessage returns the unmarshalled Message of a signed message.

func (*MessageWithNonce) Descriptor deprecated

func (*MessageWithNonce) Descriptor() ([]byte, []int)

Deprecated: Use MessageWithNonce.ProtoReflect.Descriptor instead.

func (*MessageWithNonce) GetChainId

func (x *MessageWithNonce) GetChainId() []byte

func (*MessageWithNonce) GetMsg

func (x *MessageWithNonce) GetMsg() *Message

func (*MessageWithNonce) GetRandomNonce

func (x *MessageWithNonce) GetRandomNonce() uint64

func (*MessageWithNonce) ProtoMessage

func (*MessageWithNonce) ProtoMessage()

func (*MessageWithNonce) ProtoReflect

func (x *MessageWithNonce) ProtoReflect() protoreflect.Message

func (*MessageWithNonce) Reset

func (x *MessageWithNonce) Reset()

func (*MessageWithNonce) String

func (x *MessageWithNonce) String() string

type Message_Accusation

type Message_Accusation struct {
	Accusation *Accusation `protobuf:"bytes,11,opt,name=accusation,proto3,oneof"`
}

type Message_Apology

type Message_Apology struct {
	Apology *Apology `protobuf:"bytes,12,opt,name=apology,proto3,oneof"`
}

type Message_BatchConfig

type Message_BatchConfig struct {
	BatchConfig *BatchConfig `protobuf:"bytes,4,opt,name=batch_config,json=batchConfig,proto3,oneof"`
}

type Message_BatchConfigStarted

type Message_BatchConfigStarted struct {
	BatchConfigStarted *BatchConfigStarted `protobuf:"bytes,6,opt,name=batch_config_started,json=batchConfigStarted,proto3,oneof"`
}

type Message_CheckIn

type Message_CheckIn struct {
	CheckIn *CheckIn `protobuf:"bytes,7,opt,name=check_in,json=checkIn,proto3,oneof"`
}

type Message_DecryptionSignature

type Message_DecryptionSignature struct {
	DecryptionSignature *DecryptionSignature `protobuf:"bytes,8,opt,name=decryption_signature,json=decryptionSignature,proto3,oneof"`
}

type Message_EonStartVote

type Message_EonStartVote struct {
	EonStartVote *EonStartVote `protobuf:"bytes,13,opt,name=eon_start_vote,json=eonStartVote,proto3,oneof"`
}

type Message_EpochSecretKeyShare

type Message_EpochSecretKeyShare struct {
	EpochSecretKeyShare *EpochSecretKeyShare `protobuf:"bytes,14,opt,name=epoch_secret_key_share,json=epochSecretKeyShare,proto3,oneof"`
}

type Message_PolyCommitment

type Message_PolyCommitment struct {
	PolyCommitment *PolyCommitment `protobuf:"bytes,10,opt,name=poly_commitment,json=polyCommitment,proto3,oneof"`
}

type Message_PolyEval

type Message_PolyEval struct {
	// DKG messages
	PolyEval *PolyEval `protobuf:"bytes,9,opt,name=poly_eval,json=polyEval,proto3,oneof"`
}

type PolyCommitment

type PolyCommitment struct {
	Eon    uint64   `protobuf:"varint,1,opt,name=eon,proto3" json:"eon,omitempty"`
	Gammas [][]byte `protobuf:"bytes,2,rep,name=gammas,proto3" json:"gammas,omitempty"`
	// contains filtered or unexported fields
}

func (*PolyCommitment) Descriptor deprecated

func (*PolyCommitment) Descriptor() ([]byte, []int)

Deprecated: Use PolyCommitment.ProtoReflect.Descriptor instead.

func (*PolyCommitment) GetEon

func (x *PolyCommitment) GetEon() uint64

func (*PolyCommitment) GetGammas

func (x *PolyCommitment) GetGammas() [][]byte

func (*PolyCommitment) ProtoMessage

func (*PolyCommitment) ProtoMessage()

func (*PolyCommitment) ProtoReflect

func (x *PolyCommitment) ProtoReflect() protoreflect.Message

func (*PolyCommitment) Reset

func (x *PolyCommitment) Reset()

func (*PolyCommitment) String

func (x *PolyCommitment) String() string

type PolyEval

type PolyEval struct {
	Eon            uint64   `protobuf:"varint,1,opt,name=eon,proto3" json:"eon,omitempty"`
	Receivers      [][]byte `protobuf:"bytes,2,rep,name=receivers,proto3" json:"receivers,omitempty"`
	EncryptedEvals [][]byte `protobuf:"bytes,3,rep,name=encrypted_evals,json=encryptedEvals,proto3" json:"encrypted_evals,omitempty"`
	// contains filtered or unexported fields
}

func (*PolyEval) Descriptor deprecated

func (*PolyEval) Descriptor() ([]byte, []int)

Deprecated: Use PolyEval.ProtoReflect.Descriptor instead.

func (*PolyEval) GetEncryptedEvals

func (x *PolyEval) GetEncryptedEvals() [][]byte

func (*PolyEval) GetEon

func (x *PolyEval) GetEon() uint64

func (*PolyEval) GetReceivers

func (x *PolyEval) GetReceivers() [][]byte

func (*PolyEval) ProtoMessage

func (*PolyEval) ProtoMessage()

func (*PolyEval) ProtoReflect

func (x *PolyEval) ProtoReflect() protoreflect.Message

func (*PolyEval) Reset

func (x *PolyEval) Reset()

func (*PolyEval) String

func (x *PolyEval) String() string

Jump to

Keyboard shortcuts

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