def generate_aead(hsm, args):
key = get_oath_k(args)<EOL>flags = struct.pack("<STR_LIT>", <NUM_LIT>)<EOL>hsm.load_secret(key + flags)<EOL>nonce = hsm.get_nonce().nonce<EOL>aead = hsm.generate_aead(nonce, args.key_handle)<EOL>if args.debug:<EOL><INDENT>print("<STR_LIT>" % (aead.data.encode('<STR_LIT>'), aead))<EOL><DEDENT>return nonce, aead<EOL>
Protect the oath-k in an AEAD.