crypto

package
v0.0.0-...-60894c1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const BLS_SECRET_KEY_SIZE = 32

Variables

This section is empty.

Functions

func BLSID

func BLSID(id uint64) (*bls.ID, error)

BLSID turns a uint64 in to a BLS identifier. Taken from Attestant's Dirk source code - should be kept in sync with the original.

func ImportKeyFromKeystore

func ImportKeyFromKeystore(path string, passphrase string) (*bls.SecretKey, error)

This code is mostly copied from ethdo's processFromKeystore.

func InitBLS

func InitBLS() error

func ReconstructPublicKey

func ReconstructPublicKey(shares map[uint64]*bls.SecretKey) (*bls.PublicKey, error)

Reconstruct the public key from a map of secret key shares

Types

type DistributedWallet

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

func NewDistributedWallet

func NewDistributedWallet(splitKey *SplitKey, peers map[uint64]string, threshold uint64) *DistributedWallet

func (*DistributedWallet) ImportAccount

func (dw *DistributedWallet) ImportAccount(accountName, walletName, passphrase, baseDir string, id uint64) (*bls.PublicKey, error)

type SplitKey

type SplitKey struct {

	// Number of required key shares to sign (i.e., the degree of the polynomial + 1)
	Threshold uint64
	// Secret key shares.
	Shares map[uint64]*bls.SecretKey
	// contains filtered or unexported fields
}

func NewSplitKey

func NewSplitKey(secret *bls.SecretKey, threshold uint64, ids []uint64, seed []byte) (*SplitKey, error)

func (*SplitKey) PublicKey

func (sk *SplitKey) PublicKey() *bls.PublicKey

func (*SplitKey) PublicPolynomial

func (dk *SplitKey) PublicPolynomial() []bls.PublicKey

Jump to

Keyboard shortcuts

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