def METHOD_NAME(self):
    self._generate_x()
    if self.transport.server_mode:
        # compute f = g^x mod p, but don't send it yet
        self.f = pow(self.G, self.x, self.P)
        self.transport._expect_packet(_MSG_KEXDH_INIT)
        return
    # compute e = g^x mod p (where g=2), and send it
    self.e = pow(self.G, self.x, self.P)
    m = Message()
    m.add_byte(c_MSG_KEXDH_INIT)
    m.add_mpint(self.e)
    self.transport._send_message(m)
    self.transport._expect_packet(_MSG_KEXDH_REPLY)