Documentation ¶
Overview ¶
Package dleq implements Discrete Logarithm Equivalence Proofs.
ContextString must be given as DST from upper protocol (e.g. VOPRF, POPRF)
Reference: https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-12.html#name-discrete-logarithm-equivale
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedGroup raises when unsupported group passed to Configuration struct ErrUnsupportedGroup = errors.New("dleq: unsupported group") )
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { DST []byte // Domain separation tag Group eccgroup.Group // prime-order elliptic curve group }
Configuration struct for DLEQ algorithm
type Prover ¶
type Prover interface { // GenerateProof generates proof with given prime-order curve elements // Reference: https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-12.html#name-proof-generation GenerateProof(k *eccgroup.Scalar, A, B *eccgroup.Element, C, D []*eccgroup.Element) (proof []byte, err error) // GenerateProof generates a proof with given prime-order curve elements and randomness GenerateProofWithRandomness(k *eccgroup.Scalar, A, B *eccgroup.Element, C, D []*eccgroup.Element, rnd *eccgroup.Scalar) (proof []byte, err error) }
Prover is an interface to identify party that generates proof
func NewProver ¶
func NewProver(c *Configuration) (Prover, error)
NewProver returns Prover instance according to configuration
type Verifier ¶
type Verifier interface { // VerifyProof verifies the proof with given prime-order curve elements // Reference: https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-12.html#name-proof-verification VerifyProof(A, B *eccgroup.Element, C, D []*eccgroup.Element, proof []byte) bool }
Verifier is an interface to identify party that verify proof
func NewVerifier ¶
func NewVerifier(c *Configuration) (Verifier, error)
NewVerifier returns Verifier instance according to configuration
Click to show internal directories.
Click to hide internal directories.