zkencelg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 8 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 {
	// S = sˣtᵘ
	S *safenum.Nat
	// D = Enc(α, r)
	D *paillier.Ciphertext
	// Y = β⋅A+α⋅G
	Y curve.Point
	// Z = β⋅G
	Z curve.Point
	// C = sᵃtᵍ
	T *safenum.Nat
}

type Private

type Private struct {
	// X = x = Dec(C)
	X *safenum.Int

	// Rho = ρ = Nonce(C)
	Rho *safenum.Nat

	// A = a
	A curve.Scalar
	// B = b
	B curve.Scalar
}

type Proof

type Proof struct {
	*Commitment
	// Z1 = z₁ = α + ex
	Z1 *safenum.Int
	// W = w = β + eb (mod q)
	W curve.Scalar
	// Z2 = z₂ = r⋅ρᵉ (mod N₀)
	Z2 *safenum.Nat
	// Z3 = z₃ = γ + eμ
	Z3 *safenum.Int
	// contains filtered or unexported fields
}

func Empty

func Empty(group curve.Curve) *Proof

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(hash *hash.Hash, public Public) bool

type Public

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

	// A = a⋅G
	A curve.Point
	// B = b⋅G
	B curve.Point
	// X = (ab+x)⋅G
	X curve.Point

	Prover *paillier.PublicKey
	Aux    *pedersen.Parameters
}

Jump to

Keyboard shortcuts

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