internal

package
v0.0.0-...-d9d8b5d Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package internal provides values, structures, and functions to operate FROST that are not part of the public API.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidParameters indicates that wrong input has been provided.
	ErrInvalidParameters = errors.New("invalid parameters")

	// ErrInvalidCiphersuite indicates a non-supported ciphersuite is being used.
	ErrInvalidCiphersuite = errors.New("ciphersuite not available")

	// ErrInvalidParticipantBackup indicates the participant's encoded backup is not valid.
	ErrInvalidParticipantBackup = errors.New("invalid backup")
)

Functions

func Concatenate

func Concatenate(input ...[]byte) []byte

Concatenate returns the concatenation of all bytes composing the input elements.

func IntegerToScalar

func IntegerToScalar(g group.Group, i int) *group.Scalar

IntegerToScalar creates a group.Scalar given an int.

func RandomBytes

func RandomBytes(length int) []byte

RandomBytes returns length random bytes (wrapper for crypto/rand).

Types

type BindingFactor

type BindingFactor struct {
	Identifier    *group.Scalar
	BindingFactor *group.Scalar
}

BindingFactor holds the binding factor scalar for the given identifier.

type BindingFactorList

type BindingFactorList []*BindingFactor

BindingFactorList a list of BindingFactor.

func (BindingFactorList) BindingFactorForParticipant

func (b BindingFactorList) BindingFactorForParticipant(id *group.Scalar) *group.Scalar

BindingFactorForParticipant returns the binding factor for a given participant identifier in the list.

type Ciphersuite

type Ciphersuite struct {
	ContextString []byte
	Hash          hash.Hashing
	Group         group.Group
}

Ciphersuite combines the group and hashing routines.

func (Ciphersuite) H1

func (c Ciphersuite) H1(input []byte) *group.Scalar

H1 hashes the input and proves the "rho" DST.

func (Ciphersuite) H2

func (c Ciphersuite) H2(input []byte) *group.Scalar

H2 hashes the input and proves the "chal" DST.

func (Ciphersuite) H3

func (c Ciphersuite) H3(input []byte) *group.Scalar

H3 hashes the input and proves the "nonce" DST.

func (Ciphersuite) H4

func (c Ciphersuite) H4(msg []byte) []byte

H4 hashes the input and proves the "msg" DST.

func (Ciphersuite) H5

func (c Ciphersuite) H5(msg []byte) []byte

H5 hashes the input and proves the "com" DST.

func (Ciphersuite) HDKG

func (c Ciphersuite) HDKG(msg []byte) *group.Scalar

HDKG hashes the input to the "dkg" DST.

Jump to

Keyboard shortcuts

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