zklogstar

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 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ᵘ (mod N)
	S *saferith.Nat
	// A = Enc₀(alpha; r)
	A *paillier.Ciphertext
	// Y = α⋅G
	Y curve.Point
	// D = sᵃ tᵍ (mod N)
	D *saferith.Nat
}

type Private

type Private struct {
	// X is the plaintext of C and the discrete log of X.
	X *saferith.Int

	// Rho = ρ is nonce used to encrypt C.
	Rho *saferith.Nat
}

type Proof

type Proof struct {
	*Commitment
	// Z1 = α + e x
	Z1 *saferith.Int
	// Z2 = r ρᵉ mod N
	Z2 *saferith.Nat
	// Z3 = γ + e μ
	Z3 *saferith.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;ρ)
	// Encryption of x under the prover's key
	C *paillier.Ciphertext

	// X = x⋅G
	X curve.Point

	// G is the base point of the curve.
	// If G = nil, the default base point is used.
	G 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