Documentation ¶
Index ¶
Constants ¶
View Source
const ( T = 150 // security param W = 256 // bits - label size and Hx() output size WB = 32 // W in bytes )
View Source
const RootIdentifier = Identifier("")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct {
Data [T]Identifier // A list of T identifiers
}
type HashFunc ¶
type HashFunc interface { // Hash takes arbitrary binary data and returns WB bytes Hash(data ...[]byte) []byte HashSingle(data []byte) []byte }
func NewScryptHashFunc ¶
Returns a new HashFunc Hx() for commitment X
type IBasicVerifier ¶
type IBasicVerifier interface { // Verify proof p provided for challenge c using a verifier initialized with x and n where T and W shared between verifier and prover Verify(c Challenge, p Proof) bool VerifyNIP(p Proof) (bool, error) // Create a NIP challenge based on Phi (root label value provided by a proof) CreateNipChallenge(phi Label) (Challenge, error) // Create a random challenge, that consists of T random identifies (each n bits long) CreateRndChallenge() (Challenge, error) }
type IProver ¶
type IProver interface { ComputeDag() (phi Label, err error) GetProof(c Challenge) (Proof, error) GetNonInteractiveProof() (Proof, error) // for testing GetLabel(id Identifier) (Label, bool) GetHashFunction() HashFunc DeleteStore() }
A simple POET prover
type Identifier ¶
type Identifier string // variable-length binary string. e.g. "0011010" Only 0s and 1s are allows chars. Identifiers are n bits long.
type ProofCreatedFunc ¶
Click to show internal directories.
Click to hide internal directories.