Fix crash when secret is empty and input is nonempty.