o2omp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commitments

type Commitments struct {
	L []*math.G1
	A []*math.G1
	B []*math.G1
	D []*math.G1
}

Commitments to the randomness used in the one-out-of-many proof

type Proof

type Proof struct {
	Commitments *Commitments
	Values      *Values
}

Proof is a one-out-of-many proof

func (*Proof) Deserialize

func (p *Proof) Deserialize(raw []byte) error

Deserialize un-marshals Proof

func (*Proof) Serialize

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

Serialize marshals Proof

type Prover

type Prover struct {
	*Verifier
	// contains filtered or unexported fields
}

Prover produces a one-out-of-many proof A one-out-of-many proof allows a prover who is given a list of commitments (c_1, ..., c_n) to show that they know that there is i \in [N] and r_i \in Z_p such that c_i = Q^r_i (i.e., c_i is commitment to 0)

func NewProver

func NewProver(commitments []*math.G1, message []byte, pp []*math.G1, length int, index int, randomness *math.Zr, curve *math.Curve) *Prover

NewProver returns a Prover instantiated with the passed arguments

func (*Prover) Prove

func (p *Prover) Prove() ([]byte, error)

Prove produces a one-out-of-many proof

type Values

type Values struct {
	L []*math.Zr
	A []*math.Zr
	B []*math.Zr
	D *math.Zr
}

Values corresponds to r+w*c, where c is the challenge in one-out-of-many proof, r is a random number and w is a secret information known to the prover. The Prover uses Values to show knowledge of (i, r_i) such that c_i \in {c_1, ..., c_n} corresponds to c_i = H^r_i

type Verifier

type Verifier struct {
	Commitments    []*math.G1
	Message        []byte
	PedersenParams []*math.G1 // Pedersen commitments parameters
	BitLength      int
	Curve          *math.Curve
}

Verifier checks the validity of one-out-of-many proofs

func NewVerifier

func NewVerifier(commitments []*math.G1, message []byte, pp []*math.G1, length int, curve *math.Curve) *Verifier

NewVerifier returns a Verifier instantiated with the passed arguments

func (*Verifier) Verify

func (v *Verifier) Verify(p []byte) error

Verify checks the validity of a serialized one-out-of-many proof

type Witness

type Witness struct {
	// contains filtered or unexported fields
}

Witness represents the secret information of one-out-of-many proofs

Jump to

Keyboard shortcuts

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