pedersen

package
v0.0.0-...-eab8366 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Committer

type Committer struct {
	Params     *Params
	Commitment *big.Int
	// contains filtered or unexported fields
}

func NewCommitter

func NewCommitter(pedersenParams *Params) *Committer

func (*Committer) GetCommitMsg

func (c *Committer) GetCommitMsg(val *big.Int) (*big.Int, error)

It receives a value x (to this value a commitment is made), chooses a random x, outputs c = g^x * g^r.

func (*Committer) GetDecommitMsg

func (c *Committer) GetDecommitMsg() (*big.Int, *big.Int)

It returns values x and r (commitment was c = g^x * g^r).

func (*Committer) VerifyTrapdoor

func (c *Committer) VerifyTrapdoor(trapdoor *big.Int) bool

type Params

type Params struct {
	Group *schnorr.Group
	H     *big.Int
	// contains filtered or unexported fields
}

func GenerateParams

func GenerateParams(bitLengthGroupOrder int) (*Params, error)

func NewParams

func NewParams(group *schnorr.Group, H, a *big.Int) *Params

type Receiver

type Receiver struct {
	Params *Params
	// contains filtered or unexported fields
}

func NewReceiver

func NewReceiver(bitLengthGroupOrder int) (*Receiver, error)

func NewReceiverFromParams

func NewReceiverFromParams(params *Params) *Receiver

func (*Receiver) CheckDecommitment

func (r *Receiver) CheckDecommitment(R, val *big.Int) bool

When receiver receives a decommitment, CheckDecommitment verifies it against the stored value (stored by SetCommitment).

func (*Receiver) GetTrapdoor

func (r *Receiver) GetTrapdoor() *big.Int

func (*Receiver) SetCommitment

func (r *Receiver) SetCommitment(el *big.Int)

When receiver receives a commitment, it stores the value using SetCommitment method.

Jump to

Keyboard shortcuts

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