keygen

package
v0.6.0-alpha-20...-5109cf1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartKeygen

func StartKeygen(group curve.Curve, receiver bool, selfID, otherID party.ID, secretShare curve.Scalar, public curve.Point, pl *pool.Pool) protocol.StartFunc

StartKeygen starts the key generation protocol.

This is documented further in the base doerner package.

This corresponds to protocol 2 of https://eprint.iacr.org/2018/499, with some adjustments to do additive sharing instead of multiplicative sharing.

The Receiver plays the role of "Bob", and the Sender plays the role of "Alice".

If the secret share and public point are not nil, a refresh is done instead.

Types

type ConfigReceiver

type ConfigReceiver struct {
	// Setup is an implementation detail, needed to perform signing.
	Setup *ot.CorreOTReceiveSetup
	// SecretShare is an additive share of the secret key.
	SecretShare curve.Scalar
	// Public is the shared public key.
	Public curve.Point
	// ChainKey is the shared chain key.
	ChainKey []byte
}

ConfigReceiver holds the results of key generation for the receiver.

func (*ConfigReceiver) Derive

func (c *ConfigReceiver) Derive(adjust curve.Scalar, newChainKey []byte) (*ConfigReceiver, error)

Derive performs an arbitrary derivation of a related key, by adding a scalar.

This can support methods like BIP32, but is more general.

Optionally, a new chain key can be passed as well.

func (*ConfigReceiver) DeriveBIP32

func (c *ConfigReceiver) DeriveBIP32(i uint32) (*ConfigReceiver, error)

DeriveChild adjusts the shares to represent the derived public key at a certain index.

This will panic if the group is not curve.Secp256k1

This derivation works according to BIP-32, see: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

func (*ConfigReceiver) Group

func (c *ConfigReceiver) Group() curve.Curve

Group returns the elliptic curve group associate with this config.

type ConfigSender

type ConfigSender struct {
	// Setup is an implementation detail, needed to perform signing.
	Setup *ot.CorreOTSendSetup
	// SecretShare is an additive share of the secret key.
	SecretShare curve.Scalar
	// Public is the shared public key.
	Public curve.Point
	// ChainKey is the shared chain key.
	ChainKey []byte
}

ConfigSender holds the results of key generation for the sender.

func (*ConfigSender) Derive

func (c *ConfigSender) Derive(adjust curve.Scalar, newChainKey []byte) (*ConfigSender, error)

Derive performs an arbitrary derivation of a related key, by adding a scalar.

This can support methods like BIP32, but is more general.

Optionally, a new chain key can be passed as well.

func (*ConfigSender) DeriveBIP32

func (c *ConfigSender) DeriveBIP32(i uint32) (*ConfigSender, error)

DeriveChild adjusts the shares to represent the derived public key at a certain index.

This will panic if the group is not curve.Secp256k1

This derivation works according to BIP-32, see: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

func (*ConfigSender) Group

func (c *ConfigSender) Group() curve.Curve

Group returns the elliptic curve group associate with this config.

Jump to

Keyboard shortcuts

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