Documentation
¶
Overview ¶
Package vrf implements a verifiable random function using the Edwards form of Curve25519, SHA3 and the Elligator map.
E is Curve25519 (in Edwards coordinates), h is SHA3. f is the elligator map (bytes->E) that covers half of E. 8 is the cofactor of E, the group order is 8*l for prime l. Setup : the prover publicly commits to a public key (P : E) H : names -> E H(n) = f(h(n))^8 VRF : keys -> names -> vrfs VRF_x(n) = h(n, H(n)^x)) Prove : keys -> names -> proofs Prove_x(n) = tuple(c=h(n, g^r, H(n)^r), t=r-c*x, ii=H(n)^x) where r = h(x, n) is used as a source of randomness Check : E -> names -> vrfs -> proofs -> bool Check(P, n, vrf, (c,t,ii)) = vrf == h(n, ii) && c == h(n, g^t*P^c, H(n)^t*ii^c)
Index ¶
Constants ¶
View Source
const ( PublicKeySize = 32 SecretKeySize = 64 Size = 32 ProofSize = 32 + 32 + intermediateSize )
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey creates a public/private key pair. rnd is used for randomness. If it is nil, `crypto/rand` is used.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.