dleq

package
v0.0.0-...-57993ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2019 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package dleq provides functionality to create and verify non-interactive zero-knowledge (NIZK) proofs for the equality (EQ) of discrete logarithms (DL). This means, for two values xG and xH one can check that

log_{G}(xG) == log_{H}(xH)

without revealing the secret value x.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proof

type Proof struct {
	C  kyber.Scalar // challenge
	R  kyber.Scalar // response
	VG kyber.Point  // public commitment with respect to base point G
	VH kyber.Point  // public commitment with respect to base point H
}

Proof represents a NIZK dlog-equality proof.

func NewDLEQProof

func NewDLEQProof(suite Suite, G kyber.Point, H kyber.Point, x kyber.Scalar) (proof *Proof, xG kyber.Point, xH kyber.Point, err error)

NewDLEQProof computes a new NIZK dlog-equality proof for the scalar x with respect to base points G and H. It therefore randomly selects a commitment v and then computes the challenge c = H(xG,xH,vG,vH) and response r = v - cx. Besides the proof, this function also returns the encrypted base points xG and xH.

func NewDLEQProofBatch

func NewDLEQProofBatch(suite Suite, G []kyber.Point, H []kyber.Point, secrets []kyber.Scalar) (proof []*Proof, xG []kyber.Point, xH []kyber.Point, err error)

NewDLEQProofBatch computes lists of NIZK dlog-equality proofs and of encrypted base points xG and xH. Note that the challenge is computed over all input values.

func (*Proof) Verify

func (p *Proof) Verify(suite Suite, G kyber.Point, H kyber.Point, xG kyber.Point, xH kyber.Point) error

Verify examines the validity of the NIZK dlog-equality proof. The proof is valid if the following two conditions hold:

vG == rG + c(xG)
vH == rH + c(xH)

type Suite

Suite wraps the functionalities needed by the dleq package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL