Versions in this module Expand all Collapse all v0 v0.0.2 Mar 12, 2021 Changes in this version + const OnChainResponseLength + const ProofLength + var ErrCGammaEqualsSHash = fmt.Errorf("pick a different nonce; c*gamma = s*hash, with this one") + var FieldSize = bigFromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F") + var Generator = secp256k1Curve.Point().Base() + func FieldHash(msg []byte) *big.Int + func FinalSeed(s PreSeedData) (finalSeed *big.Int) + func HashToCurve(p kyber.Point, input *big.Int, ordinates func(x *big.Int)) (kyber.Point, error) + func HashUint256s(xs ...*big.Int) (*big.Int, error) + func IsCurveXOrdinate(x *big.Int) bool + func IsSquare(x *big.Int) bool + func ProjectiveECAdd(p, q kyber.Point) (x, y, z fieldElt) + func ScalarFromCurvePoints(hash, pk, gamma kyber.Point, uWitness [20]byte, v kyber.Point) *big.Int + func SquareRoot(x *big.Int) *big.Int + func YSquared(x *big.Int) *big.Int + type MarshaledOnChainResponse [OnChainResponseLength]byte + func GenerateProofResponse(secretKey common.Hash, s PreSeedData) (MarshaledOnChainResponse, error) + type MarshaledProof [ProofLength]byte + func (m MarshaledProof) String() string + type PreSeedData struct + BlockHash common.Hash + BlockNum uint64 + PreSeed Seed + type Proof struct + C *big.Int + Gamma kyber.Point + Output *big.Int + PublicKey kyber.Point + S *big.Int + Seed *big.Int + func GenerateProof(secretKey, seed common.Hash) (Proof, error) + func UnmarshalSolidityProof(proof []byte) (rv Proof, err error) + func (p *Proof) MarshalForSolidityVerifier() (MarshaledProof, error) + func (p *Proof) SolidityPrecalculations() (*SolidityProof, error) + func (p *Proof) String() string + func (p *Proof) VerifyVRFProof() (bool, error) + func (p *Proof) WellFormed() bool + type ProofResponse struct + BlockNum uint64 + P Proof + PreSeed Seed + func UnmarshalProofResponse(m MarshaledOnChainResponse) (*ProofResponse, error) + func (p *ProofResponse) MarshalForVRFCoordinator() (response MarshaledOnChainResponse, err error) + func (p ProofResponse) CryptoProof(s PreSeedData) (Proof, error) + type Seed [32]byte + func BigToSeed(x *big.Int) (Seed, error) + func BytesToSeed(b []byte) (*Seed, error) + func (s *Seed) Big() *big.Int + type SolidityProof struct + CGammaWitness kyber.Point + P *Proof + SHashWitness kyber.Point + UWitness common.Address + ZInv *big.Int + func (p *SolidityProof) MarshalForSolidityVerifier() (proof MarshaledProof) + func (p *SolidityProof) String() string