Eval computes the public share v = p(i).
(i int)
| 324 | |
| 325 | // Eval computes the public share v = p(i). |
| 326 | func (p *PubPoly) Eval(i int) *PubShare { |
| 327 | xi := p.g.Scalar().SetInt64(1 + int64(i)) // x-coordinate of this share |
| 328 | v := p.g.Point().Null() |
| 329 | for j := p.Threshold() - 1; j >= 0; j-- { |
| 330 | v.Mul(xi, v) |
| 331 | v.Add(v, p.commits[j]) |
| 332 | } |
| 333 | return &PubShare{i, v} |
| 334 | } |
| 335 | |
| 336 | // Shares creates a list of n public commitment shares p(1),...,p(n). |
| 337 | func (p *PubPoly) Shares(n int) []*PubShare { |