server

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 34 Imported by: 3

Documentation

Overview

Package server implements the Katzenpost voting authority server.

Index

Constants

This section is empty.

Variables

View Source
var (
	MixPublishDeadline       = epochtime.Period / 4
	AuthorityVoteDeadline    = MixPublishDeadline + epochtime.Period/8
	AuthorityRevealDeadline  = AuthorityVoteDeadline + epochtime.Period/8
	PublishConsensusDeadline = AuthorityRevealDeadline + epochtime.Period/8
)
View Source
var ErrGenerateOnly = errors.New("server: GenerateOnly set")

ErrGenerateOnly is the error returned when the server initialization terminates due to the `GenerateOnly` debug config option.

Functions

This section is empty.

Types

type DeterministicRandReader

type DeterministicRandReader struct {
	// contains filtered or unexported fields
}

DeterministicRandReader is a random Reader whose output is a chacha20 keystream.

func NewDeterministicRandReader

func NewDeterministicRandReader(key []byte) (*DeterministicRandReader, error)

NewDeterministicRandReader returns a DeterministicRandReader initialized with key.

func (*DeterministicRandReader) Int63

func (r *DeterministicRandReader) Int63() int64

Int63 returns a random int64 with most significant bit set to 0.

func (*DeterministicRandReader) Perm

func (r *DeterministicRandReader) Perm(n int) []int

Perm returns the shuffled slice of integers from 0 to n.

func (*DeterministicRandReader) Read

func (r *DeterministicRandReader) Read(data []byte) (int, error)

Read writes the keystream into the passed byteslice and returns the number of bytes written.

func (*DeterministicRandReader) Seed

func (r *DeterministicRandReader) Seed(seed int64)

Seed initializes the DeterministicRandReader with nonce.

type Server

type Server struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

Server is a voting authority server instance.

func New

func New(cfg *config.Config) (*Server, error)

New returns a new Server instance parameterized with the specific configuration.

func (*Server) IdentityKey

func (s *Server) IdentityKey() *eddsa.PublicKey

IdentityKey returns the running Server's identity public key.

func (*Server) RotateLog

func (s *Server) RotateLog()

RotateLog rotates the log file if logging to a file is enabled.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown cleanly shuts down a given Server instance.

func (*Server) Wait

func (s *Server) Wait()

Wait waits till the server is terminated for any reason.

type SharedRandom

type SharedRandom struct {
	// contains filtered or unexported fields
}

SharedRandom is a container for commit-and-reveal protocol messages

func (*SharedRandom) Commit

func (s *SharedRandom) Commit(epoch uint64) ([]byte, error)

Commit produces a SharedRandom commit value for the given epoch

func (*SharedRandom) GetCommit

func (s *SharedRandom) GetCommit() []byte

GetCommit returns the commit value

func (*SharedRandom) Reveal

func (s *SharedRandom) Reveal() []byte

Reveal returns the reveal value

func (*SharedRandom) SetCommit

func (s *SharedRandom) SetCommit(rawCommit []byte)

SetCommit sets the commit value

func (*SharedRandom) Verify

func (s *SharedRandom) Verify(reveal []byte) bool

Verify checks that the reveal value verifies the commit value

Directories

Path Synopsis
Package config implements the Katzenpost voting authority server configuration.
Package config implements the Katzenpost voting authority server configuration.

Jump to

Keyboard shortcuts

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