first half of Diffie-Hellman