ssv

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var One = big.NewInt(1)
View Source
var Zero = big.NewInt(0)

Useful shorts

Functions

func CurveForOID

func CurveForOID(oid asn1.ObjectIdentifier) elliptic.Curve

func OidFromCurve

func OidFromCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool)

func RecoverBytes

func RecoverBytes(ssvs []*SSVShare) (*big.Int, error)

Types

type PtEC

type PtEC struct {
	X *big.Int
	Y *big.Int
}

An EC point

func (*PtEC) Equals

func (pt *PtEC) Equals(pt2 *PtEC) bool

type SSVShare

type SSVShare struct {
	poly.Share
	FValue *big.Int              //Blinding secret value
	ECOID  asn1.ObjectIdentifier //OID of the elliptic curve used for the Pedersen committments
	PD     []*PtEC               //Pedersen polynomial coefficients commitment

}

This is a wrapper around a standard SSS share

func SplitBytes

func SplitBytes(secret []byte, n, t int, ecc elliptic.Curve) ([]*SSVShare, error)

func (*SSVShare) Verify

func (ssvs *SSVShare) Verify() error

type TTVCurve

type TTVCurve struct {
	elliptic.Curve
	sha3.ShakeHash
	G *PtEC
	H *PtEC
}

func NewCrv

func NewCrv(elcrv elliptic.Curve) *TTVCurve

Initializing the Hash and the second (-hopefully-) generator

func (*TTVCurve) Add

func (cr *TTVCurve) Add(pt1, pt2 *PtEC) *PtEC

func (*TTVCurve) Neg

func (cr *TTVCurve) Neg(pt *PtEC) *PtEC

func (*TTVCurve) Pedersen

func (cr *TTVCurve) Pedersen(s, t *big.Int) *PtEC

Pedersen commitment fot s with the blinding t

func (*TTVCurve) RandomFieldElement

func (cr *TTVCurve) RandomFieldElement() *big.Int

func (*TTVCurve) RandomPoint

func (cr *TTVCurve) RandomPoint() *PtEC

func (*TTVCurve) ReadECFHash

func (cr *TTVCurve) ReadECFHash() []byte

Read a hash with the EC field as a target

func (*TTVCurve) ScalarMult

func (cr *TTVCurve) ScalarMult(sclr *big.Int, pt *PtEC) *PtEC

func (*TTVCurve) Y

func (cr *TTVCurve) Y(x *big.Int) *big.Int

Evaluating y from x (the default branch) This needs knowledge/assumption about the polynomial as the elliptic.Curve does not carry the A parameter

func (*TTVCurve) Zero

func (cr *TTVCurve) Zero() *PtEC

Returns O point of the cr curve

Jump to

Keyboard shortcuts

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