'Called when we get a MSG_KEX_DH_GEX_INIT message.  Payload::
integer e (client DH public key)
We send the MSG_KEX_DH_GEX_REPLY message with our host key and
signature.
@type packet: L{bytes}
@param packet: The message data.'

def ssh_KEX_DH_GEX_INIT(self, packet):

    (clientDHpublicKey, foo) = getMP(packet)
    pSize = self.p.bit_length()
    y = _getRandomNumber(randbytes.secureRandom, pSize)
    serverDHpublicKey = _MPpow(self.g, y, self.p)
    sharedSecret = _MPpow(clientDHpublicKey, y, self.p)
    h = _kex.getHashProcessor(self.kexAlg)()
    h.update(NS(self.otherVersionString))
    h.update(NS(self.ourVersionString))
    h.update(NS(self.otherKexInitPayload))
    h.update(NS(self.ourKexInitPayload))
    h.update(NS(self.factory.publicKeys[self.keyAlg].blob()))
    h.update(self.dhGexRequest)
    h.update(MP(self.p))
    h.update(MP(self.g))
    h.update(MP(clientDHpublicKey))
    h.update(serverDHpublicKey)
    h.update(sharedSecret)
    exchangeHash = h.digest()
    self.sendPacket(MSG_KEX_DH_GEX_REPLY, ((NS(self.factory.publicKeys[self.keyAlg].blob()) + serverDHpublicKey) + NS(self.factory.privateKeys[self.keyAlg].sign(exchangeHash))))
    self._keySetup(sharedSecret, exchangeHash)
