@Override public DRes<SBool> and(DRes<SBool> left, DRes<SBool> right) { TinyTablesANDProtocol p = new TinyTablesANDProtocol(getNextId(), left, right); builder.append(p); return p; } };
@Override public DRes<SBool> xor(DRes<SBool> left, DRes<SBool> right) { TinyTablesPreproXORProtocol p = new TinyTablesPreproXORProtocol(left, right); builder.append(p); return p; }
@Override public DRes<Boolean> open(DRes<SBool> secretShare, int outputParty) { DummyBooleanOpenProtocol c = new DummyBooleanOpenProtocol(secretShare, outputParty); builder.append(c); return c; }
@Override public DRes<SBool> input(boolean in, int inputter) { TinyTablesPreproCloseProtocol p = new TinyTablesPreproCloseProtocol(getNextId(), inputter); builder.append(p); return p; }
@Override public DRes<Boolean> open(DRes<SBool> secretShare) { DummyBooleanOpenProtocol c = new DummyBooleanOpenProtocol(secretShare); builder.append(c); return c; }
@Override public DRes<SBool> not(DRes<SBool> a) { DummyBooleanNotProtocol c = new DummyBooleanNotProtocol(a); builder.append(c); return c; } };
@Override public DRes<SBool> not(DRes<SBool> in) { TinyTablesPreproNOTProtocol p = new TinyTablesPreproNOTProtocol(in); builder.append(p); return p; }
@Override public DRes<SBool> xor(DRes<SBool> left, DRes<SBool> right) { TinyTablesXORProtocol p = new TinyTablesXORProtocol(left, right); builder.append(p); return p; }
@Override public DRes<SBool> not(DRes<SBool> in) { TinyTablesNOTProtocol p = new TinyTablesNOTProtocol(in); builder.append(p); return p; }
@Override public DRes<SBool> input(boolean value, int inputParty) { DummyBooleanCloseProtocol c = new DummyBooleanCloseProtocol(inputParty, () -> value); builder.append(c); return c; }
@Override public DRes<SBool> xor(DRes<SBool> a, DRes<SBool> b) { DummyBooleanXorProtocol c = new DummyBooleanXorProtocol(a, b); builder.append(c); return c; }
@Override public DRes<SBool> and(DRes<SBool> left, DRes<SBool> right) { TinyTablesPreproANDProtocol p = new TinyTablesPreproANDProtocol(getNextId(), left, right); builder.append(p); return p; } };
@Override public DRes<Boolean> open(DRes<SBool> toOpen) { TinyTablesOpenToAllProtocol p = new TinyTablesOpenToAllProtocol(getNextId(), toOpen); builder.append(p); return p; }
@Override public DRes<SBool> input(boolean in, int inputter) { TinyTablesCloseProtocol p = new TinyTablesCloseProtocol(getNextId(), inputter, in); builder.append(p); return p; }
@Override public DRes<SBool> and(DRes<SBool> a, DRes<SBool> b) { DummyBooleanAndProtocol c = new DummyBooleanAndProtocol(a, b); builder.append(c); return c; }
@Override public DRes<Boolean> open(DRes<SBool> toOpen) { TinyTablesPreproOpenToAllProtocol p = new TinyTablesPreproOpenToAllProtocol(getNextId(), toOpen); builder.append(p); // Always return false - preprocessing cannot compute output. return () -> false; }
@Override public DRes<SBool> randomBit() { DummyBooleanNativeProtocol<SBool> c = new DummyBooleanNativeProtocol<SBool>() { DummyBooleanSBool bit; @Override public EvaluationStatus evaluate(int round, ResourcePool resourcePool, Network network) { bit = new DummyBooleanSBool(rand.nextBoolean()); return EvaluationStatus.IS_DONE; } @Override public SBool out() { return bit; } }; builder.append(c); return c; }