proof

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package proof contains the following implementations

  • proof of discrete logarithm (PDL) subprotocol from [spec] §8
  • multiplicative-to-additive (MtA) subprotocol from [spec] §7
  • proof of knowledge of a discrete log modulo a composite (fig 16), i.e., ProveCompositeDL and VerifyCompositeDL

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CdlProof

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

func (CdlProof) MarshalJSON

func (cdlp CdlProof) MarshalJSON() ([]byte, error)

func (*CdlProof) UnmarshalJSON

func (cdlp *CdlProof) UnmarshalJSON(bytes []byte) error

func (CdlProof) Verify

func (p CdlProof) Verify(cv *CdlVerifyParams) error

Verify checks the CdlProof as specified in [spec] §10.fig 16

type CdlProofParams

type CdlProofParams struct {
	Curve                      elliptic.Curve
	Pi, Qi, H1, H2, ScalarX, N *big.Int
}

CdlProofParams encapsulates parameters for ProveCompositeDL in Fig.16 Curve contains EC group generator g and EC group modulus q Pi, Qi are small p_i, q_i s.t. P_i = 2p_i+1, Q_i = 2q_i+1, which are Safe Primes ScalarX is a random element from Z_N~ and it should be kept as secret N is the field modulus

func (CdlProofParams) Prove

func (p CdlProofParams) Prove() (*CdlProof, error)

Prove generates a CdlProof as specified in [spec] §10.fig 16

type CdlVerifyParams

type CdlVerifyParams struct {
	Curve     elliptic.Curve
	H1, H2, N *big.Int
}

type PdlProof

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

PdlProof is the proof generated in [spec] fig 14

func (PdlProof) MarshalJSON

func (pdlp PdlProof) MarshalJSON() ([]byte, error)

func (*PdlProof) UnmarshalJSON

func (pdlp *PdlProof) UnmarshalJSON(bytes []byte) error

func (PdlProof) Verify

func (p PdlProof) Verify(pv *PdlVerifyParams) error

Verify checks the PdlProof as specified in [spec] fig 14

type PdlProofParams

type PdlProofParams struct {
	Curve               elliptic.Curve
	DealerParams        *dealer.ProofParams
	Pk                  *paillier.PublicKey
	ScalarX, ScalarR, C *big.Int
	PointX, PointR      *curves.EcPoint
}

PdlProofParams encapsulates the parameters for ProvePDL in [spec] fig 14

func (PdlProofParams) Prove

func (p PdlProofParams) Prove() (*PdlProof, error)

Prove generates a PdlProof as specified in [spec] fig 14

type PdlVerifyParams

type PdlVerifyParams struct {
	Curve          elliptic.Curve
	DealerParams   *dealer.ProofParams
	Pk             *paillier.PublicKey
	PointX, PointR *curves.EcPoint
	C              *big.Int
}

PdlVerifyParams encapsulates the parameters for VerifyPDL in [spec] fig 14

type Proof1Params

type Proof1Params struct {
	Curve        elliptic.Curve
	Pk           *paillier.PublicKey
	DealerParams *dealer.ProofParams
	A, C, R      *big.Int
}

Proof1Params encapsulates the values over which a range proof (1) is computed. [spec] fig 10

func (Proof1Params) Prove

func (pp Proof1Params) Prove() (*Range1Proof, error)

Prove computes a range proof over these parameters [spec] fig 10: MtaProveRange1

type Range1Proof

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

Range1Proof encapsulates the results returned in proof (1) [spec] fig 10

func (Range1Proof) MarshalJSON

func (r Range1Proof) MarshalJSON() ([]byte, error)

MarshalJSON converts Range1Proof into JSON

func (*Range1Proof) UnmarshalJSON

func (r *Range1Proof) UnmarshalJSON(bytes []byte) error

UnmarshalJSON converts json into a Range1Proof

func (Range1Proof) Verify

func (pi Range1Proof) Verify(pp *Proof1Params) error

Verify checks a range (1) proof: [spec] §7.fig 7: MtaVerifyRange1

type Range2Proof

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

Range2Proof encapsulates the values over which a range proof (2) is computed. [spec] fig 12

func (Range2Proof) MarshalJSON

func (rP2 Range2Proof) MarshalJSON() ([]byte, error)

MarshalJSON converts Range2Proof into JSON format

func (*Range2Proof) UnmarshalJSON

func (rP2 *Range2Proof) UnmarshalJSON(bytes []byte) error

UnmarshalJSON converts json into a Range2Proof

func (Range2Proof) Verify

func (pi Range2Proof) Verify(pp *verifyProof2Params) error

Verify checks a range (2) proof: [spec] §7.fig 9: MtaVerifyRange2

func (Range2Proof) VerifyWc

func (pi Range2Proof) VerifyWc(pp *verifyProof2Params) error

VerifyWc checks a range (2) proof: [spec] §7.fig 9: MtaVerifyRange2_wc

type ResponseFinalizer

type ResponseFinalizer interface {
	Finalize(vp *ResponseVerifyParams) (*big.Int, error)
	FinalizeWc(vp *ResponseVerifyParams) (*big.Int, error)
}

ResponseFinalizer captures the interface provided by a response proof [spec] fig 13

type ResponseProof

type ResponseProof struct {
	R2proof  *Range2Proof
	C2, Beta *big.Int
}

ResponseProof encapsulates the values over which a range proof (2) is computed and a portion of the random value is encrypted [spec] §7.fig 8

func (ResponseProof) Finalize

func (rp ResponseProof) Finalize(vp *ResponseVerifyParams) (*big.Int, error)

Finalize checks a range (2) proof: [spec] fig 13: MtaFinalize and returns the paillier encrypted random value

func (ResponseProof) FinalizeWc

func (rp ResponseProof) FinalizeWc(vp *ResponseVerifyParams) (*big.Int, error)

FinalizeWc checks a range (2) proof: [spec] fig 13: MtaFinalize_wc and returns the paillier encrypted random value

type ResponseProofParams

type ResponseProofParams struct {
	Curve        elliptic.Curve
	DealerParams *dealer.ProofParams
	Pk           *paillier.PublicKey
	SmallB, C1   *big.Int
	B            *curves.EcPoint
}

ResponseProofParams encapsulates the values over which a range proof (2) is computed. [spec] §7.fig 8

func (ResponseProofParams) Prove

func (rp ResponseProofParams) Prove() (*ResponseProof, error)

Prove computes a range proof over these parameters [spec] fig 11: MtaResponse

func (ResponseProofParams) ProveWc

func (rp ResponseProofParams) ProveWc() (*ResponseProof, error)

ProveWc computes: [spec] fig 11: MtaResponse_wc

type ResponseVerifyParams

type ResponseVerifyParams struct {
	Curve        elliptic.Curve
	DealerParams *dealer.ProofParams
	Sk           *paillier.SecretKey
	C1           *big.Int
	B            *curves.EcPoint
}

ResponseVerifyParams encapsulates the values over which a range proof (2) is verified. [spec] §7.fig 10

Jump to

Keyboard shortcuts

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