Documentation ¶
Index ¶
- func CategorizeGroupSigners(initialMessage []byte, masterPublicKey [4]*big.Int, ...) ([]int, []int, error)
- func GenerateGroupKeys(initialMessage []byte, transportPrivateKey *big.Int, ...) (*big.Int, [4]*big.Int, [2]*big.Int, error)
- func GenerateKeyShare(firstPrivateCoefficients *big.Int) ([2]*big.Int, [2]*big.Int, [4]*big.Int, error)
- func GenerateKeys() (*big.Int, [2]*big.Int, error)
- func GenerateMasterPublicKey(keyShare1s [][2]*big.Int, keyShare2s [][4]*big.Int) ([4]*big.Int, error)
- func GenerateShares(transportPrivateKey *big.Int, transportPublicKey [2]*big.Int, ...) ([]*big.Int, []*big.Int, [][2]*big.Int, error)
- func InverseArrayForUserCount(n int) ([]*big.Int, error)
- func ThresholdForUserCount(n int) (int, int)
- func VerifyGroupSigners(initialMessage []byte, masterPublicKey [4]*big.Int, ...) (bool, error)
- type Participant
- type ParticipantList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CategorizeGroupSigners ¶
func CategorizeGroupSigners(initialMessage []byte, masterPublicKey [4]*big.Int, publishedPublicKeys [][4]*big.Int, publishedSignatures [][2]*big.Int, participants ParticipantList, threshold int) ([]int, []int, error)
CategorizeGroupSigners returns 0 based indicies of honest participants, 0 based indicies of dishonest participants or an error
func GenerateGroupKeys ¶
func GenerateGroupKeys(initialMessage []byte, transportPrivateKey *big.Int, transportPublicKey [2]*big.Int, privateCoefficients []*big.Int, encryptedShares [][]*big.Int, index int, participants ParticipantList, threshold int) (*big.Int, [4]*big.Int, [2]*big.Int, error)
GenerateGroupKeys returns the group private key, group public key, a signature and potentially an error
func GenerateKeyShare ¶
func GenerateKeyShare(firstPrivateCoefficients *big.Int) ([2]*big.Int, [2]*big.Int, [4]*big.Int, error)
GenerateKeyShare returns G1 key share, G1 proof, G2 key share and potentially an error
func GenerateKeys ¶
GenerateKeys returns a private key, a public key and potentially an error
func GenerateMasterPublicKey ¶
func GenerateMasterPublicKey(keyShare1s [][2]*big.Int, keyShare2s [][4]*big.Int) ([4]*big.Int, error)
GenerateMasterPublicKey returns the master public key
func GenerateShares ¶
func GenerateShares(transportPrivateKey *big.Int, transportPublicKey [2]*big.Int, participants ParticipantList, threshold int) ([]*big.Int, []*big.Int, [][2]*big.Int, error)
GenerateShares returns encrypted shares, private coefficients, commitments and potentially an error
func InverseArrayForUserCount ¶
InverseArrayForUserCount pre-calculates an inverse array for use by ethereum contracts
func ThresholdForUserCount ¶
ThresholdForUserCount returns the threshold user count and k for successful key generation
func VerifyGroupSigners ¶
func VerifyGroupSigners(initialMessage []byte, masterPublicKey [4]*big.Int, publishedPublicKeys [][4]*big.Int, publishedSignatures [][2]*big.Int, participants ParticipantList, threshold int) (bool, error)
VerifyGroupSigners returns whether the participants are valid or potentially an error
Types ¶
type Participant ¶
Participant contains what we know about other participants, i.e. public information
type ParticipantList ¶
type ParticipantList []*Participant
ParticipantList is a required type alias since the Sort interface is awful
func (ParticipantList) Len ¶
func (pl ParticipantList) Len() int
Len returns the len of the collection
func (ParticipantList) Less ¶
func (pl ParticipantList) Less(i, j int) bool
Less decides if element i is 'Less' than element j -- less ~= before
func (ParticipantList) Swap ¶
func (pl ParticipantList) Swap(i, j int)
Swap swaps elements i and j within the collection