/** * 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; }