class PublicSharing implements Serializable {

	public boolean verifyShare(final int shareIndex, final PaillierPublicKey encryptionKey) {

		// Get the corresponding share to validate
		final BigInteger encryptedShare1 = this.encryptedShares1[shareIndex];
		final BigInteger encryptedShare2 = this.encryptedShares2[shareIndex];

		// Use the Pedersen commitments to determine g^share_i using polynomial
		// evaluation "in the exponent"
		final BigInteger xPosition = BigInteger.valueOf(shareIndex + 1);
		final EcPoint shareCommitment = PublicSharingGenerator.interpolatePedersonCommitments(xPosition,
				this.pedersenCommitments);

		// Check the proof
		final PedersenEqRangeProof proof = this.proofs[shareIndex];
		return PedersenEqRangeProofVerifier.isValid(proof, encryptedShare1, encryptedShare2, shareCommitment,
				encryptionKey);
	}

	public  PublicSharing(final EcPoint[] pedersenCommitments, final BigInteger[] encryptedShares1,
			final BigInteger[] encryptedShares2, final PedersenEqRangeProof[] proofs);

}