in src/local_gpu_verifier/src/verifier/verifier.py [0:0]
def verify(self, settings):
""" This methods compares the runtime measurement with the golden measurement in order to check if there is any discrepancy.
Args:
settings (config.HopperSettings): the object containing the various config info.
Returns:
[bool]: returns True if all the valid golden measurements values matches with the
corresponding runtime measurements. Otherwise, returns False.
"""
info_log.info("\tComparing measurements (runtime vs golden)")
if len(self.runtime_measurements) == 0:
info_log.warning("\t\t\tWarning : no measurements from attestation report received.")
if len(self.golden_measurements) == 0:
info_log.warning("\t\t\tWarning : no golden measurements from RIMs received.")
# Make sure that active golden measurement are always less than or equal to run time measurement
if len(self.golden_measurements) > len(self.runtime_measurements):
info_log.info("\t\t\tWarning : Golden measurement are more than measurements in Attestation report.")
return False
list_of_mismatched_indexes = list()
for i in self.golden_measurements:
if i == 35 and not self.is_msr_35_valid:
continue
is_matching = False
for j in range(self.golden_measurements[i].get_number_of_alternatives()):
if self.golden_measurements[i].get_value_at_index(j) == self.runtime_measurements[i] and \
self.golden_measurements[i].get_size() == len(self.runtime_measurements[i]) // 2:
is_matching = True
if not is_matching:
# Measurements are not matching.
list_of_mismatched_indexes.append(i)
if len(list_of_mismatched_indexes) > 0:
info_log.info("""\t\t\tThe runtime measurements are not matching with the