rangeproof

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const N = 64

N is number of bits in range So amount will be between 0...2^(N-1)

Variables

View Source
var H = [32]byte{0x8b, 0x65, 0x59, 0x70, 0x15, 0x37, 0x99, 0xaf, 0x2a, 0xea, 0xdc, 0x9f, 0xf1, 0xad, 0xd0, 0xea, 0x6c, 0x72, 0x51, 0xd5, 0x41, 0x54, 0xcf, 0xa9, 0x2c, 0x17, 0x3a, 0x0d, 0xd3, 0x9c, 0x1f, 0x94}

H is The other basepoint for use in Pedersen Commitments H = G.HashToEC(), where G is the basepoint

View Source
var M = 1

M is the number of outputs for one bulletproof

Functions

func Verify

func Verify(p Proof) (bool, error)

Verify takes a bullet proof and returns true only if the proof was valid

Types

type BitCommitment

type BitCommitment struct {
	AL, AR []ristretto.Scalar
}

BitCommitment will be a struct used to hold the values aL and aR

func BitCommit

func BitCommit(v *big.Int) BitCommitment

BitCommit will take the value v producing aL and aR N.B. This has been specialised for N <= 64

func (*BitCommitment) Debug

func (b *BitCommitment) Debug(v *big.Int) error

Debug makes sure we have calculated the correct aR and aL values

type Proof

type Proof struct {
	V        []pedersen.Commitment // Curve points 32 bytes
	Blinders []ristretto.Scalar
	A        ristretto.Point // Curve point 32 bytes
	S        ristretto.Point // Curve point 32 bytes
	T1       ristretto.Point // Curve point 32 bytes
	T2       ristretto.Point // Curve point 32 bytes

	IPProof *innerproduct.Proof
	// contains filtered or unexported fields
}

Proof is the constructed BulletProof

func Prove

func Prove(v []ristretto.Scalar, debug bool) (Proof, error)

Prove will take a set of scalars as a parameter and prove that it is [0, 2^N)

func (*Proof) Decode

func (p *Proof) Decode(r io.Reader, includeCommits bool) error

func (*Proof) Encode

func (p *Proof) Encode(w io.Writer, includeCommits bool) error

func (*Proof) Equals

func (p *Proof) Equals(other Proof, includeCommits bool) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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