provisions

package
v0.0.0-...-7ad0b1f Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetsProofMachine

type AssetsProofMachine struct {

	// This is the anonymity set PK in the paper, !(privkey == nil) => s_i = 0
	// We don't use a privkey set because we are going to want to index by pubkey a lot
	PubKeyAnonSet map[*ecdsa.PublicKey]*ecdsa.PrivateKey

	BalanceRetreiver func(pubkey *ecdsa.PublicKey) (balance uint64, err error)
	// contains filtered or unexported fields
}

AssetsProofMachine is the state machine that is used to create a privacy preserving proof of assets

func NewAssetsProofMachine

func NewAssetsProofMachine(curve elliptic.Curve) (machine *AssetsProofMachine, err error)

NewAssetsProofMachine creates a new state machine for the asset proof. TODO: Use the anonymity set choosing from the paper to initialize

func (*AssetsProofMachine) CalculateAssetCommitment

func (machine *AssetsProofMachine) CalculateAssetCommitment() (assetCommitment *zksigma.ECPoint, err error)

CalculateAssetCommitment calculates the commitment to the Z_Assets to Assets Are we sure on returning an ECPoint?

type BalProofMachine

type BalProofMachine struct {
	// contains filtered or unexported fields
}

BalProofMachine represents a single iteration of the proof of assets protocol, and is used to compute individual balance commitments, as well as calculate things like responses to challenges

func NewBalProofMachine

func NewBalProofMachine(curve elliptic.Curve) (machine *BalProofMachine, err error)

NewBalProofMachine creates a new balance proof machine

func (*BalProofMachine) SResponse

func (machine *BalProofMachine) SResponse(si bool) (rs *big.Int, err error)

SResponse generates the response r_(s_i) with the balance proof machine and si (s_i). The challenge must be set.

func (*BalProofMachine) SetChallenge

func (machine *BalProofMachine) SetChallenge(ci *big.Int) (err error)

SetChallenge sets the challenge so we can generate responses

func (*BalProofMachine) SetPrivKey

func (machine *BalProofMachine) SetPrivKey(privkey *ecdsa.PrivateKey) (err error)

SetPrivKey sets the private key for this iteration

Jump to

Keyboard shortcuts

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