class Shamir {

	public static ShamirShare[] generateShares(final BigInteger[] coefficients, final int n) {

		// Evaluate the polynomial from 1 to n (must not evaluate at zero!)
		ShamirShare[] shares = new ShamirShare[n];
		for (int i = 0; i < n; i++) {
			final BigInteger xCoord = BigInteger.valueOf(i + 1);
			shares[i] = Polynomials.evaluatePolynomial(coefficients, xCoord, r);
		}

		return shares;
	}

}