refactored DH group nonce exchange