zkp

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PDLwSlackMarshalledParts = 11
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DLogProof

type DLogProof struct {
	Alpha *crypto.ECPoint
	T     *big.Int
}

Schnorr ZK of the discrete logarithm of pho_i such that A = g^pho (GG18)

func NewDLogProof

func NewDLogProof(x *big.Int, X *crypto.ECPoint) (*DLogProof, error)

NewDLogProof constructs a new Schnorr ZK of the discrete logarithm of pho_i such that A = g^pho (GG18)

func (*DLogProof) ValidateBasic

func (pf *DLogProof) ValidateBasic() bool

func (*DLogProof) Verify

func (pf *DLogProof) Verify(X *crypto.ECPoint) bool

NewDLogProof verifies a new Schnorr ZK proof of knowledge of the discrete logarithm (GG18Spec Fig. 16)

type ECDDHProof

type ECDDHProof struct {
	A1, A2 *crypto.ECPoint
	Z      *big.Int
}

func NewECDDHProof

func NewECDDHProof(wit ECDDHWitness, st ECDDHStatement) ECDDHProof

func NewECSigmaIProof

func NewECSigmaIProof(curve elliptic.Curve, sigmaI *big.Int, R, SI *crypto.ECPoint) (*ECDDHProof, error)

func (*ECDDHProof) Verify

func (pf *ECDDHProof) Verify(st ECDDHStatement) bool

func (*ECDDHProof) VerifySigmaI

func (pf *ECDDHProof) VerifySigmaI(curve elliptic.Curve, gSigmaI, R, SI *crypto.ECPoint) bool

type ECDDHStatement

type ECDDHStatement struct {
	Curve elliptic.Curve
	G2,
	H1, H2 *crypto.ECPoint
}

type ECDDHWitness

type ECDDHWitness struct {
	X *big.Int
}

type PDLwSlackProof

type PDLwSlackProof struct {
	Z  *big.Int
	U1 *crypto.ECPoint
	U2, U3,
	S1, S2, S3 *big.Int
}

func UnmarshalPDLwSlackProof

func UnmarshalPDLwSlackProof(bzs [][]byte) (*PDLwSlackProof, error)

func (PDLwSlackProof) Marshal

func (pf PDLwSlackProof) Marshal() ([][]byte, error)

func (PDLwSlackProof) Verify

func (pf PDLwSlackProof) Verify(st PDLwSlackStatement) bool

type PDLwSlackStatement

type PDLwSlackStatement struct {
	CipherText     *big.Int
	PK             *paillier.PublicKey
	Q, G           *crypto.ECPoint
	H1, H2, NTilde *big.Int
}

type PDLwSlackWitness

type PDLwSlackWitness struct {
	X, R *big.Int
	SK   *paillier.PrivateKey
}

type STProof

type STProof struct {
	Alpha, Beta *crypto.ECPoint
	T, U        *big.Int
}

ZK proof for knowledge of sigma_i, l_i such that S_i = R^sigma_i, T_i = g^sigma_i h^l_i (GG20)

func NewSTProof

func NewSTProof(TI, R, h *crypto.ECPoint, sigmaI, lI *big.Int) (*STProof, error)

NewSTProof constructs a new ZK proof of knowledge sigma_i, l_i such that S_i = R^sigma_i, T_i = g^sigma_i h^l_i (GG20)

func (*STProof) ValidateBasic

func (pf *STProof) ValidateBasic() bool

func (*STProof) Verify

func (pf *STProof) Verify(SI, TI, R, h *crypto.ECPoint) bool

type TProof

type TProof struct {
	Alpha *crypto.ECPoint
	T, U  *big.Int
}

ZK proof of knowledge of sigma_i, l_i such that T_i = g^sigma_i, h^l_i (GG20)

func NewTProof

func NewTProof(TI, h *crypto.ECPoint, sigmaI, lI *big.Int) (*TProof, error)

NewTProof constructs a new ZK proof of knowledge sigma_i, l_i such that T_i = g^sigma_i, h^l_i (GG20)

func (*TProof) ValidateBasic

func (pf *TProof) ValidateBasic() bool

func (*TProof) Verify

func (pf *TProof) Verify(TI, h *crypto.ECPoint) bool

Jump to

Keyboard shortcuts

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