Documentation ¶
Index ¶
- func ValidThreshold(t, n int) bool
- type Config
- func (c *Config) CanSign(signers party.IDSlice) bool
- func (c *Config) Derive(adjust curve.Scalar, newChainKey []byte) (*Config, error)
- func (c *Config) DeriveBIP32(i uint32) (*Config, error)
- func (c *Config) Domain() string
- func (c *Config) MarshalBinary() ([]byte, error)
- func (c *Config) PartyIDs() party.IDSlice
- func (c *Config) PublicPoint() curve.Point
- func (c *Config) UnmarshalBinary(data []byte) error
- func (c *Config) WriteTo(w io.Writer) (total int64, err error)
- type Public
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidThreshold ¶
Types ¶
type Config ¶
type Config struct { // Group returns the Elliptic Curve Group associated with this config. Group curve.Curve // ID is the identifier of the party this Config belongs to. ID party.ID // Threshold is the integer t which defines the maximum number of corruptions tolerated for this config. // Threshold + 1 is the minimum number of parties' shares required to reconstruct the secret/sign a message. Threshold int // ECDSA is this party's share xᵢ of the secret ECDSA x. ECDSA curve.Scalar // ElGamal is this party's yᵢ used for ElGamal. ElGamal curve.Scalar // Paillier is this party's Paillier decryption key. Paillier *paillier.SecretKey // RID is a 32 byte random identifier generated for this config RID types.RID // ChainKey is the chaining key value associated with this public key ChainKey types.RID // Public maps party.ID to public. It contains all public information associated to a party. Public map[party.ID]*Public }
Config contains all necessary cryptographic keys necessary to generate a signature. It also represents the `SSID` after having performed a keygen/refresh operation. where SSID = (𝔾, t, n, P₁, …, Pₙ, (X₁, Y₁, N₁, s₁, t₁), …, (Xₙ, Yₙ, Nₙ, sₙ, tₙ)).
To unmarshal this struct, EmptyConfig should be called first with a specific group, before using cbor.Unmarshal with that struct.
func EmptyConfig ¶
EmptyConfig creates an empty Config with a fixed group, ready for unmarshalling.
This needs to be used for unmarshalling, otherwise the points on the curve can't be decoded.
func (*Config) CanSign ¶
CanSign returns true if the given _sorted_ list of signers is a valid subset of the original parties of size > t, and includes self.
func (*Config) Derive ¶
Derive adds adjust to the private key, resulting in a new key pair.
This supports arbitrary derivation methods, including BIP32. For explicit BIP32 support, see DeriveBIP32.
A new chain key can be passed, which will replace the existing one for the new keypair.
func (*Config) DeriveBIP32 ¶
DeriveBIP32 derives a sharing of the ith child of the consortium signing key.
This function uses unhardened derivation, deriving a key without including the underlying private key. This function will panic if i ⩾ 2³¹, since that indicates a hardened key.
Sometimes, an error will be returned, indicating that this index generates an invalid key.
See: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
func (*Config) MarshalBinary ¶
func (*Config) PublicPoint ¶
PublicPoint returns the group's public ECC point.
func (*Config) UnmarshalBinary ¶
type Public ¶
type Public struct { // ECDSA public key share ECDSA curve.Point // ElGamal is this party's public key for ElGamal encryption. ElGamal curve.Point // Paillier is this party's public Paillier key. Paillier *paillier.PublicKey // Pedersen is this party's public Pedersen parameters. Pedersen *pedersen.Parameters }
Public holds public information for a party.