Documentation
¶
Index ¶
- Variables
- func CheckFROSTMarshaler(input, output FROSTMarshaler) error
- type FROSTMarshaler
- type Header
- type KeyGen1
- type KeyGen2
- type Message
- func NewKeyGen1(from party.ID, proof *zk.Schnorr, commitments *polynomial.Exponent) *Message
- func NewKeyGen2(from, to party.ID, share *ristretto.Scalar) *Message
- func NewSign1(from party.ID, commitmentD, commitmentE *ristretto.Element) *Message
- func NewSign2(from party.ID, signatureShare *ristretto.Scalar) *Message
- type MessageType
- type Sign1
- type Sign2
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidMessage = errors.New("invalid message")
Functions ¶
func CheckFROSTMarshaler ¶
func CheckFROSTMarshaler(input, output FROSTMarshaler) error
CheckFROSTMarshaler provides some basic tests to make sure the interface is properly implemented. Should be used for tests of message types.
Types ¶
type FROSTMarshaler ¶
type FROSTMarshaler interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
// BytesAppend is the same as BinaryMarshall but allows the caller to perform the allocation
BytesAppend(existing []byte) (data []byte, err error)
// Size should return the number of bytes used to store the type.
Size() int
// Equal is used mostly for testing and returns true if other represents the same value as the receiver.
Equal(other interface{}) bool
}
type Header ¶
type Header struct {
// Type is the message type
Type MessageType
// From returns the party.ID of the party who sent this message.
// Cannot be 0
From party.ID
// To is the party.ID of the party the message is addressed to.
// If the message is intended for broadcast, the ID returned is 0 (invalid),
// therefore, you should call IsBroadcast() first.
To party.ID
}
func (*Header) IsBroadcast ¶
IsBroadcast returns true if the message is intended to be broadcast
func (*Header) MarshalBinary ¶
func (*Header) UnmarshalBinary ¶
type KeyGen1 ¶
type KeyGen1 struct {
Proof *zk.Schnorr
Commitments *polynomial.Exponent
}
func (*KeyGen1) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*KeyGen1) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type KeyGen2 ¶
func (*KeyGen2) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*KeyGen2) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type Message ¶
func NewKeyGen1 ¶
func (*Message) BytesAppend ¶
func (*Message) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Message) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type MessageType ¶
type MessageType uint8
const ( MessageTypeNone MessageType = iota MessageTypeKeyGen1 MessageTypeKeyGen2 MessageTypeSign1 MessageTypeSign2 )
MessageType s must be increasing.
type Sign1 ¶
func (*Sign1) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Sign1) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type Sign2 ¶
type Sign2 struct {
// Zi is a ristretto.Scalar.
// It represents the sender's share of the 's' part of the final signature
Zi ristretto.Scalar
}
func (*Sign2) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Sign2) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.