ecdsa

package
v0.6.0-alpha-2021-09-21 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PreSignature

type PreSignature struct {
	// ID is a random identifier for this specific presignature.
	ID types.RID
	// R = δ⁻¹⋅Γ = δ⁻¹⋅(∑ⱼ Γⱼ) = (∑ⱼδ⁻¹γⱼ)⋅G = k⁻¹⋅G
	R curve.Point
	// RBar[j] = δ⁻¹⋅Δⱼ = (δ⁻¹kⱼ)⋅Γ = (k⁻¹kⱼ)⋅G
	RBar *party.PointMap
	// S[j] = χⱼ⋅R
	S *party.PointMap
	// KShare = kᵢ
	KShare curve.Scalar
	// ChiShare = χᵢ
	ChiShare curve.Scalar
}

func EmptyPreSignature

func EmptyPreSignature(group curve.Curve) *PreSignature

EmptyPreSignature returns a PreSignature with a given group, ready for unmarshalling.

func (*PreSignature) Group

func (sig *PreSignature) Group() curve.Curve

Group returns the elliptic curve group associated with this PreSignature.

func (*PreSignature) Signature

func (sig *PreSignature) Signature(shares map[party.ID]SignatureShare) *Signature

Signature combines the given shares σⱼ and returns a pair (R,S), where S=∑ⱼσⱼ.

func (*PreSignature) SignatureShare

func (sig *PreSignature) SignatureShare(hash []byte) curve.Scalar

SignatureShare returns this party's share σᵢ = kᵢm+rχᵢ, where s = ∑ⱼσⱼ.

func (*PreSignature) SignerIDs

func (sig *PreSignature) SignerIDs() party.IDSlice

func (*PreSignature) Validate

func (sig *PreSignature) Validate() error

func (*PreSignature) VerifySignatureShares

func (sig *PreSignature) VerifySignatureShares(shares map[party.ID]SignatureShare, hash []byte) (culprits []party.ID)

VerifySignatureShares should be called if the signature returned by PreSignature.Signature is not valid. It returns the list of parties whose shares are invalid.

type Signature

type Signature struct {
	R curve.Point
	S curve.Scalar
}

func EmptySignature

func EmptySignature(group curve.Curve) Signature

EmptySignature returns a new signature with a given curve, ready to be unmarshalled.

func (Signature) Verify

func (sig Signature) Verify(X curve.Point, hash []byte) bool

Verify is a custom signature format using curve data.

type SignatureShare

type SignatureShare = curve.Scalar

SignatureShare represents an individual additive share of the signature's "s" component.

Jump to

Keyboard shortcuts

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