util

package
v0.0.0-...-84e2b5b Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	G1 = new(bn256.G1).ScalarBaseMult(new(big.Int).SetInt64(1))
	G2 = new(bn256.G2).ScalarBaseMult(new(big.Int).SetInt64(1))
	E  = bn256.Pair(G1, G2)
)

Constants that are going to be used frequently, then we just need to compute them once.

Functions

func Commit

func Commit(x, r *big.Int, h *bn256.G2) (*bn256.G2, error)

Commit method corresponds to the Pedersen commitment scheme. Namely, given input message x, and randomness r, it outputs g^x.h^r.

func CommitG1

func CommitG1(x, r *big.Int, h *p256.P256) (*p256.P256, error)

CommitG1 method corresponds to the Pedersen commitment scheme. Namely, given input message x, and randomness r, it outputs g^x.h^r.

func Decompose

func Decompose(x *big.Int, u int64, l int64) ([]int64, error)

Decompose receives as input a bigint x and outputs an array of integers such that x = sum(xi.u^i), i.e. it returns the decomposition of x into base u.

func Hash

func Hash(a []*bn256.GT, D *bn256.G2) (*big.Int, error)

Hash is responsible for the computing a Zp element given elements from GT and G2.

func HashSet

func HashSet(a *bn256.GT, D *bn256.G2) (*big.Int, error)

HashSet is responsible for the computing a Zp element given elements from GT and G2.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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