'Decrypt a PKCS#1 OAEP ciphertext.
This function is named ``RSAES-OAEP-DECRYPT``, and is specified in
section 7.1.2 of RFC3447.
:Parameters:
ct : string
The ciphertext that contains the message to recover.
:Return: A string, the original message.
:Raise ValueError:
If the ciphertext length is incorrect, or if the decryption does not
succeed.
:Raise TypeError:
If the RSA key has no private half.'

def decrypt(self, ct):

    modBits = Crypto.Util.number.size(self._key.n)
    k = ceil_div(modBits, 8)
    hLen = self._hashObj.digest_size
    if ((len(ct) != k) or (k < (hLen + 2))):
        raise ValueError('Ciphertext    with    incorrect    length.')
    m = self._key.decrypt(ct)
    em = ((bchr(0) * (k - len(m))) + m)
    lHash = self._hashObj.new(self._label).digest()
    y = em[0]
    maskedSeed = em[1:(hLen + 1)]
    maskedDB = em[(hLen + 1):]
    seedMask = self._mgf(maskedDB, hLen)
    seed = strxor(maskedSeed, seedMask)
    dbMask = self._mgf(seed, ((k - hLen) - 1))
    db = strxor(maskedDB, dbMask)
    valid = 1
    one = db[hLen:].find(bchr(1))
    lHash1 = db[:hLen]
    if (lHash1 != lHash):
        valid = 0
    if (one < 0):
        valid = 0
    if (bord(y) != 0):
        valid = 0
    if (not valid):
        raise ValueError('Incorrect    decryption.')
    return db[((hLen + one) + 1):]
