bulletproofs

package
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertUint64ToBinary

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

ConvertUint64ToBinary represents a integer number in binary.

func GetFirstAssetTag

func GetFirstAssetTag(coins []*coin.CoinV2) (*crypto.Point, error)

GetFirstAssetTag returns the first asset tag of a list out CoinV2's.

Types

type InnerProductProof

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

InnerProductProof represents an inner-product proof. It is used as a sub-proof for a RangeProof.

func (InnerProductProof) Bytes

func (proof InnerProductProof) Bytes() []byte

Bytes returns the byte-representation of an InnerProductProof.

func (*InnerProductProof) Init

func (proof *InnerProductProof) Init() *InnerProductProof

Init creates an empty InnerProductProof.

func (*InnerProductProof) SetBytes

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

SetBytes sets byte-representation data to an InnerProductProof.

type InnerProductWitness

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

InnerProductWitness represents a witness for an inner-product proof, described in the Bulletproofs paper.

func (InnerProductWitness) Prove

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

Prove returns an InnerProductProof for an InnerProductWitness.

type RangeProof

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

RangeProof represents a Bulletproofs proof.

func (RangeProof) Bytes

func (proof RangeProof) Bytes() []byte

Bytes returns the byte-representation of a RangeProof.

func (RangeProof) GetCommitments

func (proof RangeProof) GetCommitments() []*crypto.Point

GetCommitments returns the commitments of a RangeProof.

func (*RangeProof) Init

func (proof *RangeProof) Init()

Init creates an empty RangeProof.

func (RangeProof) IsNil

func (proof RangeProof) IsNil() bool

IsNil checks if a RangeProof is empty.

func (*RangeProof) SetBytes

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

SetBytes sets byte-representation data to a RangeProof.

func (*RangeProof) SetCommitments

func (proof *RangeProof) SetCommitments(v []*crypto.Point)

SetCommitments sets v as the commitments of a RangeProof.

type Witness

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

Witness represents a Bulletproofs witness.

func TransformWitnessToCAWitness

func TransformWitnessToCAWitness(wit *Witness, assetTagBlinders []*crypto.Scalar) (*Witness, error)

TransformWitnessToCAWitness transforms a regular Witness into a new Witness used in confidential assets, given the asset tag blinders.

func (Witness) Prove

func (wit Witness) Prove() (*RangeProof, error)

Prove returns the RangeProof for a Witness.

func (Witness) ProveUsingBase

func (wit Witness) ProveUsingBase(b *crypto.Point) (*RangeProof, error)

ProveUsingBase returns a RangeProof for a Witness created using the base point v.

func (*Witness) Set

func (wit *Witness) Set(values []uint64, rands []*crypto.Scalar)

Set sets parameters for a Witness.

Jump to

Keyboard shortcuts

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