crypto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DLogPublicParameters = "zkatdlog"
	DefaultPrecision     = uint64(64)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicParams

type PublicParams struct {
	// Label is the label associated with the PublicParams.
	// It can be used by the driver for versioning purpose.
	Label string
	// Curve is the pairing-friendly elliptic curve used for everything but Idemix.
	Curve mathlib.CurveID
	// PedGen is the generator of the Pedersen commitment group.
	PedGen *mathlib.G1
	// PedParams contains the public parameters for the Pedersen commitment scheme.
	PedParams []*mathlib.G1
	// RangeProofParams contains the public parameters for the range proof scheme.
	RangeProofParams *RangeProofParams
	// IdemixCurveID is the pairing-friendly curve used for the idemix scheme.
	IdemixCurveID mathlib.CurveID
	// IdemixIssuerPK is the public key of the issuer of the idemix scheme.
	IdemixIssuerPK []byte
	// Auditor is the public key of the auditor.
	Auditor []byte
	// Issuers is a list of public keys of the entities that can issue tokens.
	Issuers [][]byte
	// MaxToken is the maximum quantity a token can hold
	MaxToken uint64
	// QuantityPrecision is the precision used to represent quantities
	QuantityPrecision uint64
}

func NewPublicParamsFromBytes

func NewPublicParamsFromBytes(raw []byte, label string) (*PublicParams, error)

func Setup

func Setup(base uint, exponent uint, idemixIssuerPK []byte, idemixCurveID mathlib.CurveID) (*PublicParams, error)

func SetupWithCustomLabel

func SetupWithCustomLabel(base uint, exponent uint, idemixIssuerPK []byte, label string, idemixCurveID mathlib.CurveID) (*PublicParams, error)

func (*PublicParams) AddAuditor

func (pp *PublicParams) AddAuditor(auditor view.Identity)

func (*PublicParams) AddIssuer

func (pp *PublicParams) AddIssuer(id view.Identity)

func (*PublicParams) Auditors

func (pp *PublicParams) Auditors() []view.Identity

func (*PublicParams) Bytes

func (pp *PublicParams) Bytes() ([]byte, error)

func (*PublicParams) CertificationDriver

func (pp *PublicParams) CertificationDriver() string

func (*PublicParams) ComputeHash

func (pp *PublicParams) ComputeHash() ([]byte, error)

func (*PublicParams) ComputeMaxTokenValue

func (pp *PublicParams) ComputeMaxTokenValue() uint64

func (*PublicParams) Deserialize

func (pp *PublicParams) Deserialize(raw []byte) error

func (*PublicParams) GeneratePedersenParameters

func (pp *PublicParams) GeneratePedersenParameters() error

func (*PublicParams) GenerateRangeProofParameters

func (pp *PublicParams) GenerateRangeProofParameters(signer *pssign.Signer, maxValue uint) error

func (*PublicParams) GraphHiding

func (pp *PublicParams) GraphHiding() bool

func (*PublicParams) IdemixCurve added in v0.3.0

func (pp *PublicParams) IdemixCurve() mathlib.CurveID

func (*PublicParams) Identifier

func (pp *PublicParams) Identifier() string

func (*PublicParams) MaxTokenValue

func (pp *PublicParams) MaxTokenValue() uint64

func (*PublicParams) Precision

func (pp *PublicParams) Precision() uint64

func (*PublicParams) Serialize

func (pp *PublicParams) Serialize() ([]byte, error)

func (*PublicParams) String added in v0.3.0

func (pp *PublicParams) String() string

func (*PublicParams) TokenDataHiding

func (pp *PublicParams) TokenDataHiding() bool

func (*PublicParams) Validate

func (pp *PublicParams) Validate() error

type RangeProofParams

type RangeProofParams struct {
	SignPK       []*mathlib.G2
	SignedValues []*pssign.Signature
	Q            *mathlib.G2
	Exponent     uint
}

func (*RangeProofParams) Validate

func (rpp *RangeProofParams) Validate() error

Directories

Path Synopsis
mock
Code generated by counterfeiter.
Code generated by counterfeiter.
nonanonym/mock
Code generated by counterfeiter.
Code generated by counterfeiter.
mock
Code generated by counterfeiter.
Code generated by counterfeiter.
mock
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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