From b21e0d7d9706dffb3fa1072e9a66ac6788f96046 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Mon, 30 Jul 2018 12:27:59 +0200 Subject: [PATCH] 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. --- thresholdkey_generator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thresholdkey_generator.go b/thresholdkey_generator.go index 755745d..96948a0 100644 --- a/thresholdkey_generator.go +++ b/thresholdkey_generator.go @@ -59,7 +59,9 @@ func GetThresholdKeyGenerator(nbits, TotalNumberOfDecryptionServers, Threshold i } 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 {