zknth

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: 6 Imported by: 0

Documentation

Overview

zknth is based on the zkenc package, and can be seen as the special case where the ciphertext encrypts the "0" value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commitment

type Commitment struct {
	// A = αᴺ (mod N²)
	A *safenum.Nat
}

type Private

type Private struct {
	// Rho = ρ
	Rho *safenum.Nat
}

type Proof

type Proof struct {
	Commitment
	// Z = αρᴺ (mod N²)
	Z *safenum.Nat
}

func NewProof

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

NewProof generates a proof that r = ρᴺ (mod N²).

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 {
	// N
	N *paillier.PublicKey

	// R = r = ρᴺ (mod N²)
	R *safenum.Nat
}

Jump to

Keyboard shortcuts

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