C++ implementation of Diffie Hellman