def input_validate_aead(aead, name='<STR_LIT>', expected_len=None, max_aead_len = pyhsm.defines.YSM_AEAD_MAX_SIZE):
if isinstance(aead, pyhsm.aead_cmd.YHSM_GeneratedAEAD):<EOL><INDENT>aead = aead.data<EOL><DEDENT>if expected_len != None:<EOL><INDENT>return input_validate_str(aead, name, exact_len = expected_len)<EOL><DEDENT>else:<EOL><INDENT>return input_validate_str(aead, name, max_len=max_aead_len)<EOL><DEDENT>
Input validation for YHSM_GeneratedAEAD or string.