idemix

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultIdemixCurve is the curve picked by Fabric-CA at default
	DefaultIdemixCurve = "amcl.Fp256bn"
)

Variables

View Source
var (

	// Curves lists all idemix curves that can be picked by Fabric-CA
	Curves = CurveIDs{FP256BN, Gurvy, FP256BNMiracl}
)

Functions

func CurveByID

func CurveByID(id CurveID) *math.Curve

CurveByID returns the Mathlib curve that corresponds to the given CurveID

func InstanceForCurve

func InstanceForCurve(id CurveID) *idemix.Idemix

InstanceForCurve returns an Idemix instance that uses the given CurveID

Types

type CurveID

type CurveID uint8

CurveID defines the index of the possible idemix curves

const (
	// Undefined is used to indicate that no curve has been defined
	Undefined CurveID = iota
	// FP256BN is an AMCL implementation of BN256 and its corresponding finite field
	FP256BN
	// Gurvy is an implementation of gnark-crypto of BN254 and its corresponding finite field
	Gurvy
	// FP256BNMiracl is another AMCL implementation of BN256 and its corresponding finite field
	FP256BNMiracl
)

type CurveIDs

type CurveIDs []CurveID

CurveIDs defines a collection of CurveIDs

func (CurveIDs) ByID

func (cids CurveIDs) ByID(curveID CurveID) string

ByID returns the name of the given CurveID or an empty string

func (CurveIDs) ByName

func (cids CurveIDs) ByName(name string) CurveID

ByName returns CurveID with the corresponding name, or Undefined

func (CurveIDs) Names

func (cids CurveIDs) Names() []string

Names returns the names of the curves according to their order

Jump to

Keyboard shortcuts

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