gurvy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Bits = 381 // number of bits needed to represent a Element

Variables

This section is empty.

Functions

func ExpandMsgXmd added in v0.1.0

func ExpandMsgXmd(msg, dst []byte, lenInBytes int, hashFunc func() hash.Hash) ([]byte, error)

ExpandMsgXmd expands msg to a slice of lenInBytes bytes. https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5 https://tools.ietf.org/html/rfc8017#section-4.1 (I2OSP/O2ISP)

func Hash added in v0.1.0

func Hash(msg, dst []byte, count int, hashFunc func() hash.Hash) ([]fp.Element, error)

Hash msg to count prime field elements. https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5.2

func HashToG1GenericBESwu added in v0.1.0

func HashToG1GenericBESwu(msg, dst []byte, hashFunc func() hash.Hash) (bls12381.G1Affine, error)

func SwuMapG1BE added in v0.3.0

func SwuMapG1BE(u *fp.Element) (fp.Element, fp.Element)

SwuMapG1BE is the big-endian-sign variant of the Simplified SWU map, following draft-irtf-cfrg-hash-to-curve-06 section 4.1.1. It reproduces, bit-for-bit, the output of the former kilic implementation.

Types

type Bls12_377 added in v0.1.0

type Bls12_377 struct {
	common.CurveBase
}

func NewBls12_377 added in v0.1.0

func NewBls12_377() *Bls12_377

func (*Bls12_377) CompressedG1ByteSize added in v0.1.0

func (c *Bls12_377) CompressedG1ByteSize() int

func (*Bls12_377) CompressedG2ByteSize added in v0.1.0

func (c *Bls12_377) CompressedG2ByteSize() int

func (*Bls12_377) CoordinateByteSize added in v0.1.0

func (c *Bls12_377) CoordinateByteSize() int

func (*Bls12_377) FExp added in v0.1.0

func (c *Bls12_377) FExp(a driver.Gt) driver.Gt

func (*Bls12_377) G1ByteSize added in v0.1.0

func (c *Bls12_377) G1ByteSize() int

func (*Bls12_377) G2ByteSize added in v0.1.0

func (c *Bls12_377) G2ByteSize() int

func (*Bls12_377) GenG1 added in v0.1.0

func (c *Bls12_377) GenG1() driver.G1

func (*Bls12_377) GenG2 added in v0.1.0

func (c *Bls12_377) GenG2() driver.G2

func (*Bls12_377) GenGt added in v0.1.0

func (c *Bls12_377) GenGt() driver.Gt

func (*Bls12_377) HashToG1 added in v0.1.0

func (c *Bls12_377) HashToG1(data []byte) driver.G1

func (*Bls12_377) HashToG1WithDomain added in v0.1.0

func (p *Bls12_377) HashToG1WithDomain(data, domain []byte) driver.G1

func (*Bls12_377) HashToG2 added in v0.1.0

func (c *Bls12_377) HashToG2(data []byte) driver.G2

func (*Bls12_377) HashToG2WithDomain added in v0.1.0

func (p *Bls12_377) HashToG2WithDomain(data, domain []byte) driver.G2

func (*Bls12_377) MultiScalarMul added in v0.1.0

func (c *Bls12_377) MultiScalarMul(a []driver.G1, b []driver.Zr) driver.G1

MultiScalarMul computes the sum of the scalar multiplications of the given bases by the given scalars via gnark's bucket-method MultiExp. MultiExp carries a fixed cost (window and chunk setup, goroutine fan-out) that a pairwise Mul2+Add loop does not, so for very small n a caller that knows its sizes may be better served by Mul/Mul2 directly; callers that care make that choice themselves, and this method does not second-guess them beyond the trivial n==0 and n==1 cases.

func (*Bls12_377) NewG1 added in v0.1.0

func (c *Bls12_377) NewG1() driver.G1

func (*Bls12_377) NewG1FromBytes added in v0.1.0

func (c *Bls12_377) NewG1FromBytes(b []byte) driver.G1

func (*Bls12_377) NewG1FromCompressed added in v0.1.0

func (c *Bls12_377) NewG1FromCompressed(b []byte) driver.G1

func (*Bls12_377) NewG2 added in v0.1.0

func (c *Bls12_377) NewG2() driver.G2

func (*Bls12_377) NewG2FromBytes added in v0.1.0

