def get_shared_secret(self):
    if (self.B is None):
        raise RuntimeError("Server's public key is missing")
    u = self._calculate_u()
    x = self._calculate_x()
    k = self._calculate_k()
    tmp1 = (self.B - (k * pow(self.g, x, self.n)))
    tmp2 = (self.a + (u * x))
    S = pow(tmp1, tmp2, self.n)
    return S
def get_shared_secret(self):
    if (self.B is None):
        raise RuntimeError("Server's public key is missing")
    u = self._calculate_u()
    x = self._calculate_x()
    k = self._calculate_k()
    tmp1 = (self.B - (k * pow(self.g, x, self.n)))
    tmp2 = (self.a + (u * x))
    S = pow(tmp1, tmp2, self.n)
    return S