pqcpow

package
v0.0.0-...-883a715 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EquationsOffset  = 31
	NbitSampleRate   = 1
	ReferenceSeconds = 15 * 1000 //15s
)

Variables

This section is empty.

Functions

func CalculateNbit

func CalculateNbit(targetTime uint64, lastNbit []byte, windowSize uint64, windowTimeStart uint64, windowTimeEnd uint64) []byte

func CudaGetX

func CudaGetX(deviceID int, m int, n int, whichXWidth int, startSMCount uint64, coefficientBit int, xIn []string) string

func GetDeviceCount

func GetDeviceCount() int32

func GetNbit

func GetNbit(ctx context.Context, p PqcPowAPI) ([]byte, error)

func GetNumOfExecution

func GetNumOfExecution(n int32, m int32) uint64

func NewController

func NewController(mqphash *mqphash.MQPHash, nbit []byte, whichXWidth int) (*controller, error)

func NewDev

func NewDev(mqphash *mqphash.MQPHash, nbit []byte, whichXWidth int, ctr *controller, dlk *sync.Mutex) *dev

func NewFix

func NewFix(mh *mqphash.MQPHash, fixLenght int) *fix

func PqcPowProof

func PqcPowProof(ctx context.Context, seed []byte, nbit []byte, p PqcPowAPI) ([]byte, error)

func VerifyPoW

func VerifyPoW(seed []byte, nbit []byte, x []byte) bool

*

  • @param {Buffer} seed - Block Header, Does not contain
  • @param {Buffer} nbit - 2 byte; First is equations (Rough adjustment), last is threshold (Fine-tune)
  • @param {Buffer} x - 32byte; Hash input

Types

type PqcPowAPI

type PqcPowAPI interface {
	ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
	ChainHead(context.Context) (*types.TipSet, error) //perm:read
	ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
}
const powParameter = {
	equationsOffset: 31,
	nbitSampleRate: 200,
	referenceSeconds: 600
}

Directories

Path Synopsis
kernel

Jump to

Keyboard shortcuts

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