Create and return ThresholdKeyGenerator in one shot.

This commit is contained in:
Piotr Dyraga committed 2018-08-08 13:16:25 +02:00
1 parent 0d2a123af7
commit 51b5bac262
1 file changed
+6 -6
+6 -6
View File
@@ -69,12 +69,12 @@ func GetThresholdKeyGenerator(
return nil, errors.New("Public key bit length must be at least 18 bits")
}
generator := new(ThresholdKeyGenerator)
generator.publicKeyBitLength = publicKeyBitLength
generator.TotalNumberOfDecryptionServers = totalNumberOfDecryptionServers
generator.Threshold = threshold
generator.Random = random
return generator, nil
return &ThresholdKeyGenerator{
publicKeyBitLength: publicKeyBitLength,
TotalNumberOfDecryptionServers: totalNumberOfDecryptionServers,
Threshold: threshold,
Random: random,
}, nil
}
func (tkg *ThresholdKeyGenerator) generateSafePrimes() (*big.Int, *big.Int, error) {