package dleq

import "github.com/cloudflare/circl/zk/dleq"

Package dleq provides zero-knowledge proofs of Discrete-Logarithm Equivalence (DLEQ).

This implementation is compatible with the one used for VOPRFs [1]. It supports batching proofs to amortize the cost of the proof generation and verification.

References:

[1] RFC-9497: https://www.rfc-editor.org/info/rfc9497

Index

Types

type Params

type Params struct {
	G   group.Group
	H   crypto.Hash
	DST []byte
}

type Proof

type Proof struct {
	// contains filtered or unexported fields
}

func (*Proof) MarshalBinary

func (p *Proof) MarshalBinary() ([]byte, error)

func (*Proof) UnmarshalBinary

func (p *Proof) UnmarshalBinary(g group.Group, data []byte) error

type Prover

type Prover struct{ Params }

func (Prover) Prove

func (p Prover) Prove(k group.Scalar, a, ka, b, kb group.Element, rnd io.Reader) (*Proof, error)

func (Prover) ProveBatch

func (p Prover) ProveBatch(k group.Scalar, a, ka group.Element, bi, kbi []group.Element, rnd io.Reader) (*Proof, error)

func (Prover) ProveBatchWithRandomness

func (p Prover) ProveBatchWithRandomness(
	k group.Scalar,
	a, ka group.Element,
	bi, kbi []group.Element,
	rnd group.Scalar,
) (*Proof, error)

func (Prover) ProveWithRandomness

func (p Prover) ProveWithRandomness(k group.Scalar, a, ka, b, kb group.Element, rnd group.Scalar) (*Proof, error)

type Verifier

type Verifier struct{ Params }

func (Verifier) Verify

func (v Verifier) Verify(a, ka, b, kb group.Element, p *Proof) bool

func (Verifier) VerifyBatch

func (v Verifier) VerifyBatch(a, ka group.Element, bi, kbi []group.Element, p *Proof) bool

Source Files

dleq.go

Version
v1.6.1 (latest)
Published
Apr 9, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
3 days ago

Tools for package owners.