Documentation ¶
Index ¶
- func DerivePublicKey(curve elliptic.Curve, secretKey *big.Int) (*curves.EcPoint, error)
- func NewDealerShares(curve elliptic.Curve, threshold, total uint32, ikm *big.Int) (*curves.EcPoint, map[uint32]*Share, error)
- func NewSecret(curve elliptic.Curve) (*big.Int, error)
- func PreparePublicShares(sharesMap map[uint32]*Share) (map[uint32]*PublicShare, error)
- type DistributedKeyGenType
- type KeyGenType
- type ParticipantData
- type ParticipantDataJson
- type ProofParams
- type PublicShare
- type Share
- type ShareJson
- type TrustedDealerKeyGenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DerivePublicKey ¶
func NewDealerShares ¶
func NewDealerShares(curve elliptic.Curve, threshold, total uint32, ikm *big.Int) (*curves.EcPoint, map[uint32]*Share, error)
NewDealerShares generates the Secp256k1 private key shares and public key if ikm == nil, a new private key will be generated
func PreparePublicShares ¶
func PreparePublicShares(sharesMap map[uint32]*Share) (map[uint32]*PublicShare, error)
PreparePublicShares makes public shares that can be sent to the participant to compute their additive shares and participate in signing rounds
Types ¶
type DistributedKeyGenType ¶
type DistributedKeyGenType struct {
ProofParams map[uint32]*ProofParams
}
DistributedKeyGenType means each participant has their own proof params that were distributed to each other participant
func (DistributedKeyGenType) GetProofParams ¶
func (dkg DistributedKeyGenType) GetProofParams(id uint32) *ProofParams
GetProofParams returns the proof params specified by the participant id
func (DistributedKeyGenType) IsTrustedDealer ¶
func (dkg DistributedKeyGenType) IsTrustedDealer() bool
IsTrustedDealer return true if TrustedDealerKeyGenType
type KeyGenType ¶
type KeyGenType interface { IsTrustedDealer() bool GetProofParams(id uint32) *ProofParams }
KeyGenType encapsulates the different methods that tecdsa can generate keys. Currently TrustedDealer or Distributed Key Generation
type ParticipantData ¶
type ParticipantData struct { Id uint32 DecryptKey *paillier.SecretKey // Public values set to all signing participants EcdsaPublicKey *curves.EcPoint KeyGenType KeyGenType EncryptKeys map[uint32]*paillier.PublicKey }
ParticipantData represents all data to be sent to a participant after the dealer is finished
func (ParticipantData) MarshalJSON ¶
func (pd ParticipantData) MarshalJSON() ([]byte, error)
func (*ParticipantData) UnmarshalJSON ¶
func (pd *ParticipantData) UnmarshalJSON(bytes []byte) error
type ParticipantDataJson ¶
type ProofParams ¶
type ProofParams struct { // n is the modulus for the signing rounds, product of two safe primes N *big.Int // h1 random value quadratic residue in n H1 *big.Int // h2 is a random modular power of h1 H2 *big.Int }
ProofParams is the modulus and generators used when constructing keys and completing the signing rounds
func NewProofParams ¶
func NewProofParams() (*ProofParams, error)
NewProofParams creates new ProofParams with `bits` sized values
func NewProofParamsWithPrimes ¶
func NewProofParamsWithPrimes(p, q *big.Int) (*ProofParams, error)
NewProofParamsWithPrimes creates new ProofParams using the parameters as the primes
type PublicShare ¶
type PublicShare struct {
}PublicShare can be sent to a Participant so it can be used to convert Share to its additive form
type Share ¶
type Share struct {}
Share represents a piece of the ECDSA private key and a commitment to the share
func (Share) MarshalJSON ¶
func (*Share) UnmarshalJSON ¶
type ShareJson ¶
type ShareJson struct {}
ShareJson encapsulates the data that is serialized to JSON used internally and not for external use. Public so other pieces can use for serialization
type TrustedDealerKeyGenType ¶
type TrustedDealerKeyGenType struct {
ProofParams *ProofParams
}
TrustedDealerKeyGenType means the same proof parameters will be used by all participants
func (TrustedDealerKeyGenType) GetProofParams ¶
func (td TrustedDealerKeyGenType) GetProofParams(_ uint32) *ProofParams
GetProofParams returns the proof params specified by the participant id
func (TrustedDealerKeyGenType) IsTrustedDealer ¶
func (td TrustedDealerKeyGenType) IsTrustedDealer() bool
IsTrustedDealer return true if TrustedDealerKeyGenType