private Map<Integer, RotList> getSeedOts(int myId, List<Integer> partyIds, int prgSeedLength, Drbg drbg, Network network) { Map<Integer, RotList> seedOts = new HashMap<>(); for (Integer otherId : partyIds) { if (myId != otherId) { Ot ot = new DummyOt(otherId, network); RotList currentSeedOts = new RotList(drbg, prgSeedLength); if (myId < otherId) { currentSeedOts.send(ot); currentSeedOts.receive(ot); } else { currentSeedOts.receive(ot); currentSeedOts.send(ot); } seedOts.put(otherId, currentSeedOts); } } return seedOts; }
/** * Construct a sending party for an instance of the correlated OT protocol. * * @param resources The common resource pool needed for OT extension * @param network The network interface. Must not be null and must be initialized. */ public CoteSender(OtExtensionResourcePool resources, Network network) { super(resources.getInstanceId()); this.prgs = new ArrayList<>(resources.getComputationalSecurityParameter()); for (StrictBitVector message : resources.getSeedOts().getLearnedMessages()) { // Initialize the PRGs with the random messages prgs.add(initPrg(message)); } otChoices = resources.getSeedOts().getChoices(); this.resources = resources; this.network = network; }
/** * Constructs a correlated OT extension with errors receiver instance. * * @param resources * The common resource pool needed for OT extension * @param network * The network object used to communicate with the other party */ public CoteReceiver(OtExtensionResourcePool resources, Network network) { super(resources.getInstanceId()); this.prgs = new ArrayList<>(resources.getComputationalSecurityParameter()); for (Pair<StrictBitVector, StrictBitVector> pair : resources.getSeedOts() .getSentMessages()) { Drbg prgZero = initPrg(pair.getFirst()); Drbg prgOne = initPrg(pair.getSecond()); prgs.add(new Pair<>(prgZero, prgOne)); } this.resources = resources; this.network = network; }
private Map<Integer, RotList> perPartySingleSeedOtSetup(int myId, Drbg drbg, Network network) { Map<Integer, RotList> seedOts = new HashMap<>(); for (int otherId = 1; otherId <= noOfParties; otherId++) { if (otherId != myId) { Ot ot = new DummyOt(otherId, network); RotList currentSeedOts = new RotList(drbg, mascotSecurityParameters.getPrgSeedLength()); if (myId < otherId) { currentSeedOts.send(ot); currentSeedOts.receive(ot); } else { currentSeedOts.receive(ot); currentSeedOts.send(ot); } seedOts.put(otherId, currentSeedOts); } } return seedOts; }
this.drng = new DrngImpl(drbg); this.supplier = () -> { RotList rotList = new RotList(drbg, computationalSecurity); CoinTossing ct = new CoinTossing(myId, Util.otherPlayerId(myId), drbg); OtExtensionResourcePool otExtRes = new OtExtensionResourcePoolImpl(myId, rotList.send(baseOt); rotList.receive(baseOt); } else { rotList.receive(baseOt); rotList.send(baseOt);