Documentation ¶
Overview ¶
Package internal provides values, structures, and functions to operate FROST that are not part of the public API.
Index ¶
- Variables
- func Concatenate(input ...[]byte) []byte
- func IntegerToScalar(g group.Group, i int) *group.Scalar
- func RandomBytes(length int) []byte
- type BindingFactor
- type BindingFactorList
- type Ciphersuite
- type Commitment
- type CommitmentList
- func (c CommitmentList) ComputeBindingFactors(cs Ciphersuite, msg []byte) (l BindingFactorList, r [][]byte)
- func (c CommitmentList) ComputeGroupCommitment(cs Ciphersuite, list BindingFactorList) *group.Element
- func (c CommitmentList) Encode() []byte
- func (c CommitmentList) IsSorted() bool
- func (c CommitmentList) Len() int
- func (c CommitmentList) Less(i, j int) bool
- func (c CommitmentList) Participants() []*group.Scalar
- func (c CommitmentList) Sort()
- func (c CommitmentList) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
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 ¶
Concatenate returns the concatenation of all bytes composing the input elements.
func IntegerToScalar ¶
IntegerToScalar creates a group.Scalar given an int.
func RandomBytes ¶
RandomBytes returns length random bytes (wrapper for crypto/rand).
Types ¶
type BindingFactor ¶
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 ¶
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.
type Commitment ¶
Commitment represent a participant's commitment.
type CommitmentList ¶
type CommitmentList []*Commitment
CommitmentList is a sortable list of commitments.
func (CommitmentList) ComputeBindingFactors ¶
func (c CommitmentList) ComputeBindingFactors(cs Ciphersuite, msg []byte) (l BindingFactorList, r [][]byte)
ComputeBindingFactors computes binding factors based on the participant commitment list and the message to be signed. The rhoInputs are temporarily added for testing purposes and can be ignored.
func (CommitmentList) ComputeGroupCommitment ¶
func (c CommitmentList) ComputeGroupCommitment(cs Ciphersuite, list BindingFactorList) *group.Element
ComputeGroupCommitment creates the group commitment from a commitment list.
func (CommitmentList) Encode ¶
func (c CommitmentList) Encode() []byte
Encode serializes a whole commitment list.
func (CommitmentList) IsSorted ¶
func (c CommitmentList) IsSorted() bool
IsSorted returns whether the list is sorted in ascending order by identifier.
func (CommitmentList) Len ¶
func (c CommitmentList) Len() int
Len implements the sort.Interface Len method.
func (CommitmentList) Less ¶
func (c CommitmentList) Less(i, j int) bool
Less implements the sort.Interface Less method.
func (CommitmentList) Participants ¶
func (c CommitmentList) Participants() []*group.Scalar
Participants returns the list of participants in the commitment list.
func (CommitmentList) Sort ¶
func (c CommitmentList) Sort()
Sort sorts the list the ascending order of identifiers.
func (CommitmentList) Swap ¶
func (c CommitmentList) Swap(i, j int)
Swap implements the sort.Interface Swap method.