pedersen

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchProve added in v0.11.2

func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byte) (pok curve.G1Affine, err error)

BatchProve generates a single proof of knowledge for multiple commitments for faster verification

func FoldCommitments added in v0.11.2

func FoldCommitments(commitments []curve.G1Affine, fiatshamirSeeds ...[]byte) (commitment curve.G1Affine, err error)

FoldCommitments amalgamates multiple commitments into one, which can be verifier against a folded proof obtained from BatchProve

func Setup

func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error)

Types

type ProvingKey added in v0.11.0

type ProvingKey struct {
	Basis         []curve.G1Affine
	BasisExpSigma []curve.G1Affine
}

ProvingKey for committing and proofs of knowledge

func (*ProvingKey) Commit added in v0.11.0

func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error)

func (*ProvingKey) ProveKnowledge added in v0.11.2

func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error)

func (*ProvingKey) ReadFrom added in v0.11.0

func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error)

func (*ProvingKey) WriteRawTo added in v0.11.2

func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error)

func (*ProvingKey) WriteTo added in v0.11.0

func (pk *ProvingKey) WriteTo(w io.Writer) (int64, error)

type VerifyingKey added in v0.11.0

type VerifyingKey struct {
	G             curve.G2Affine // TODO @tabaie: does this really have to be randomized?
	GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ}
}

func (*VerifyingKey) ReadFrom added in v0.11.0

func (vk *VerifyingKey) ReadFrom(r io.Reader) (int64, error)

func (*VerifyingKey) UnsafeReadFrom added in v0.11.2

func (vk *VerifyingKey) UnsafeReadFrom(r io.Reader) (int64, error)

func (*VerifyingKey) Verify added in v0.11.0

func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G1Affine) error

Verify checks if the proof of knowledge is valid

func (*VerifyingKey) WriteRawTo added in v0.11.2

func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error)

func (*VerifyingKey) WriteTo added in v0.11.0

func (vk *VerifyingKey) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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