func (p *polynomial) evaluate(x uint8) uint8 {
	if x == 0 {
		return p.coefficients[0]
	}
	degree := len(p.coefficients) - 1
	out := p.coefficients[degree]
	for i := degree - 1; i >= 0; i-- {
		coeff := p.coefficients[i]
		out = add(mult(out, x), coeff)
	}
	return out
}
evaluate returns the value of the polynomial for the given x
package shamir
import (
	"crypto/rand"
	"crypto/subtle"
	"fmt"
)
const (
	ShareOverhead = 1
)
type polynomial struct {
	coefficients []uint8
}
func makePolynomial(intercept, degree uint8) (polynomial, error) {
	p := polynomial{
		coefficients: make([]byte, degree+1),
	}
	p.coefficients[0] = intercept
	if _, err := rand.Read(p.coefficients[1:]); err != nil {
		return p, err
	}
	return p, nil
}