From 92c3842e5f11139e0c972ebc060e7b69b7028c76 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Fri, 25 May 2018 15:05:09 +0200 Subject: [PATCH] Improved documentation for a secret share computation fn --- thresholdkey_generator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thresholdkey_generator.go b/thresholdkey_generator.go index 3d9a44f..3260277 100644 --- a/thresholdkey_generator.go +++ b/thresholdkey_generator.go @@ -171,12 +171,13 @@ func (this *ThresholdKeyGenerator) generateHidingPolynomial() error { return nil } -// The secred share of the i'th authority is `f(i)`, where `f` is +// The secred share of the i'th authority is `f(i) mod nm`, where `f` is // the polynomial we generated in `GenerateHidingPolynomial` function. func (this *ThresholdKeyGenerator) computeShare(index int) *big.Int { share := big.NewInt(0) for i := 0; i < this.Threshold; i++ { a := this.polynomialCoefficients[i] + // we index authorities from 1, that's why we do index+1 here b := new(big.Int).Exp(big.NewInt(int64(index+1)), big.NewInt(int64(i)), nil) tmp := new(big.Int).Mul(a, b) share = new(big.Int).Add(share, tmp)