api

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationRole

type AuthenticationRole int

AuthenticationRole defines the authentication roles

const (
	// ReplicaAuthen specifies authentication of replica messages
	// signed by using a normal replica node key without utilizing
	// the tamper-proof component
	ReplicaAuthen AuthenticationRole = 1 + iota

	// USIGAuthen specifies authentication of replica messages
	// signed by means of a USIG certificate produced in the
	// tamper-proof component of a replica node. A serialized USIG
	// unique identifier (UI) is used as an authentication tag.
	// This authentication scheme must guarantee that all correct
	// replicas agree on a single USIG instance per replica and
	// only accept UIs generated by that USIG instance.
	USIGAuthen

	// ClientAuthen specifies authentication of client messages
	ClientAuthen
)

func (AuthenticationRole) String

func (r AuthenticationRole) String() string

type Authenticator

type Authenticator interface {
	// VerifyMessageAuthenTag verifies authenticity of a message,
	// given an authentication tag, ID of replica/client that
	// signed the message, and the authentication role used to
	// generate the tag.
	VerifyMessageAuthenTag(role AuthenticationRole, id uint32, msg []byte, tag []byte) error

	// GenerateMessageAuthenTag generates an authentication tag
	// for the message using the credentials selected by the
	// specified authentication role
	GenerateMessageAuthenTag(role AuthenticationRole, msg []byte) ([]byte, error)
}

Authenticator manages the identities of the replicas and clients and provides an interface to authenticate the message senders as well as to generate authentication tags for the message to send. Methods of this interface may be invoked from spawned goroutines.

type Configer

type Configer interface {
	// n: number of nodes in the network
	N() uint32
	// f: number of byzantine nodes the network can tolerate
	F() uint32

	// cp: checkpoint period
	CheckpointPeriod() uint32
	// L: must be larger than CheckpointPeriod
	Logsize() uint32

	// starts when receives a request and stops when request is accepted
	TimeoutRequest() time.Duration

	// starts when receives a request and stops when request is prepared
	TimeoutPrepare() time.Duration

	// starts when sends VIEW-CHANGE and stops when receives a valid NEW-VIEW
	TimeoutViewChange() time.Duration
}

Configer defines the interface to obtain the protocol parameters from the configuration

type ConnectionHandler

type ConnectionHandler interface {
	PeerMessageStreamHandler() MessageStreamHandler
	ClientMessageStreamHandler() MessageStreamHandler
}

ConnectionHandler handles incoming connections.

PeerMessageStreamHandler method provides a mechanism to initiate message exchange with a peer replica.

ClientMessageStreamHandler method provides a mechanism to initiate message exchange with a client.

type MessageStreamHandler

type MessageStreamHandler interface {
	HandleMessageStream(in <-chan []byte) (out <-chan []byte)
}

MessageStreamHandler handles streams of messages

HandleMessageStream method initiates asynchronous handling of messages. Given a stream of incoming messages, it returns another stream of messages that might be produced in reply. Each value sent/received through a channel is a single complete serialized message. Once a message is received from any of the channels, it is the receiver's responsibility to finish handling of the message. This method should never fail or block the caller.

type Replica

type Replica interface {
	ConnectionHandler
}

Replica represents an instance of MinBFT replica.

type ReplicaConnector

type ReplicaConnector interface {
	ReplicaMessageStreamHandler(replicaID uint32) MessageStreamHandler
}

ReplicaConnector establishes connections to replicas

ReplicaMessageStreamHandler method provides a mechanism to communicate with the specified destination replica. The connection guarantees authenticated destination, eventual delivery, preserving integrity and the original order of messages. Confidentiality may also be provided. It returns nil if the destination is not valid.

type RequestConsumer

type RequestConsumer interface {
	Deliver(op []byte) <-chan []byte
	StateDigest() []byte
}

RequestConsumer defines the interface for the local copy of the replicated state machine.

Deliver triggers execution of the operation op by the state machine. The result of the operation execution is send to the returned channel once it is ready.

StateDigest returns the digest of the current system state.

Directories

Path Synopsis
Package mock_api is a generated GoMock package.
Package mock_api is a generated GoMock package.

Jump to

Keyboard shortcuts

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