@Override public DRes<AdvancedNumeric.RandomAdditiveMask> buildComputation( ProtocolBuilderNumeric builder) { Numeric numericBuilder = builder.numeric(); bits = new ArrayList<>(); for (int i = 0; i < noOfBits; i++) { DRes<SInt> randomBit = numericBuilder.randomBit(); bits.add(randomBit); } MiscBigIntegerGenerators oIntGenerators = builder.getBigIntegerHelper(); List<BigInteger> twoPows = oIntGenerators.getTwoPowersList(noOfBits); AdvancedNumeric innerProductBuilder = builder.advancedNumeric(); value = innerProductBuilder.innerProductWithPublicPart(twoPows, bits); return () -> new AdvancedNumeric.RandomAdditiveMask( bits, value.out()); } }
BigInteger[] maskedPowers = seq.getBigIntegerHelper().getExpFromOInt(maskedO, maxLength); return () -> new Pair<>(expPipe, maskedPowers); }).par((par, pair) -> { BigInteger[] polynomialCoefficients = seq.getBigIntegerHelper() .getPoly(maxLength); BigInteger[] mostSignificantPolynomialCoefficients = new BigInteger[maxLength];
List<DRes<SInt>> rBottomBits = bits.subList(0, bitLengthBottom); List<BigInteger> twoPowsBottom = seq.getBigIntegerHelper().getTwoPowersList(bitLengthBottom); return Pair.lazy(mask.random, seq.advancedNumeric().innerProductWithPublicPart(twoPowsBottom, rBottomBits)); }, (seq, mask) -> { List<DRes<SInt>> rTopBits = mask.bits.subList(bitLengthBottom, bitLengthBottom + bitLengthTop); List<BigInteger> twoPowsTop = seq.getBigIntegerHelper().getTwoPowersList(bitLengthTop); AdvancedNumeric innerProduct = seq.advancedNumeric();
seq.getBigIntegerHelper().getTwoPowersList(shifts), mask.bits);
seq.getBigIntegerHelper().getTwoPowersList(shifts), mask.bits);