/** * Computes this party's shares of the final products. <br> For each seed pair (q0, q1) this party * holds, uses q0 to recombine into field elements representing the product shares. * * @param feZeroSeeds the zero choice seeds * @param numRightFactors number of total right factors * @return shares of products */ public List<FieldElement> computeProductShares(List<FieldElement> feZeroSeeds, int numRightFactors) { List<FieldElement> productShares = new ArrayList<>(numRightFactors); for (int rightFactIdx = 0; rightFactIdx < numRightFactors; rightFactIdx++) { int from = rightFactIdx * resourcePool.getModBitLength(); int to = (rightFactIdx + 1) * resourcePool.getModBitLength(); List<FieldElement> subFactors = feZeroSeeds.subList(from, to); FieldElement recombined = fieldElementUtils.recombine(subFactors); productShares.add(recombined.negate()); } return productShares; }
diffIdx++; FieldElement productShare = fieldElementUtils.recombine(summands); result.add(productShare);