bulletproofs

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

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package bulletproofs manages the creation, proving & verification of Bulletproofs. This is a class of compact-sized range proof that require no trusted setup.

to match names in the crypto protocol

Index

Constants

This section is empty.

Variables

View Source
var AggParam = newBulletproofParams(privacy_util.MaxOutputCoin)
View Source
var Logger = logger{}

Global instant to use

Functions

func ConvertUint64ToBinary

func ConvertUint64ToBinary(number uint64, n int) []*operation.Scalar

ConvertIntToBinary represents a integer number in binary

func CopyPedersenCommitmentScheme

func CopyPedersenCommitmentScheme(sch operation.PedersenCommitment) operation.PedersenCommitment

CopyPedersenCommitmentScheme is called upon package initialization to make a clone of generators.

func EstimateMultiRangeProofSize

func EstimateMultiRangeProofSize(nOutput int) uint64

EstimateMultiRangeProofSize returns the upper bound of Bulletproof size given the number of output coins.

func VerifyBatch

func VerifyBatch(proofs []*AggregatedRangeProof) (bool, error, int)

VerifyBatch verifies a list of Bulletproofs in batched fashion. It saves time by using a multi-exponent operation.

Types

type AggregatedRangeProof

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

AggregatedRangeProof is the struct for Bulletproof. The statement being proven is that output coins' values are in the uint64 range.

func (AggregatedRangeProof) Bytes

func (proof AggregatedRangeProof) Bytes() []byte

Bytes does byte-marshalling

func (AggregatedRangeProof) GetCommitments

func (proof AggregatedRangeProof) GetCommitments() []*operation.Point

GetCommitments is the getter for cmsValueGetCommitments() []*operation.Point

func (*AggregatedRangeProof) Init

func (proof *AggregatedRangeProof) Init()

Init creates an allocated, blank AggregatedRangeProof object

func (AggregatedRangeProof) IsNil

func (proof AggregatedRangeProof) IsNil() bool

IsNil returns true if any field in this proof is nil

func (*AggregatedRangeProof) SetBytes

func (proof *AggregatedRangeProof) SetBytes(bytes []byte) error

func (*AggregatedRangeProof) SetCommitments

func (proof *AggregatedRangeProof) SetCommitments(cmsValue []*operation.Point)

func (AggregatedRangeProof) ValidateSanity

func (proof AggregatedRangeProof) ValidateSanity() bool

ValidateSanity performs sanity checks for this proof.

func (AggregatedRangeProof) Verify

func (proof AggregatedRangeProof) Verify() (bool, error)

Verify does verification for this Bulletproof. No view into chain data is needed.

func (AggregatedRangeProof) VerifyFaster

func (proof AggregatedRangeProof) VerifyFaster() (bool, error)

func (AggregatedRangeProof) VerifyFasterUsingBase

func (proof AggregatedRangeProof) VerifyFasterUsingBase(anAssetTag *operation.Point) (bool, error)

func (AggregatedRangeProof) VerifyUsingBase

func (proof AggregatedRangeProof) VerifyUsingBase(anAssetTag *operation.Point) (bool, error)

VerifyUsingBase runs like the Bulletproof Verify function, except it sets a Pederson base point before verifying.

type AggregatedRangeWitness

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

AggregatedRangeWitness contains the prover's secret data (the actual values to be proven & the generated random blinders) needed for creating a range proof.

func TransformWitnessToCAWitness

func TransformWitnessToCAWitness(wit *AggregatedRangeWitness, assetTagBlinders []*operation.Scalar) (*AggregatedRangeWitness, error)

TransformWitnessToCAWitness does base transformation. Our Bulletproof(G_r) scheme is parameterized by a base G_r. PRV transfers' Bulletproofs use a fixed N.U.M.S point for G_r.

Confidential Asset transfers use G_r = G_at, which is a blinded asset tag. This function will return a suitable witness for Bulletproof(G_at).

func (AggregatedRangeWitness) Prove

func (AggregatedRangeWitness) ProveUsingBase

func (wit AggregatedRangeWitness) ProveUsingBase(anAssetTag *operation.Point) (*AggregatedRangeProof, error)

ProveUsingBase runs like the Bulletproof Prove function, except it sets a Pederson base point before proving.

func (*AggregatedRangeWitness) Set

func (wit *AggregatedRangeWitness) Set(values []uint64, rands []*operation.Scalar)

type InnerProductProof

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

func (InnerProductProof) Bytes

func (proof InnerProductProof) Bytes() []byte

func (*InnerProductProof) Init

func (proof *InnerProductProof) Init() *InnerProductProof

func (*InnerProductProof) SetBytes

func (proof *InnerProductProof) SetBytes(bytes []byte) error

func (InnerProductProof) ValidateSanity

func (proof InnerProductProof) ValidateSanity() bool

func (InnerProductProof) Verify

func (proof InnerProductProof) Verify(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, hashCache []byte) bool

func (InnerProductProof) VerifyFaster

func (proof InnerProductProof) VerifyFaster(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, hashCache []byte) bool

type InnerProductWitness

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

func (InnerProductWitness) Prove

func (wit InnerProductWitness) Prove(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, hashCache []byte) (*InnerProductProof, error)

Jump to

Keyboard shortcuts

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