in cvm-attestation/src/ReportParser.py [0:0]
def extract_runtimes_data(report):
"""
Extract the the runtimes data from the HCL report blob
Parameters:
report (bytes): The HCL report blob.
Returns:
bytes: The runtimes data bytes
"""
data_size_bytes = []
# extract bytes of the runtime data size to know its length
for t in range(RUNTIME_DATA_SIZE_OFFSET, RUNTIME_DATA_SIZE_OFFSET + 4):
data_size_bytes.append(report[t])
data_size = int.from_bytes(bytes(data_size_bytes), byteorder='little', signed=False)
runtimes_data_bytes = []
# extract bytes of the runtime data
for i in range(RUNTIME_DATA_OFFSET, RUNTIME_DATA_OFFSET + data_size):
runtimes_data_bytes.append(report[i])
return bytes(runtimes_data_bytes)