diffe hellman key exchange.cpp
// Power function to return value of a ^ b mod P

Power function to return value of a ^ b mod P
Power function to return value of a ^ b mod P
long long int power(long long int a, long long int b,
                                     long long int P)
{
    if (b == 1)
        return a;
    else
        return (((long long int)pow(a, b)) % P);
}
long long int power ( long long int a , long long int b , long long int P ) { if ( b == 1 ) return a ; else return ( ( ( long long int ) pow ( a , b ) ) % P ) ; }
Power function to return value of a ^ b mod P
Power function to return value of a ^ b mod P