dkg

package module
v0.0.0-...-419051e Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

README

dkg

Distributed key generation

This repository is a work in progress. It contains an implementation of ECDKG by Tang using the group interface from dedis/kyber. This integration allows different elliptic curves such as Secp256k1 (with tests) and bn256 (on master) to be used in the dkg scheme.

Installation

go get https://github.com/gnosis/dkg

Take a look at the test for intended use.

*Please Note: The messaging/network layer of the scheme has not been implemented.

Documentation

Overview

Package dkg provides methods for distributed key generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNode

func GenerateNode(
	curve kyber.Group,
	g2 kyber.Point,
	zkParam kyber.Scalar,
	timeout time.Duration,
	id kyber.Scalar,
	rand cipher.Stream,
	threshold int,
) (*node, error)

GenerateNode generates a new DKG node randomly.

func LagrangeInterpolateZero

func LagrangeInterpolateZero(points []struct{ x, fX kyber.Scalar }, group kyber.Group) (kyber.Scalar, error)

LagrangeInterpolateZero - find a constant in a source polynomial S=f(0) using Lagrange polynomials using computationally efficient approach https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing#Computationally_Efficient_Approach

func NewNode

func NewNode(
	curve kyber.Group,
	g2 kyber.Point,
	zkParam kyber.Scalar,
	timeout time.Duration,

	id kyber.Scalar,
	secretPoly1 ScalarPolynomial,
	secretPoly2 ScalarPolynomial,
) (*node, error)

NewNode constructs a new node for DKG given some configuration variables.

Types

type InvalidCurvePointError

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

InvalidCurvePointError indicates that a given vector does not belong to a vector space

func (InvalidCurvePointError) Error

func (e InvalidCurvePointError) Error() string

type InvalidCurveScalarError

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

InvalidCurveScalarError indicates a scalar is not a normalized field element for a given vector space

func (InvalidCurveScalarError) Error

func (e InvalidCurveScalarError) Error() string

type InvalidCurveScalarPolynomialError

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

InvalidCurveScalarPolynomialError indicates that a ScalarPolynomial is not constructed properly

func (InvalidCurveScalarPolynomialError) Error

type InvalidPointValueError

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

InvalidPointValueError scalar point value should not be nil

func (InvalidPointValueError) Error

func (e InvalidPointValueError) Error() string

type InvalidPointsLengthError

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

InvalidPointsLengthError indicates that the number of points given was below the required amount

func (InvalidPointsLengthError) Error

func (e InvalidPointsLengthError) Error() string

type InvalidScalarPolynomialLengthError

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

InvalidScalarPolynomialLengthError indicates that ScalarPolynomials which should have a matching degree don't

func (InvalidScalarPolynomialLengthError) Error

type Message

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

Message struct for dkg message (will likely change)

type MessageType

type MessageType int

MessageType enum for dkg message (will likely change)

const (
	A MessageType = iota
)

MessageType iota for dkg message (will likely change)

type Participant

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

Participant represent a view of other nodes for a node

type ParticipantNotFoundError

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

ParticipantNotFoundError indicates a node with a particular ID could not be found in a node's participant list

func (ParticipantNotFoundError) Error

func (e ParticipantNotFoundError) Error() string

type PointTuple

type PointTuple []kyber.Point

PointTuple represents a set of vectors.

type ScalarPolynomial

type ScalarPolynomial []kyber.Scalar

ScalarPolynomial represents polynomials of scalars. It contains coefficients from the finite field under the vector space. Coefficient zero represents the constant term, coefficient one the linear term's coefficient, two the quadratic, etc.

Jump to

Keyboard shortcuts

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