func (c *Bls12_377) NewG2FromBytes(b []byte) driver.G2

func (*Bls12_377) NewG2FromCompressed added in v0.1.0

func (c *Bls12_377) NewG2FromCompressed(b []byte) driver.G2

func (*Bls12_377) NewGtFromBytes added in v0.1.0

func (c *Bls12_377) NewGtFromBytes(b []byte) driver.Gt

func (*Bls12_377) Pairing added in v0.1.0

func (c *Bls12_377) Pairing(p2 driver.G2, p1 driver.G1) driver.Gt

func (*Bls12_377) Pairing2 added in v0.1.0

func (c *Bls12_377) Pairing2(p2a, p2b driver.G2, p1a, p1b driver.G1) driver.Gt

func (*Bls12_377) ScalarByteSize added in v0.1.0

func (c *Bls12_377) ScalarByteSize() int

type Bn254

type Bn254 struct {
	common.CurveBase
}

func NewBn254 added in v0.1.0

func NewBn254() *Bn254

func (*Bn254) CompressedG1ByteSize added in v0.1.0

func (c *Bn254) CompressedG1ByteSize() int

func (*Bn254) CompressedG2ByteSize added in v0.1.0

func (c *Bn254) CompressedG2ByteSize() int

func (*Bn254) CoordinateByteSize added in v0.1.0

func (c *Bn254) CoordinateByteSize() int

func (*Bn254) FExp

func (c *Bn254) FExp(a driver.Gt) driver.Gt

func (*Bn254) G1ByteSize added in v0.1.0

func (c *Bn254) G1ByteSize() int

func (*Bn254) G2ByteSize added in v0.1.0

func (c *Bn254) G2ByteSize() int

func (*Bn254) GenG1

func (c *Bn254) GenG1() driver.G1

func (*Bn254) GenG2

func (c *Bn254) GenG2() driver.G2

func (*Bn254) GenGt

func (c *Bn254) GenGt() driver.Gt

func (*Bn254) HashToG1

func (c *Bn254) HashToG1(data []byte) driver.G1

func (*Bn254) HashToG1WithDomain added in v0.1.0

func (p *Bn254) HashToG1WithDomain(data, domain []byte) driver.G1

func (*Bn254) HashToG2 added in v0.1.0

func (c *Bn254) HashToG2(data []byte) driver.G2

func (*Bn254) HashToG2WithDomain added in v0.1.0

func (p *Bn254) HashToG2WithDomain(data, domain []byte) driver.G2

func (*Bn254) MultiScalarMul added in v0.1.0

func (c *Bn254) MultiScalarMul(a []driver.G1, b []driver.Zr) driver.G1

MultiScalarMul computes the sum of the scalar multiplications of the given bases by the given scalars via gnark's bucket-method MultiExp. MultiExp carries a fixed cost (window and chunk setup, goroutine fan-out) that a pairwise Mul2+Add loop does not, so for very small n a caller that knows its sizes may be better served by Mul/Mul2 directly; callers that care make that choice themselves, and this method does not second-guess them beyond the trivial n==0 and n==1 cases.

func (*Bn254) NewG1

func (c *Bn254) NewG1() driver.G1

func (*Bn254) NewG1FromBytes

func (c *Bn254) NewG1FromBytes(b []byte) driver.G1

func (*Bn254) NewG1FromCompressed added in v0.1.0

func (c *Bn254) NewG1FromCompressed(b []byte) driver.G1

func (*Bn254) NewG2

func (c *Bn254) NewG2() driver.G2

func (*Bn254) NewG2FromBytes

func (c *Bn254) NewG2FromBytes(b []byte) driver.G2

func (*Bn254) NewG2FromCompressed added in v0.1.0

func (c *Bn254) NewG2FromCompressed(b []byte) driver.G2

func (*Bn254) NewGtFromBytes

func (c *Bn254) NewGtFromBytes(b []byte) driver.Gt

func (*Bn254) Pairing

func (c *Bn254) Pairing(p2 driver.G2, p1 driver.G1) driver.Gt

func (*Bn254) Pairing2

func (c *Bn254) Pairing2(p2a, p2b driver.G2, p1a, p1b driver.G1) driver.Gt

func (*Bn254) ScalarByteSize added in v0.1.0

func (c *Bn254) ScalarByteSize() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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