mta

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ProofBobBytesParts   = 10
	ProofBobWCBytesParts = 12
)
View Source
const (
	RangeProofAliceBytesParts = 6
)

Variables

This section is empty.

Functions

func AliceEnd

func AliceEnd(
	Session []byte,
	ec elliptic.Curve,
	pkA *paillier.PublicKey,
	pf *ProofBob,
	h1A, h2A, cA, cB, NTildeA *big.Int,
	sk *paillier.PrivateKey,
) (*big.Int, error)

func AliceEndWC

func AliceEndWC(
	Session []byte,
	ec elliptic.Curve,
	pkA *paillier.PublicKey,
	pf *ProofBobWC,
	B *crypto.ECPoint,
	cA, cB, NTildeA, h1A, h2A *big.Int,
	sk *paillier.PrivateKey,
) (*big.Int, error)

Types

type ProofBob

type ProofBob struct {
	Z, ZPrm, T, V, W, S, S1, S2, T1, T2 *big.Int
}

func BobMid

func BobMid(
	Session []byte,
	ec elliptic.Curve,
	pkA *paillier.PublicKey,
	pf *RangeProofAlice,
	b, cA, NTildeA, h1A, h2A, NTildeB, h1B, h2B *big.Int,
	rand io.Reader,
) (beta, cB, betaPrm *big.Int, piB *ProofBob, err error)

func ProofBobFromBytes

func ProofBobFromBytes(bzs [][]byte) (*ProofBob, error)

func ProveBob

func ProveBob(Session []byte, ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int, rand io.Reader) (*ProofBob, error)

ProveBob implements Bob's proof "ProveMta_Bob" used in the MtA protocol from GG18Spec (9) Fig. 11.

func (*ProofBob) Bytes

func (pf *ProofBob) Bytes() [ProofBobBytesParts][]byte

func (*ProofBob) ValidateBasic

func (pf *ProofBob) ValidateBasic() bool

func (*ProofBob) Verify

func (pf *ProofBob) Verify(Session []byte, ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big.Int) bool

ProveBob.Verify implements verification of Bob's proof without check "VerifyMta_Bob" used in the MtA protocol from GG18Spec (9) Fig. 11.

type ProofBobWC

type ProofBobWC struct {
	*ProofBob
	U *crypto.ECPoint
}

func BobMidWC

func BobMidWC(
	Session []byte,
	ec elliptic.Curve,
	pkA *paillier.PublicKey,
	pf *RangeProofAlice,
	b, cA, NTildeA, h1A, h2A, NTildeB, h1B, h2B *big.Int,
	B *crypto.ECPoint,
	rand io.Reader,
) (beta, cB, betaPrm *big.Int, piB *ProofBobWC, err error)

func ProofBobWCFromBytes

func ProofBobWCFromBytes(ec elliptic.Curve, bzs [][]byte) (*ProofBobWC, error)

func ProveBobWC

func ProveBobWC(Session []byte, ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2, x, y, r *big.Int, X *crypto.ECPoint, rand io.Reader) (*ProofBobWC, error)

ProveBobWC implements Bob's proof both with or without check "ProveMtawc_Bob" and "ProveMta_Bob" used in the MtA protocol from GG18Spec (9) Figs. 10 & 11. an absent `X` generates the proof without the X consistency check X = g^x

func (*ProofBobWC) Bytes

func (pf *ProofBobWC) Bytes() [ProofBobWCBytesParts][]byte

func (*ProofBobWC) ValidateBasic

func (pf *ProofBobWC) ValidateBasic() bool

func (*ProofBobWC) Verify

func (pf *ProofBobWC) Verify(Session []byte, ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c1, c2 *big.Int, X *crypto.ECPoint) bool

ProveBobWC.Verify implements verification of Bob's proof with check "VerifyMtawc_Bob" used in the MtA protocol from GG18Spec (9) Fig. 10. an absent `X` verifies a proof generated without the X consistency check X = g^x

type RangeProofAlice

type RangeProofAlice struct {
	Z, U, W, S, S1, S2 *big.Int
}

func AliceInit

func AliceInit(
	ec elliptic.Curve,
	pkA *paillier.PublicKey,
	a, NTildeB, h1B, h2B *big.Int,
	rand io.Reader,
) (cA *big.Int, pf *RangeProofAlice, err error)

func ProveRangeAlice

func ProveRangeAlice(ec elliptic.Curve, pk *paillier.PublicKey, c, NTilde, h1, h2, m, r *big.Int, rand io.Reader) (*RangeProofAlice, error)

ProveRangeAlice implements Alice's range proof used in the MtA and MtAwc protocols from GG18Spec (9) Fig. 9.

func RangeProofAliceFromBytes

func RangeProofAliceFromBytes(bzs [][]byte) (*RangeProofAlice, error)

func (*RangeProofAlice) Bytes

func (*RangeProofAlice) ValidateBasic

func (pf *RangeProofAlice) ValidateBasic() bool

func (*RangeProofAlice) Verify

func (pf *RangeProofAlice) Verify(ec elliptic.Curve, pk *paillier.PublicKey, NTilde, h1, h2, c *big.Int) bool

Jump to

Keyboard shortcuts

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