Documentation ¶
Overview ¶
Package v1 provides a wrapper around the [DKLs18](https://eprint.iacr.org/2018/499.pdf) sign and dkg and provides serialization, serialization, and versioning for the serialized data.
Index ¶
- func ConvertAliceDkgOutputToV1(params *v0.Params, dkgResult []byte) (*protocol.Message, error)
- func ConvertBobDkgOutputToV1(params *v0.Params, dkgResult []byte) (*protocol.Message, error)
- func DecodeAliceDkgResult(m *protocol.Message) (*dkg.AliceOutput, error)
- func DecodeAliceRefreshResult(m *protocol.Message) (*dkg.AliceOutput, error)
- func DecodeBobDkgResult(m *protocol.Message) (*dkg.BobOutput, error)
- func DecodeBobRefreshResult(m *protocol.Message) (*dkg.BobOutput, error)
- func DecodeSignature(m *protocol.Message) (*curves.EcdsaSignature, error)
- func EncodeAliceDkgOutput(result *dkg.AliceOutput, version uint) (*protocol.Message, error)
- func EncodeAliceRefreshOutput(result *dkg.AliceOutput, version uint) (*protocol.Message, error)
- func EncodeBobDkgOutput(result *dkg.BobOutput, version uint) (*protocol.Message, error)
- func EncodeBobRefreshOutput(result *dkg.BobOutput, version uint) (*protocol.Message, error)
- type AliceDkg
- type AliceRefresh
- type AliceSign
- type BobDkg
- type BobRefresh
- type BobSign
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAliceDkgOutputToV1 ¶
ConvertAliceDkgOutputToV1 converts the V0 output to V1 output. The V0 version of DKls `gob` encoded entire `Alice` object and returned it as DKG state and returned this state and the public key to the caller as the serialized version of DKG. In contrast, the V1 version of DKLs `gob` encodes only what is need for signing algorithm. Therefore, this function first decodes the V0 dkg result to Alice object and a public key. Then extracts the required data out of the Alice object and creates V1 Dkg output object. Note that in addition to extracting the required data, this function also performs type conversions on curve Scalar and Points. The reason is that between V0 and V1, the interface and data types for curve computation has changed.
Furthermore, the new encoded value is represented as a `protocol.Message` which contains versioning and other metadata about the serialized values. This serialized value will be the input to the sign function.
In summary, the following data mapping and conversion is performed.
- v0.alice.Pk -> Converted to v1.PublicKey (a curve Point)
- v0.alice.SkA -> Converted to v1.SecretKeyShare (a scalar value)
- v0.alice.Receiver.Packed -> Converted to v1.SeedOtResult.PackedRandomChoiceBits (the random choice bits in OT)
- v0.alice.Receiver.Packed -> Converted to v1.SeedOtResult.RandomChoiceBits (the random choice bits in OT in unpacked form)
- v0.alice.Receiver.Rho -> Converted to v1.SeedOtResult.OneTimePadDecryptionKey (the Rho value in the paper)
func ConvertBobDkgOutputToV1 ¶
ConvertBobDkgOutputToV1 converts the V0 output to V1 output. The V0 version of DKls `gob` encoded entire `Bob` object and returned it as DKG state and returned this state and the public key to the caller as the serialized version of DKG. In contrast, the V1 version of DKLs `gob` encodes only what is need for signing algorithm. Therefore, this function first decodes the V0 dkg result to Bob object and a public key. Then extracts the required data out of the Bob object and creates V1 Dkg output object. Note that in addition to extracting the required data, this function also performs type conversions on curve Scalar and Points. The reason is that between V0 and V1, the interface and data types for curve computation has changed.
Furthermore, the new encoded value is represented as a `protocol.Message` which contains versioning and other metadata about the serialized values. This serialized value will be the input to the sign function.
In summary, the following data mapping and conversion is performed.
- v0.bob.Pk -> Converted to v1.PublicKey (a curve Point)
- v0.bob.SkA -> Converted to v1.SecretKeyShare (a scalar value)
- v0.bob.Sender.Rho -> Converted to v1.SeedOtResult.OneTimePadEncryptionKeys (the Rho value in the paper)
func DecodeAliceDkgResult ¶
func DecodeAliceDkgResult(m *protocol.Message) (*dkg.AliceOutput, error)
DecodeAliceDkgResult deserializes Alice DKG output.
func DecodeAliceRefreshResult ¶
func DecodeAliceRefreshResult(m *protocol.Message) (*dkg.AliceOutput, error)
DecodeAliceRefreshResult deserializes Alice refresh output.
func DecodeBobDkgResult ¶
DecodeBobDkgResult deserializes Bob DKG output.
func DecodeBobRefreshResult ¶
DecodeBobRefreshResult deserializes Bob refhresh output.
func DecodeSignature ¶
func DecodeSignature(m *protocol.Message) (*curves.EcdsaSignature, error)
DecodeSignature serializes the signature.
func EncodeAliceDkgOutput ¶
EncodeAliceDkgOutput serializes Alice DKG output based on the protocol version.
func EncodeAliceRefreshOutput ¶
EncodeAliceRefreshOutput serializes Alice Refresh output based on the protocol version.
func EncodeBobDkgOutput ¶
EncodeBobDkgOutput serializes Bob DKG output based on the protocol version.
Types ¶
type AliceDkg ¶
AliceDkg DKLS DKG implementation that satisfies the protocol iterator interface.
func NewAliceDkg ¶
NewAliceDkg creates a new protocol that can compute a DKG as Alice
type AliceRefresh ¶
AliceRefresh DKLS refresh implementation that satisfies the protocol iterator interface.
func NewAliceRefresh ¶
func NewAliceRefresh(curve *curves.Curve, dkgResultMessage *protocol.Message, version uint) (*AliceRefresh, error)
NewAliceRefresh creates a new protocol that can compute a key refresh as Alice
type AliceSign ¶
AliceSign DKLS sign implementation that satisfies the protocol iterator interface.
func NewAliceSign ¶
func NewAliceSign(curve *curves.Curve, hash hash.Hash, message []byte, dkgResultMessage *protocol.Message, version uint) (*AliceSign, error)
NewAliceSign creates a new protocol that can compute a signature as Alice. Requires dkg state that was produced at the end of DKG.Output().
type BobDkg ¶
BobDkg DKLS DKG implementation that satisfies the protocol iterator interface.
type BobRefresh ¶
BobRefresh DKLS refresh implementation that satisfies the protocol iterator interface.
func NewBobRefresh ¶
func NewBobRefresh(curve *curves.Curve, dkgResultMessage *protocol.Message, version uint) (*BobRefresh, error)
NewBobRefresh Creates a new protocol that can compute a refresh as Bob.
type BobSign ¶
BobSign DKLS sign implementation that satisfies the protocol iterator interface.
func NewBobSign ¶
func NewBobSign(curve *curves.Curve, hash hash.Hash, message []byte, dkgResultMessage *protocol.Message, version uint) (*BobSign, error)
NewBobSign creates a new protocol that can compute a signature as Bob. Requires dkg state that was produced at the end of DKG.Output().
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package dealer implements key generation via a trusted dealer for the protocol [DKLs18](https://eprint.iacr.org/2018/499.pdf).
|
Package dealer implements key generation via a trusted dealer for the protocol [DKLs18](https://eprint.iacr.org/2018/499.pdf). |
Package dkg implements the Distributed Key Generation (DKG) protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
|
Package dkg implements the Distributed Key Generation (DKG) protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf). |
This file implements the key refresh protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
|
This file implements the key refresh protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf). |
Package sign implements the 2-2 threshold signature protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
|
Package sign implements the 2-2 threshold signature protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf). |