Documentation ¶
Index ¶
- func IsOnCurve(x, y *big.Int) bool
- func RandomZq(n int) ([]*big.Int, error)
- func SetBytes(b []byte) (*bn256.G1, error)
- func ToBytes(g *bn256.G1) []byte
- type Address
- type Commitment
- func (c *Commitment) Add(a, b *Commitment) *Commitment
- func (c *Commitment) AddBy(a *Commitment) *Commitment
- func (c *Commitment) AddGenerator(g *Generator) *Commitment
- func (c *Commitment) Bytes() []byte
- func (c *Commitment) Cmp(cm *Commitment) bool
- func (c *Commitment) FixedSet(g *Generator, h *Generator, v *big.Int, r *big.Int) *Commitment
- func (c *Commitment) Mul(cm *Commitment, k *big.Int) *Commitment
- func (c *Commitment) MulBy(k *big.Int) *Commitment
- func (c *Commitment) MultiSet(g []*Generator, v []*big.Int) (*Commitment, error)
- func (c *Commitment) MultiSetRandom(g []*Generator) (*Commitment, []*big.Int, error)
- func (c *Commitment) Neg() *Commitment
- func (c *Commitment) Set(g *Generator, h *Generator, v *big.Int) (*Commitment, *big.Int, error)
- func (c *Commitment) SetBytes(b []byte) *Commitment
- func (c *Commitment) SetInt(k *big.Int) *Commitment
- func (c *Commitment) SetIntByGenerator(g *Generator, k *big.Int) *Commitment
- func (c *Commitment) X() *big.Int
- func (c *Commitment) Y() *big.Int
- type Generator
- func (g *Generator) Bytes() []byte
- func (g *Generator) Init(k *big.Int) *Generator
- func (g *Generator) Mul(a *Generator, k *big.Int) *Generator
- func (g *Generator) MulBy(k *big.Int) *Generator
- func (g *Generator) Random() (*Generator, *big.Int, error)
- func (g *Generator) SetBytes(b []byte) *Generator
- func (g *Generator) X() *big.Int
- func (g *Generator) Y() *big.Int
- type Hash
- type HashVariable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commitment ¶
Commitment is the alias of bn256.G1 represent of the Pedersen Commitment
func (*Commitment) Add ¶
func (c *Commitment) Add(a, b *Commitment) *Commitment
Add sets c to a+b and returns c
func (*Commitment) AddBy ¶
func (c *Commitment) AddBy(a *Commitment) *Commitment
AddBy sets c to c+a and returns c
func (*Commitment) AddGenerator ¶
func (c *Commitment) AddGenerator(g *Generator) *Commitment
AddGenerator sets c to c+a and returns c
func (*Commitment) Cmp ¶
func (c *Commitment) Cmp(cm *Commitment) bool
Cmp return whether c and cm is the same Commitment
func (*Commitment) FixedSet ¶
func (c *Commitment) FixedSet(g *Generator, h *Generator, v *big.Int, r *big.Int) *Commitment
FixedSet sets c to vg+rh returns c, r, err
func (*Commitment) Mul ¶
func (c *Commitment) Mul(cm *Commitment, k *big.Int) *Commitment
Mul sets c to kc and returns c
func (*Commitment) MulBy ¶
func (c *Commitment) MulBy(k *big.Int) *Commitment
MulBy sets c to kc and returns c
func (*Commitment) MultiSet ¶
func (c *Commitment) MultiSet(g []*Generator, v []*big.Int) (*Commitment, error)
MultiSet sets c to sum(gv), returns c, err
func (*Commitment) MultiSetRandom ¶
func (c *Commitment) MultiSetRandom(g []*Generator) (*Commitment, []*big.Int, error)
MultiSetRandom sets c to sum(gv) which v is a set of random numbers, returns c, v, err
func (*Commitment) Set ¶
func (c *Commitment) Set(g *Generator, h *Generator, v *big.Int) (*Commitment, *big.Int, error)
Set sets c to vg+rh with random r, returns c, r, err
func (*Commitment) SetBytes ¶
func (c *Commitment) SetBytes(b []byte) *Commitment
SetBytes sets c to the result of converting the output of Marshal back into a group element and then returns c
func (*Commitment) SetIntByGenerator ¶
func (c *Commitment) SetIntByGenerator(g *Generator, k *big.Int) *Commitment
SetIntByGenerator set c to gk
func (*Commitment) X ¶
func (c *Commitment) X() *big.Int
func (*Commitment) Y ¶
func (c *Commitment) Y() *big.Int
type Generator ¶
Generator is a curve generator
func RandomPoints ¶
RandomPoints returns n size of random number in Scalar
type HashVariable ¶
type HashVariable interface {
Bytes() []byte
}