vdf

package
v0.0.0-...-bf01c4b Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package vdf is a proof-of-concept implementation of a delay function and the security properties are not guaranteed. A more secure implementation of the VDF by Wesolowski (https://eprint.iacr.org/2018/623.pdf) will be dnet soon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VDF

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

VDF is the struct holding necessary state for a hash chain delay function.

func New

func New(difficulty int, input [32]byte) *VDF

New create a new instance of VDF.

func (*VDF) Execute

func (vdf *VDF) Execute()

Execute runs the VDF until it's finished and put the result into output channel.

func (*VDF) GetOutput

func (vdf *VDF) GetOutput() [32]byte

GetOutput returns the vdf output, which can be bytes of 0s is the vdf is not finished.

func (*VDF) GetOutputChannel

func (vdf *VDF) GetOutputChannel() chan [32]byte

GetOutputChannel returns the vdf output channel.

func (*VDF) IsFinished

func (vdf *VDF) IsFinished() bool

IsFinished returns whether the vdf execution is finished or not.

Jump to

Keyboard shortcuts

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