private byte[][] RunObliviousTransferReceiverParty(BitArray selectionBits)
        {
            using (CryptoContext cryptoContext = CryptoContext.CreateDefault())
            {
                using (var session = TestNetworkSession.EstablishTwoParty())
                {
                    ITwoChoicesObliviousTransferChannel           baseOT            = new StatelessTwoChoicesObliviousTransferChannel(new InsecureObliviousTransfer(), session.Channel);
                    ITwoChoicesCorrelatedObliviousTransferChannel obliviousTransfer = new TwoChoicesCorrelatedExtendedObliviousTransferChannel(baseOT, 8, cryptoContext);

                    return(obliviousTransfer.ReceiveAsync(selectionBits, selectionBits.Length, NumberOfMessageBytes).Result);
                }
            }
        }
        private Pair <byte[]>[] RunObliviousTransferSenderParty(byte[][] correlationStrings)
        {
            using (CryptoContext cryptoContext = CryptoContext.CreateDefault())
            {
                using (var session = TestNetworkSession.EstablishTwoParty())
                {
                    ITwoChoicesObliviousTransferChannel           baseOT            = new StatelessTwoChoicesObliviousTransferChannel(new InsecureObliviousTransfer(), session.Channel);
                    ITwoChoicesCorrelatedObliviousTransferChannel obliviousTransfer = new TwoChoicesCorrelatedExtendedObliviousTransferChannel(baseOT, 8, cryptoContext);

                    return(obliviousTransfer.SendAsync(
                               correlationStrings, correlationStrings.Length, NumberOfMessageBytes).Result);
                }
            }
        }
        private Pair <Pair <byte[]>[]> RunResumedObliviousTransferSenderParty(byte[][] firstCorrelationStrings, byte[][] secondCorrelationStrings)
        {
            using (CryptoContext cryptoContext = CryptoContext.CreateDefault())
            {
                using (var session = TestNetworkSession.EstablishTwoParty())
                {
                    ITwoChoicesObliviousTransferChannel           baseOT            = new StatelessTwoChoicesObliviousTransferChannel(new InsecureObliviousTransfer(), session.Channel);
                    ITwoChoicesCorrelatedObliviousTransferChannel obliviousTransfer = new TwoChoicesCorrelatedExtendedObliviousTransferChannel(baseOT, 8, cryptoContext);

                    Pair <byte[]>[] firstRoundResults = obliviousTransfer.SendAsync(
                        firstCorrelationStrings, firstCorrelationStrings.Length, NumberOfMessageBytes).Result;
                    Pair <byte[]>[] secondRoundResults = obliviousTransfer.SendAsync(
                        secondCorrelationStrings, secondCorrelationStrings.Length, NumberOfMessageBytes).Result;
                    return(new Pair <Pair <byte[]>[]>(firstRoundResults, secondRoundResults));
                }
            }
        }