in cvm-attestation/src/ReportParser.py [0:0]
def extract_hw_report(report):
"""
Extract the the hardware report blob from the HCL report blob
Parameters:
report (bytes): The HCL report blob.
Returns:
bytes: The hardware report blob bytes
"""
list = []
hw_report_size = 0
report_type = ReportParser.extract_report_type(report)
if report_type == 'tdx':
hw_report_size = TD_REPORT_SIZE
elif report_type == 'snp':
hw_report_size = SNP_REPORT_SIZE
for i in range(HW_REPORT_START, HW_REPORT_START + hw_report_size):
list.append(report[i])
return bytes(list)