zkproofs

package
v0.0.0-...-1b893ba Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RangeProofGenerators

func RangeProofGenerators(n int) (g_, h_ []*crypto.Generator)

Types

type FormatPrivate

type FormatPrivate struct {
	*FormatPublic
	// contains filtered or unexported fields
}

func (*FormatPrivate) SetPrivate

func (private *FormatPrivate) SetPrivate(v, r *big.Int, g, h *crypto.Generator, c1, c2 *crypto.Commitment) *FormatPrivate

type FormatProof

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

func (*FormatProof) Bytes

func (proof *FormatProof) Bytes() []byte

func (*FormatProof) ProofCheck

func (proof *FormatProof) ProofCheck(public *FormatPublic) bool

func (*FormatProof) ProofGen

func (proof *FormatProof) ProofGen(private *FormatPrivate) (*FormatProof, error)

func (*FormatProof) SetBytes

func (proof *FormatProof) SetBytes(b []byte) error

type FormatPublic

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

func (*FormatPublic) SetPublic

func (public *FormatPublic) SetPublic(g, h *crypto.Generator, c1, c2 *crypto.Commitment) *FormatPublic

type FormatZK

type FormatZK struct {
	*FormatProof
	*FormatPrivate
}

func (*FormatZK) Check

func (zk *FormatZK) Check() bool

func (*FormatZK) Init

func (zk *FormatZK) Init() *FormatZK

func (*FormatZK) Proof

func (zk *FormatZK) Proof() (err error)

type LinearEquationPrivate

type LinearEquationPrivate struct {
	*LinearEquationPublic
	// contains filtered or unexported fields
}

LinearEquationPrivate contains the linear equation public variables

func (*LinearEquationPrivate) SetPrivate

func (private *LinearEquationPrivate) SetPrivate(a []*big.Int, b *big.Int, x []*big.Int, y *crypto.Commitment, g []*crypto.Generator) (*LinearEquationPrivate, error)

SetPrivate init public

type LinearEquationProof

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

LinearEquationProof contains the generated linear equation proof variables

func (*LinearEquationProof) Bytes

func (proof *LinearEquationProof) Bytes() []byte

Bytes returns the bytes encode of proof

func (*LinearEquationProof) ProofCheck

func (proof *LinearEquationProof) ProofCheck(public *LinearEquationPublic) bool

ProofCheck check weather the linear equation proof holds

func (*LinearEquationProof) ProofGen

ProofGen generates linear equation proof

func (*LinearEquationProof) SetBytes

func (proof *LinearEquationProof) SetBytes(b []byte) error

SetBytes sets proof with the bytes b

type LinearEquationPublic

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

LinearEquationPublic contains the linear equation public variables

func (*LinearEquationPublic) SetPublic

func (public *LinearEquationPublic) SetPublic(a []*big.Int, b *big.Int, y *crypto.Commitment, g []*crypto.Generator) (*LinearEquationPublic, error)

SetPublic init public

type LinearEquationZK

type LinearEquationZK struct {
	*LinearEquationProof
	*LinearEquationPrivate
}

func (*LinearEquationZK) Check

func (zk *LinearEquationZK) Check() bool

func (*LinearEquationZK) Init

func (zk *LinearEquationZK) Init() *LinearEquationZK

func (*LinearEquationZK) Proof

func (zk *LinearEquationZK) Proof() (err error)

type RangePrivate

type RangePrivate struct {
	*RangePublic
	// contains filtered or unexported fields
}

func (*RangePrivate) SetPrivate

func (private *RangePrivate) SetPrivate(value *crypto.Commitment, g, h *crypto.Generator, g_, h_ []*crypto.Generator, n uint8, v, r *big.Int) (*RangePrivate, error)

type RangeProof

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

func (*RangeProof) Bytes

func (proof *RangeProof) Bytes() []byte

func (*RangeProof) ProofCheck

func (proof *RangeProof) ProofCheck(public *RangePublic) bool

func (*RangeProof) ProofGen

func (proof *RangeProof) ProofGen(private *RangePrivate) (*RangeProof, error)

func (*RangeProof) SetBytes

func (proof *RangeProof) SetBytes(b []byte) error

type RangePublic

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

func (*RangePublic) SetPublic

func (public *RangePublic) SetPublic(value *crypto.Commitment, g, h *crypto.Generator, g_, h_ []*crypto.Generator, n uint8) (*RangePublic, error)

type RangeZK

type RangeZK struct {
	*RangeProof
	*RangePrivate
}

func (*RangeZK) Check

func (zk *RangeZK) Check() bool

func (*RangeZK) Init

func (zk *RangeZK) Init() *RangeZK

func (*RangeZK) Proof

func (zk *RangeZK) Proof() (err error)

type Signature

type Signature struct {
	*SignatureProof
	*SignaturePrivate
}

func (*Signature) Check

func (sig *Signature) Check() bool

func (*Signature) Init

func (sig *Signature) Init() *Signature

func (*Signature) Proof

func (sig *Signature) Proof() (err error)

type SignaturePrivate

type SignaturePrivate struct {
	*SignaturePublic
	// contains filtered or unexported fields
}

func (*SignaturePrivate) SetPrivate

func (private *SignaturePrivate) SetPrivate(sk *big.Int, addr crypto.Address, h *crypto.Generator, e *big.Int) *SignaturePrivate

type SignatureProof

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

func (*SignatureProof) Bytes

func (proof *SignatureProof) Bytes() []byte

func (*SignatureProof) ProofCheck

func (proof *SignatureProof) ProofCheck(public *SignaturePublic) bool

func (*SignatureProof) ProofGen

func (proof *SignatureProof) ProofGen(private *SignaturePrivate) (*SignatureProof, error)

func (*SignatureProof) SetBytes

func (proof *SignatureProof) SetBytes(b []byte) error

type SignaturePublic

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

func (*SignaturePublic) SetPublic

func (public *SignaturePublic) SetPublic(addr crypto.Address, e *big.Int) *SignaturePublic

type ZK

type ZK interface {
	ZKProof
	ZKPrivate

	Proof() error
	Check() bool
	SetBytes(b []byte) error
}

type ZKPrivate

type ZKPrivate interface {
	ZKPublic
	// contains filtered or unexported methods
}

type ZKProof

type ZKProof interface {
	crypto.HashVariable
}

type ZKPublic

type ZKPublic interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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