Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UndefVerifiableSeed = VerifiableSeed{}
Functions ¶
func Verify ¶ added in v0.13.0
Verify checks if the provided proof, based on the seed and public key, is valid. If the proof is valid, it calculates the random number that can be generated based on the given proof.
func VerifyProof ¶
Types ¶
type Proof ¶
type Proof [48]byte
func Evaluate ¶ added in v0.13.0
func Evaluate(seed VerifiableSeed, prv *bls.PrivateKey, max uint64) (uint64, Proof)
Evaluate returns a provable random number between [0, max) along with a proof. It returns the random number and the proof that can regenerate the random number using the public key of the signer, without revealing the private key.
func EvaluateSortition ¶
func EvaluateSortition(seed VerifiableSeed, prv *bls.PrivateKey, total, threshold int64) (bool, Proof)
func ProofFromBytes ¶
func ProofFromString ¶
type VerifiableSeed ¶
type VerifiableSeed [48]byte
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(prv *bls.PrivateKey) VerifiableSeed
func (*VerifiableSeed) Verify ¶
func (s *VerifiableSeed) Verify(public *bls.PublicKey, prevSeed VerifiableSeed) bool
Click to show internal directories.
Click to hide internal directories.