def dh_shared_key(key, b):
 (p, _, x) = key
 if ((1 >= b) or (b >= p)):
  raise ValueError(filldedent(('\n            Value of b should be greater 1 and less\n            than prime %s.' % p)))
 return pow(x, b, p)

def dh_shared_key ( key , b ) : ( p , _ , x ) = key if ( ( 1 >= b ) or ( b >= p ) ) : raise ValueError ( filldedent ( ( '\n            Value of b should be greater 1 and less\n            than prime %s.' % p ) ) ) return pow ( x , b , p )
return an integer that is the shared key .