nizk

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func H

func H(id peer.ID, ctx []byte, A, r *ristretto255.Element) *ristretto255.Scalar

H computes the challenge portion of the proof of knowledge

Types

type NIZK

type NIZK struct {
	// R is the Schnorr signature of the secret
	// R = k + a*S
	R *ristretto255.Scalar
	// S is the challenge portion of the Schnorr signature
	// S = H(ID, CTX, A, k*B)
	S *ristretto255.Scalar
}

NIZK is the Schnorr signature of the secret

func NewSig

func NewSig() *NIZK

NewSig returns an empty Schnorr signature

func Prove

func Prove(id peer.ID, ctx []byte, A *ristretto255.Element, a *ristretto255.Scalar) (*NIZK, error)

Prove knowledge of the secret by calculating its Schnorr signature

func (*NIZK) Decode

func (n *NIZK) Decode(buf []byte) error

Decode a Schnorr signature

func (NIZK) Encode

func (n NIZK) Encode() []byte

Encode a Schnorr signature

func (NIZK) Verify

func (n NIZK) Verify(id peer.ID, ctx []byte, A *ristretto255.Element) bool

Verify a proof of knowledge of the secret

Jump to

Keyboard shortcuts

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