Name parameters for the safe prime generator call

`4` and `120*time.Seconds` were just some magic numbers in the code.
We decided to move them to separate value declarations to make the
code more self-explanatory.
This commit is contained in:
Piotr Dyraga committed 2018-07-30 12:27:59 +02:00
1 parent 530e40c1d4
commit b21e0d7d97
1 file changed
+3 -1
+3 -1
View File
@@ -59,7 +59,9 @@ func GetThresholdKeyGenerator(nbits, TotalNumberOfDecryptionServers, Threshold i
} }
func (tkg *ThresholdKeyGenerator) generateSafePrimes() (*big.Int, *big.Int, error) { func (tkg *ThresholdKeyGenerator) generateSafePrimes() (*big.Int, *big.Int, error) {
return GenerateSafePrime(tkg.nbits, 4, 120*time.Second, tkg.Random) concurrencyLevel := 4
timeout := 120 * time.Second
return GenerateSafePrime(tkg.nbits, concurrencyLevel, timeout, tkg.Random)
} }
func (tkg *ThresholdKeyGenerator) initPandP1() error { func (tkg *ThresholdKeyGenerator) initPandP1() error {