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!"); } }  static BigInteger[] generateCoefficients(final int threshold); static BigInteger[] generateCoefficients(final int threshold, final int indexOfZero); static EcPoint[] generateFeldmanValues(final BigInteger[] coefficients); static EcPoint[] generateFeldmanValues(final BigInteger[] coefficients, final EcPoint base); static ShamirShare[] generateShares(final BigInteger[] coefficients, final int n); static void verifyShamirShareConsistency(final ShamirShare share, final EcPoint[] feldmanValues); static EcPoint[] computeSharePublicKeys(final EcPoint[] feldmanValues, final int n); static EcPoint computeSharePublicKey(final EcPoint[] feldmanValues, final int xPosition); final static EcCurve curve; final static BigInteger r; final static EcPoint G; }
@Test public void testVerifyShamirShareConsistency() { fail("Not yet implemented"); }