Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCommitments ¶
func EncodeCommitments(w io.Writer, comms []Commitment) error
Types ¶
type Commitment ¶
type Commitment struct {
// Value is the point which has been commited to
Value ristretto.Point
// blinding factor is the blinding scalar.
// Note that n vectors have 1 blinding factor
BlindingFactor ristretto.Scalar
}
Commitment represents a Pedersen Commitment storing the value and the random blinding factor
func DecodeCommitments ¶
func DecodeCommitments(r io.Reader) ([]Commitment, error)
func (*Commitment) EqualValue ¶
func (c *Commitment) EqualValue(other Commitment) bool
func (*Commitment) Equals ¶
func (c *Commitment) Equals(other Commitment) bool
type Pedersen ¶
type Pedersen struct {
BaseVector *generator.Generator
GenData []byte
BlindPoint ristretto.Point
BasePoint ristretto.Point
}
Pedersen represents a pedersen struct which holds the necessary information to commit a vector or a scalar to a point
func New ¶
New will setup the BaseVector returning a Pedersen struct genData is the byte slice, that will be used to form the unique set of generators
func (*Pedersen) CommitToScalar ¶
func (p *Pedersen) CommitToScalar(v ristretto.Scalar) Commitment
CommitToScalar generates a Commitment to a scalar v, s.t. V = v * Base + blind * BlindingPoint
func (*Pedersen) CommitToVectors ¶
func (p *Pedersen) CommitToVectors(vectors ...[]ristretto.Scalar) Commitment
CommitToVectors will take n set of vectors and form a commitment to them s.t. V = aH + <v1, G1> + <v2, G2> + <v3, G3> where a is a scalar, v1 is a vector of scalars, and G1 is a vector of points
Click to show internal directories.
Click to hide internal directories.