zkmul

package
v0.6.0-alpha-20...-5109cf1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commitment

type Commitment struct {
	// A = α ⊙ Y % ρ
	A *paillier.Ciphertext
	// B = Enc(α;s)
	B *paillier.Ciphertext
}

type Private

type Private struct {
	// X = x is the plaintext of Public.X.
	X *safenum.Int

	// Rho = ρ is the nonce for Public.C.
	Rho *safenum.Nat

	// RhoX = ρₓ is the nonce for Public.X
	RhoX *safenum.Nat
}

type Proof

type Proof struct {
	*Commitment
	// Z = α + ex
	Z *safenum.Int
	// U = r⋅ρᵉ mod N
	U *safenum.Nat
	// V = s⋅ρₓᵉ
	V *safenum.Nat
}

func NewProof

func NewProof(group curve.Curve, hash *hash.Hash, public Public, private Private) *Proof

func (*Proof) IsValid

func (p *Proof) IsValid(public Public) bool

func (*Proof) Verify

func (p *Proof) Verify(group curve.Curve, hash *hash.Hash, public Public) bool

type Public

type Public struct {
	// X = Enc(x; ρₓ)
	X *paillier.Ciphertext

	// Y is a ciphertext over the prover's public key
	Y *paillier.Ciphertext

	// C = x ⊙ Y % ρ
	C *paillier.Ciphertext

	// Prover = N
	Prover *paillier.PublicKey
}

Jump to

Keyboard shortcuts

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