class Shamir {

	public static void verifyShamirShareConsistency(final ShamirShare share, final EcPoint[] feldmanValues)
			throws IllegalArgumentException {

		final EcPoint expected = curve.multiply(G, share.getY());

		final EcPoint sum = computeSharePublicKey(feldmanValues, share.getX().intValue());

		if (!expected.equals(sum)) {
			throw new IllegalArgumentException("Invalid share received!");
		}
	}

}