ECDH implementation with a smaller memoryfoorptint