kzg

package
v0.0.0-...-23080a6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTestingSetup

func GenerateTestingSetup(secret string, n uint64) ([]gmcl.G1, []gmcl.G2)

GenerateTestingSetup creates a setup of n values from the given secret. **for testing purposes only**

Types

type KZG1Settings

type KZG1Settings struct {

	// setup values
	// [b.multiply(b.G1, pow(s, i, MODULUS)) for i in range(WIDTH+1)],
	PK []gmcl.G1
	// [b.multiply(b.G2, pow(s, i, MODULUS)) for i in range(WIDTH+1)],
	VK []gmcl.G2
}

func NewKZG1Settings

func NewKZG1Settings(pk []gmcl.G1, vk []gmcl.G2) *KZG1Settings

func (*KZG1Settings) CheckProofSingle

func (ks *KZG1Settings) CheckProofSingle(commitment *gmcl.G1, proof *gmcl.G1, x *gmcl.Fr, y *gmcl.Fr) bool

Check a proof for a KZG commitment for an evaluation f(x) = y

func (*KZG1Settings) CommitToPoly

func (ks *KZG1Settings) CommitToPoly(coeffs []gmcl.Fr) *gmcl.G1

KZG commitment to polynomial in coefficient form

func (*KZG1Settings) ComputeProofSingle

func (ks *KZG1Settings) ComputeProofSingle(poly []gmcl.Fr, x *gmcl.Fr) (*gmcl.G1, *gmcl.Fr)

Compute KZG proof for polynomial in coefficient form at position x

type KZG2Settings

type KZG2Settings struct {

	// setup values
	// [b.multiply(b.G1, pow(s, i, MODULUS)) for i in range(WIDTH+1)],
	PK []gmcl.G2
	// [b.multiply(b.G2, pow(s, i, MODULUS)) for i in range(WIDTH+1)],
	VK []gmcl.G1
}

func NewKZG2Settings

func NewKZG2Settings(pk []gmcl.G2, vk []gmcl.G1) *KZG2Settings

func (*KZG2Settings) CheckProofSingle

func (ks *KZG2Settings) CheckProofSingle(commitment *gmcl.G2, proof *gmcl.G2, x *gmcl.Fr, y *gmcl.Fr) bool

Check a proof for a KZG commitment for an evaluation f(x) = y

func (*KZG2Settings) CommitToPoly

func (ks *KZG2Settings) CommitToPoly(coeffs []gmcl.Fr) *gmcl.G2

KZG commitment to polynomial in coefficient form

func (*KZG2Settings) ComputeProofSingle

func (ks *KZG2Settings) ComputeProofSingle(poly []gmcl.Fr, x *gmcl.Fr) (*gmcl.G2, *gmcl.Fr)

Compute KZG proof for polynomial in coefficient form at position x

Jump to

Keyboard shortcuts

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