def generate_aead(hsm, args, password):
try:<EOL><INDENT>pw = password.ljust(args.min_len, chr(<NUM_LIT>))<EOL>return hsm.generate_aead_simple(args.nonce.decode('<STR_LIT>'), args.key_handle, pw)<EOL><DEDENT>except pyhsm.exception.YHSM_CommandFailed as e:<EOL><INDENT>if e.status_str == '<STR_LIT>':<EOL><INDENT>print("<STR_LIT>" % (args.key_handle))<EOL>return None<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>" % (e.reason))<EOL><DEDENT><DEDENT>
Generate an AEAD using the YubiHSM.