@Override public DRes<SInt> add(DRes<SInt> a, DRes<SInt> b) { SpdzAddProtocol spdzAddProtocol = new SpdzAddProtocol(a, b); return protocolBuilder.append(spdzAddProtocol); }
@Override public DRes<BigInteger> open(DRes<SInt> secretShare) { SpdzOutputToAllProtocol openProtocol = new SpdzOutputToAllProtocol(secretShare); return protocolBuilder.append(openProtocol); }
@Override public DRes<BigInteger> open(DRes<SInt> secretShare, int outputParty) { DummyArithmeticOpenProtocol c = new DummyArithmeticOpenProtocol(secretShare, outputParty); return builder.append(c); }
@Override public DRes<BigInteger> open(DRes<SInt> secretShare, int outputParty) { return builder.append(new Spdz2kOutputSinglePartyProtocol<>(secretShare, outputParty)); } };
@Override public PreprocessedValues createPreprocessedValues(ProtocolBuilderNumeric protocolBuilder) { return pipeLength -> { SpdzExponentiationPipeProtocol spdzExpPipeProtocol = new SpdzExponentiationPipeProtocol(pipeLength); return protocolBuilder.append(spdzExpPipeProtocol); }; }
@Override public DRes<SInt> mult(BigInteger a, DRes<SInt> b) { SpdzMultProtocolKnownLeft spdzMultProtocol4 = new SpdzMultProtocolKnownLeft(a, b); return protocolBuilder.append(spdzMultProtocol4); }
@Override public DRes<BigInteger> open(DRes<SInt> secretShare) { DummyArithmeticOpenToAllProtocol c = new DummyArithmeticOpenToAllProtocol(secretShare); return builder.append(c); }
@Override public DRes<SInt> add(DRes<SInt> a, DRes<SInt> b) { DummyArithmeticAddProtocol c = new DummyArithmeticAddProtocol(a, b); return builder.append(c); } };
@Override public DRes<SInt> input(BigInteger value, int inputParty) { SpdzInputProtocol protocol = new SpdzInputProtocol(value, inputParty); return protocolBuilder.append(protocol); }
@Override public DRes<SInt> sub(BigInteger a, DRes<SInt> b) { SpdzSubtractProtocolKnownLeft spdzSubtractProtocolKnownLeft = new SpdzSubtractProtocolKnownLeft(a, b); return protocolBuilder.append(spdzSubtractProtocolKnownLeft); }
@Override public DRes<SInt> sub(BigInteger a, DRes<SInt> b) { DummyArithmeticSubtractProtocol c = new DummyArithmeticSubtractProtocol(() -> createSIntFromConstant(a), b); return builder.append(c); }
@Override public DRes<SInt> sub(DRes<SInt> a, BigInteger b) { DummyArithmeticNativeProtocol<SInt> c = new DummyArithmeticSubtractProtocol(a, () -> createSIntFromConstant(b)); return builder.append(c); }
@Override public DRes<SInt> sub(DRes<SInt> a, BigInteger b) { SpdzSubtractProtocolKnownRight spdzSubtractProtocolKnownRight = new SpdzSubtractProtocolKnownRight(a, b); return protocolBuilder.append(spdzSubtractProtocolKnownRight); }
@Override public DRes<SInt> sub(DRes<SInt> a, DRes<SInt> b) { SpdzSubtractProtocol spdzSubtractProtocol = new SpdzSubtractProtocol(a, b); return protocolBuilder.append(spdzSubtractProtocol); }
@Override public DRes<BigInteger> open(DRes<SInt> secretShare) { SpdzOutputToAllProtocol openProtocol = new SpdzOutputToAllProtocol(secretShare); return protocolBuilder.append(openProtocol); }
@Override public DRes<SInt> add(BigInteger a, DRes<SInt> b) { SpdzAddProtocolKnownLeft spdzAddProtocolKnownLeft = new SpdzAddProtocolKnownLeft(a, b); return protocolBuilder.append(spdzAddProtocolKnownLeft); }
@Override public DRes<SInt> sub(BigInteger a, DRes<SInt> b) { SpdzSubtractProtocolKnownLeft spdzSubtractProtocolKnownLeft = new SpdzSubtractProtocolKnownLeft(a, b); return protocolBuilder.append(spdzSubtractProtocolKnownLeft); }
@Override public DRes<SInt> mult(BigInteger a, DRes<SInt> b) { SpdzMultProtocolKnownLeft spdzMultProtocol4 = new SpdzMultProtocolKnownLeft(a, b); return protocolBuilder.append(spdzMultProtocol4); }
@Override public DRes<SInt> input(BigInteger value, int inputParty) { FieldElement open = value != null ? basicNumericContext.getFieldDefinition().createElement(value) : null; DummyArithmeticCloseProtocol c = new DummyArithmeticCloseProtocol(open, inputParty); return builder.append(c); }
@Override public DRes<List<byte[]>> buildComputation(ProtocolBuilderNumeric builder) { HashBasedCommitment ownCommitment = new HashBasedCommitment(); byte[] ownOpening = ownCommitment.commit(localDrbg, value); return builder.seq(new BroadcastComputation<>(commitmentSerializer.serialize(ownCommitment))) .seq((seq, rawCommitments) -> { DRes<List<byte[]>> openingsDRes = seq.append(new InsecureBroadcastProtocol<>(ownOpening)); List<HashBasedCommitment> commitments = commitmentSerializer .deserializeList(rawCommitments); return () -> open(commitments, openingsDRes.out(), noOfParties); }); }