Fix error in the loop of ECDH