xor

package
v0.6.0-alpha-20...-5109cf1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result types.RID

Result will contain the XOR of all messages sent.

type Round1

type Round1 struct {
	*round.Helper
}

Round1 can embed round.Helper which provides useful methods handling messages.

func (*Round1) Finalize

func (r *Round1) Finalize(out chan<- *round.Message) (round.Session, error)

Finalize uses the out channel to communicate messages to other parties.

func (Round1) MessageContent

func (Round1) MessageContent() round.Content

MessageContent returns an empty message.First as a placeholder indicating that no message is expected.

func (Round1) Number

func (Round1) Number() round.Number

Number implements round.Round.

func (*Round1) StoreMessage

func (r *Round1) StoreMessage(round.Message) error

StoreMessage in the first round does nothing since no messages are expected.

func (*Round1) VerifyMessage

func (r *Round1) VerifyMessage(round.Message) error

VerifyMessage in the first round does nothing since no messages are expected.

type Round2

type Round2 struct {
	*Round1
	// contains filtered or unexported fields
}

Round2 embeds Round1 so that it has access to previous information.

func (*Round2) Finalize

func (r *Round2) Finalize(chan<- *round.Message) (round.Session, error)

Finalize does not send any messages, but computes the output resulting from the received messages.

func (Round2) MessageContent

func (Round2) MessageContent() round.Content

MessageContent implements round.Round.

func (Round2) Number

func (Round2) Number() round.Number

Number implements round.Round.

func (*Round2) StoreMessage

func (r *Round2) StoreMessage(msg round.Message) error

StoreMessage saves any relevant data from the content, in this case the sender's xor value.

func (*Round2) VerifyMessage

func (r *Round2) VerifyMessage(msg round.Message) error

VerifyMessage casts the content to the appropriate type and stores the content.

type Round2Message

type Round2Message struct {
	XOR types.RID
}

Round2Message is the message sent in Round1 and received in Round2.

func (Round2Message) RoundNumber

func (Round2Message) RoundNumber() round.Number

RoundNumber should return the same things as Round.Number.

Jump to

Keyboard shortcuts

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