Now, Alice has a list of the bit values she sent as well as what basis she prepared each qubit in, and Bob has a list of bases he used to measure each qubit and a list of measurement results. To extract the shared key, they need to figure out when they both used the same basis, keep the data from those steps, and toss the data from steps where they used different bases.

**Inputs:**

1. `basesAlice` and `basesBob`: `Bool` arrays of length $N$ describing Alice's and Bobs's choice of encoding/measurement bases, respectively.
2. `bits`: a `Bool` array of length $N$ describing either the bits Alice sent or Bob's measurement results.

**Output** : A `Bool` array representing the shared key generated by the protocol.

> You don't need to know both Alice's and Bob's bits to figure out the shared key - only one set of bits is enough!
