zkaffp

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 {
	// A = (α ⊙ Kv) ⊕ Enc₀(β; ρ)
	A *paillier.Ciphertext
	// Bx = Enc₁(α;ρₓ)
	Bx *paillier.Ciphertext
	// By = Enc₁(β;ρy)
	By *paillier.Ciphertext
	// E = sᵃ tᵍ (mod N)
	E *saferith.Nat
	// S = sˣ tᵐ (mod N)
	S *saferith.Nat
	// F = sᵇ tᵈ (mod N)
	F *saferith.Nat
	// T = sʸ tᵘ (mod N)
	T *saferith.Nat
}

type Private

type Private struct {
	// X ∈ ± 2ˡ
	X *saferith.Int
	// Y ∈ ± 2ˡº
	Y *saferith.Int
	// S = s
	// Original name: ρ
	S *saferith.Nat
	// Rx = rₓ
	// Original name: ρx
	Rx *saferith.Nat
	// R = r
	// Original name: ρy
	R *saferith.Nat
}

type Proof

type Proof struct {
	*Commitment
	// Z1 = Z₁ = α+ex
	Z1 *saferith.Int
	// Z2 = Z₂ = β+ey
	Z2 *saferith.Int
	// Z3 = Z₃ = γ+em
	Z3 *saferith.Int
	// Z4 = Z₄ = δ+eμ
	Z4 *saferith.Int
	// W = w = ρ⋅sᵉ (mod N₀)
	W *saferith.Nat
	// Wx = wₓ = ρₓ⋅rₓᵉ (mod N₁)
	Wx *saferith.Nat
	// Wy = wy = ρy ⋅rᵉ (mod N₁)
	Wy *saferith.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 {
	// Kv is a ciphertext encrypted with Nᵥ
	// Original name: C
	Kv *paillier.Ciphertext

	// Dv = (x ⨀ Kv) ⨁ Encᵥ(y;s)
	Dv *paillier.Ciphertext

	// Fp = Encₚ(y;r)
	// Original name: Y
	Fp *paillier.Ciphertext

	// Xp = Encₚ(x;rₓ)
	Xp *paillier.Ciphertext

	// Prover = N₁
	// Verifier = N₀
	Prover, Verifier *paillier.PublicKey
	Aux              *pedersen.Parameters
}

Jump to

Keyboard shortcuts

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