zknth

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 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 *saferith.Nat
}

type Private

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

type Proof

type Proof struct {
	Commitment
	// Z = αρᴺ (mod N²)
	Z *saferith.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 *saferith.Nat
}

Jump to

Keyboard shortcuts

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