crypto

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LFactor    = 1
	LpaiFactor = 5
)

Variables

This section is empty.

Functions

func FlattenECPoints

func FlattenECPoints(in []*ECPoint) ([]*big.Int, error)

Types

type ECPoint

type ECPoint struct {
	// contains filtered or unexported fields
}

ECPoint convenience helper

func NewECPoint

func NewECPoint(curve elliptic.Curve, X, Y *big.Int) (*ECPoint, error)

Creates a new ECPoint and checks that the given coordinates are on the elliptic curve.

func NewECPointNoCurveCheck

func NewECPointNoCurveCheck(curve elliptic.Curve, X, Y *big.Int) *ECPoint

Creates a new ECPoint without checking that the coordinates are on the elliptic curve. Only use this function when you are completely sure that the point is already on the curve.

func ScalarBaseMult

func ScalarBaseMult(curve elliptic.Curve, k *big.Int) *ECPoint

func UnFlattenECPoints

func UnFlattenECPoints(curve elliptic.Curve, in []*big.Int, noCurveCheck ...bool) ([]*ECPoint, error)

func UnmarshalJSONPoint

func UnmarshalJSONPoint(payload []byte) (*ECPoint, error)

func (*ECPoint) Add

func (p *ECPoint) Add(p1 *ECPoint) (*ECPoint, error)

func (*ECPoint) Curve

func (p *ECPoint) Curve() elliptic.Curve

func (*ECPoint) EightInvEight

func (p *ECPoint) EightInvEight() *ECPoint

func (*ECPoint) Equals

func (p *ECPoint) Equals(p2 *ECPoint) bool

func (*ECPoint) GobDecode

func (p *ECPoint) GobDecode(buf []byte) error

func (*ECPoint) GobEncode

func (p *ECPoint) GobEncode() ([]byte, error)

func (*ECPoint) IsOnCurve

func (p *ECPoint) IsOnCurve() bool

func (*ECPoint) MarshalJSON

func (p *ECPoint) MarshalJSON() ([]byte, error)

crypto.ECPoint is not inherently json marshal-able

func (*ECPoint) ScalarMult

func (p *ECPoint) ScalarMult(k *big.Int) *ECPoint

func (*ECPoint) SetCurve

func (p *ECPoint) SetCurve(curve elliptic.Curve) *ECPoint

func (*ECPoint) ToECDSAPubKey

func (p *ECPoint) ToECDSAPubKey() *ecdsa.PublicKey

func (*ECPoint) UnmarshalJSON

func (p *ECPoint) UnmarshalJSON(payload []byte) error

func (*ECPoint) ValidateBasic

func (p *ECPoint) ValidateBasic() bool

func (*ECPoint) X

func (p *ECPoint) X() *big.Int

func (*ECPoint) Y

func (p *ECPoint) Y() *big.Int

type ProofConfig

type ProofConfig struct {
	CurveN               *big.Int
	TwoExpLAddepsilon    *big.Int
	TwoExpLpaiAddepsilon *big.Int
	TwoExpL              *big.Int
	LAddEpsilon          uint64
	LpaiAddEpsilon       uint64
	Lpai                 uint
}

func NewProofConfig

func NewProofConfig(curveN *big.Int) *ProofConfig

Jump to

Keyboard shortcuts

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