dlnproof

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Iterations = 128

Iterations is the number of iterations used in the DLN proof for soundness.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proof

type Proof struct {
	Alpha,
	T [Iterations]*big.Int
}

Proof is a zero-knowledge proof of knowledge of the discrete logarithm over a safe prime product.

func NewDLNProof

func NewDLNProof(h1, h2, x, p, q, N *big.Int, rand io.Reader) *Proof

NewDLNProof creates a new DLN proof that h2 = h1^x mod N given the factorization N = p*q.

func UnmarshalDLNProof

func UnmarshalDLNProof(bzs [][]byte) (*Proof, error)

UnmarshalDLNProof reconstructs a DLN Proof from a slice of byte slices.

func (*Proof) Serialize

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

Serialize encodes the proof into a slice of byte slices for transmission.

func (*Proof) Verify

func (p *Proof) Verify(h1, h2, N *big.Int) bool

Verify checks whether the DLN proof is valid for the given h1, h2, and modulus N.

Jump to

Keyboard shortcuts

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