dl

package
v0.0.0-...-dfc0bd1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package dl provides a Schnorr NIZK discrete-log proof.

This package implements a Schnorr NIZK discrete-log proof obtained from the interactive Schnorr identification scheme through a Fiat-Shamir transformation.

Given (k,G,kG) the Prove function returns a Proof struct attesting that kG = [k]G, which can be validated using the Verify function.

The userID label is a unique identifier for the prover.

The otherInfo label is defined to allow flexible inclusion of contextual information in the Schnorr NIZK proof. The otherInfo is also used as a domain separation tag (dst) for the hash to scalar function.

Reference: https://datatracker.ietf.org/doc/html/rfc8235

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(myGroup group.Group, G, kG group.Element, p Proof, userID, otherInfo []byte) bool

Verify checks whether the proof attests that kG = [k]G.

Types

type Proof

type Proof struct {
	V group.Element
	R group.Scalar
}

func Prove

func Prove(myGroup group.Group, G, kG group.Element, k group.Scalar, userID, otherInfo []byte, rnd io.Reader) Proof

Prove returns a proof attesting that kG = [k]G.

Jump to

Keyboard shortcuts

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