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") return nil, errors.New("Public key bit length must be at least 18 bits")
} }
generator := new(ThresholdKeyGenerator) return &ThresholdKeyGenerator{
generator.publicKeyBitLength = publicKeyBitLength publicKeyBitLength: publicKeyBitLength,
generator.TotalNumberOfDecryptionServers = totalNumberOfDecryptionServers TotalNumberOfDecryptionServers: totalNumberOfDecryptionServers,
generator.Threshold = threshold Threshold: threshold,
generator.Random = random Random: random,
return generator, nil }, nil
} }
func (tkg *ThresholdKeyGenerator) generateSafePrimes() (*big.Int, *big.Int, error) { func (tkg *ThresholdKeyGenerator) generateSafePrimes() (*big.Int, *big.Int, error) {