Documentation ¶
Overview ¶
Package server implements the Katzenpost voting authority server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MixPublishDeadline = epochtime.Period / 4 AuthorityVoteDeadline = MixPublishDeadline + epochtime.Period/8 AuthorityRevealDeadline = AuthorityVoteDeadline + epochtime.Period/8 PublishConsensusDeadline = AuthorityRevealDeadline + epochtime.Period/8 )
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 ¶
Server is a voting authority server instance.
func (*Server) IdentityKey ¶
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.
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