diff --git a/src/main/java/security/socialistmillionaire/alice.java b/src/main/java/security/socialistmillionaire/alice.java index f8edcd4..99f3269 100644 --- a/src/main/java/security/socialistmillionaire/alice.java +++ b/src/main/java/security/socialistmillionaire/alice.java @@ -204,6 +204,13 @@ public boolean Protocol1(BigInteger x) // Step 1: Get Y bits from Bob Encrypted_Y = get_encrypted_bits(); + BigInteger early_terminate = unequal_bit_check(x, Encrypted_Y); + if (early_terminate.equals(BigInteger.ONE)) { + return true; + } + else if (early_terminate.equals(BigInteger.ZERO)) { + return false; + } // Otherwise, if the bit size is equal, proceed! // Step 2: compute Encrypted X XOR Y