'This handles different messages which share an integer value.
If the key exchange does not have a fixed prime/generator group,
we generate a Diffie-Hellman public key and send it in a
MSG_KEX_DH_GEX_INIT message.
Payload::
string g (group generator)
string p (group prime)
@type packet: L{bytes}
@param packet: The message data.'

def ssh_KEX_DH_GEX_GROUP(self, packet):

    if _kex.isFixedGroup(self.kexAlg):
        return self._ssh_KEXDH_REPLY(packet)
    elif _kex.isEllipticCurve(self.kexAlg):
        return self._ssh_KEX_ECDH_REPLY(packet)
    else:
        (self.p, rest) = getMP(packet)
        (self.g, rest) = getMP(rest)
        self.x = _generateX(randbytes.secureRandom, 320)
        self.e = _MPpow(self.g, self.x, self.p)
        self.sendPacket(MSG_KEX_DH_GEX_INIT, self.e)
