pkg

package
v0.0.0-...-1c35a36 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: BlueOak-1.0.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandSecret

func ExpandSecret(secret []byte) []byte

ExpandSecret expands a secret "seed" into an expanded secret Private keys (aka secrets) in RPC 8032 are actually "seeds" for the expanded secret. This mirrors the golang ed25519 handling of ed25519 secrets.

func SignWithShare

func SignWithShare(message []byte, share []byte, ephemeralShare []byte, publicKey []byte, ephemeralPublic []byte) []byte

SignWithShare signs a message using a secret share and an ephemeral share

Types

type Element

type Element []byte

Element type alias for byte array

func AddElements

func AddElements(elements []Element) Element

AddElements adds field elements and returns a field element result

func ScalarMultiplyBase

func ScalarMultiplyBase(scalar Scalar) Element

ScalarMultiplyBase multiplies the scalar parameter by the ed25519 base and returns an element in the field.

type Scalar

type Scalar []byte

Scalar type alias for byte array

func AddScalars

func AddScalars(scalars []Scalar) Scalar

AddScalars adds all scalars, mods the result by the field order, and returns the result as a scalar

func CombineShares

func CombineShares(total uint8, cosignerIds []int, shares [][]byte) Scalar

CombineShares merges an array of shares into an original Scalar value

func DealShares

func DealShares(secret []byte, threshold uint8, total uint8) []Scalar

DealShares split the secret bytes into n total shares requiring t threshold of the shares to re-assemble the original secret. The return value is an array of Scalars of size `n` (total)

Jump to

Keyboard shortcuts

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