Ejemplo n.º 1
0
        public static void TestExecution()
        {
            TheBallEKE bobInstance = new TheBallEKE();
            bobInstance.InitiateCurrentSymmetricFromSecret("testsecret2");
            EKEBob bob = new EKEBob(ekeContext: bobInstance);

            TheBallEKE aliceInstance = new TheBallEKE();
            aliceInstance.InitiateCurrentSymmetricFromSecret("testsecret2");
            EKEAlice alice = new EKEAlice(ekeContext: aliceInstance);
            // Hook message senders
            alice.SendMessageToOtherParty = msg =>
                {
                    bob.LatestMessageFromOtherParty = msg;
                };
            bob.SendMessageToOtherParty = msg =>
                {
                    alice.LatestMessageFromOtherParty = msg;
                };
            bool ekeInProgress = true;
            while (ekeInProgress)
            {
                alice.PerformNextAction();
                bob.PerformNextAction();
                ekeInProgress = alice.IsDoneWithProtocol == false || bob.IsDoneWithProtocol == false;
            }
        }