add mode 1 key generation