sortition

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UndefVerifiableSeed = VerifiableSeed{}

Functions

func VerifyProof

func VerifyProof(seed VerifiableSeed, proof Proof, public crypto.PublicKey, total, threshold int64) bool

Types

type Proof

type Proof [48]byte

func EvaluateSortition

func EvaluateSortition(seed VerifiableSeed, signer crypto.Signer, total, threshold int64) (bool, Proof)

func GenerateRandomProof

func GenerateRandomProof() Proof

func ProofFromBytes

func ProofFromBytes(data []byte) (Proof, error)

func ProofFromString

func ProofFromString(text string) (Proof, error)

type VerifiableSeed

type VerifiableSeed [48]byte

func GenerateRandomSeed

func GenerateRandomSeed() VerifiableSeed

func VerifiableSeedFromBytes

func VerifiableSeedFromBytes(data []byte) (VerifiableSeed, error)

func VerifiableSeedFromString

func VerifiableSeedFromString(text string) (VerifiableSeed, error)

func (*VerifiableSeed) GenerateNext added in v0.10.0

func (s *VerifiableSeed) GenerateNext(signer crypto.Signer) VerifiableSeed

func (*VerifiableSeed) Verify

func (s *VerifiableSeed) Verify(public crypto.PublicKey, prevSeed VerifiableSeed) bool

Jump to

Keyboard shortcuts

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