Versions in this module Expand all Collapse all v0 v0.0.9 Aug 6, 2021 Changes in this version + const KiB + const MaxValidChiaBitLength + const MaxValidDefaultBitLength + const MiB + const MinValidChiaBitLength + const MinValidDefaultBitLength + const PoCSlot + const QualityConstantMASSIP0002 + const QualityConstantMASSValidity + var ErrProofChiaNoQuality = errors.New("empty chia pos quality") + var ErrProofDecodeDataSize = errors.New("invalid data length on decode proof") + var ErrProofFilter = errors.New("not passing proof filter") + var ErrProofInvalidBitLength = errors.New("invalid bitLength") + var ErrProofInvalidChallenge = errors.New("invalid challenge") + var ErrProofInvalidFlipValue = errors.New("invalid flip value") + var ErrProofNilChia = errors.New("nil chia pos") + var ErrProofNilItf = errors.New("proof") + var ErrProofType = errors.New("proof type mismatched") + func ChiaPlotSize(k int) uint64 + func DefaultPlotSize(bl int) uint64 + func EnforceMASSIP0002(height uint64) bool + func GetChiaPlotID(proof Proof) ([32]byte, error) + func GetChiaPoolPublicKey(proof Proof) (*chiapos.G1Element, error) + func GetQuality(Q1 *big.Float, hashVal pocutil.Hash) *big.Int + func HashValChia(chiaQuality []byte, slot, height uint64) pocutil.Hash + func IsValidProofType(pt ProofType) bool + func MustGetChiaPoolPublicKey(proof Proof) *chiapos.G1Element + func PlotSize(proofType ProofType, bl int) uint64 + func Q1FactorChia(k uint8) *big.Float + func Q1FactorDefault(bitLength int) *big.Float + func VerifyProof(proof Proof, pubKeyHash pocutil.Hash, challenge pocutil.Hash, filter bool) error + type ChiaProof struct + func GetChiaProof(proof Proof) (*ChiaProof, error) + func MustGetChiaProof(proof Proof) *ChiaProof + func NewChiaProof(pos *chiapos.ProofOfSpace) *ChiaProof + func (proof *ChiaProof) BitLength() int + func (proof *ChiaProof) Decode(data []byte) error + func (proof *ChiaProof) Encode() []byte + func (proof *ChiaProof) Pos() *chiapos.ProofOfSpace + func (proof *ChiaProof) Quality(slot, height uint64) *big.Int + func (proof *ChiaProof) Type() ProofType + func (proof *ChiaProof) VerifiedQuality(useless, challenge pocutil.Hash, filter bool, slot, height uint64) (*big.Int, error) + func (proof *ChiaProof) Verify(useless, challenge pocutil.Hash, filter bool) error + type DefaultProof struct + BL int + X []byte + XPrime []byte + func GetDefaultProof(proof Proof) (*DefaultProof, error) + func MustGetDefaultProof(proof Proof) *DefaultProof + func NewDefaultProof(x, xp []byte, bl int) *DefaultProof + func (proof *DefaultProof) BitLength() int + func (proof *DefaultProof) Decode(data []byte) error + func (proof *DefaultProof) Encode() []byte + func (proof *DefaultProof) GetHashVal(slot uint64, height uint64) pocutil.Hash + func (proof *DefaultProof) GetQualityByIterative(slot, height uint64) *big.Int + func (proof *DefaultProof) Quality(slot, height uint64) *big.Int + func (proof *DefaultProof) Type() ProofType + func (proof *DefaultProof) VerifiedQuality(pubKeyHash pocutil.Hash, challenge pocutil.Hash, filter bool, ...) (*big.Int, error) + func (proof *DefaultProof) Verify(pubKeyHash pocutil.Hash, challenge pocutil.Hash, filter bool) error + type EmptyProof struct + func NewEmptyProof() *EmptyProof + func (proof *EmptyProof) BitLength() int + func (proof *EmptyProof) Decode([]byte) error + func (proof *EmptyProof) Encode() []byte + func (proof *EmptyProof) Quality(slot, height uint64) *big.Int + func (proof *EmptyProof) Type() ProofType + func (proof *EmptyProof) VerifiedQuality(plotSeed pocutil.Hash, challenge pocutil.Hash, filter bool, ...) (*big.Int, error) + func (proof *EmptyProof) Verify(plotSeed pocutil.Hash, challenge pocutil.Hash, filter bool) error + type Proof interface + BitLength func() int + Decode func([]byte) error + Encode func() []byte + Quality func(slot, height uint64) *big.Int + Type func() ProofType + VerifiedQuality func(seed pocutil.Hash, challenge pocutil.Hash, filter bool, slot, height uint64) (*big.Int, error) + Verify func(seed pocutil.Hash, challenge pocutil.Hash, filter bool) error + type ProofType uint8 + const ProofTypeChia + const ProofTypeDefault + const ProofTypeEmpty + func (pt ProofType) EnsureBitLength(bl int) bool + func (pt ProofType) PlotSize(bl int) uint64 v0.0.8 Aug 6, 2021 v0.0.7 Aug 6, 2021 v0.0.6 Aug 6, 2021 v0.0.5 Aug 6, 2021 v0.0.3 Aug 6, 2021 v0.0.2 Aug 6, 2021