In this question, we'll introduce OAEP, which is Optimal Asymmetric Encryption Padding,
OAEP is a padding scheme for use with RSA.
It provides stronger assurances than the PKCS#1 scheme.
In OAEP, we use two functions--
G, which is a hash function outputting g bits,
and H, which is another hash function outputting h bits.
We also have r, a random nonce of g bits.
We then take our message m and append to it 0's
such that the length of m' is g.
We then calculate x by concatenating two parts,
First part is our message XORed with the output of the hash of r.
The second part is r XORed with the hash of the first part.
We then encrypt x using RSA and send off our message.
For this assignment, you've been given a ciphertext, which was encrypted
using OAEP and RSA, using the given encrypt function.
Your task is to decrypt the ciphertext and put your answer into the plaintext variable.
