def parse_result(self, data):
<EOL>nonce,key_handle,self.status,num_bytes = struct.unpack_from("<STR_LIT>" % (pyhsm.defines.YSM_AEAD_NONCE_SIZE), data, <NUM_LIT:0>)<EOL>pyhsm.util.validate_cmd_response_hex('<STR_LIT>', key_handle, self.key_handle)<EOL>if self.status == pyhsm.defines.YSM_STATUS_OK:<EOL><INDENT>pyhsm.util.validate_cmd_response_nonce(nonce, self.nonce)<EOL>offset = pyhsm.defines.YSM_AEAD_NONCE_SIZE + <NUM_LIT:6><EOL>aead = data[offset:offset + num_bytes]<EOL>self.response = YHSM_GeneratedAEAD(nonce, key_handle, aead)<EOL>return self.response<EOL><DEDENT>else:<EOL><INDENT>raise pyhsm.exception.YHSM_CommandFailed(pyhsm.defines.cmd2str(self.command), self.status)<EOL><DEDENT>
Returns a YHSM_GeneratedAEAD instance, or throws pyhsm.exception.YHSM_CommandFailed.