def digests_are_equal(digest1, digest2):
<EOL>securesystemslib.formats.HEX_SCHEMA.check_match(digest1)<EOL>securesystemslib.formats.HEX_SCHEMA.check_match(digest2)<EOL>if len(digest1) != len(digest2):<EOL><INDENT>return False<EOL><DEDENT>are_equal = True<EOL>for element in range(len(digest1)):<EOL><INDENT>if digest1[element] != digest2[element]:<EOL><INDENT>are_equal = False<EOL><DEDENT><DEDENT>return are_equal<EOL>
<Purpose>
  While protecting against timing attacks, compare the hexadecimal arguments
  and determine if they are equal.

<Arguments>
  digest1:
    The first hexadecimal string value to compare.

  digest2:
    The second hexadecimal string value to compare.

<Exceptions>
  securesystemslib.exceptions.FormatError: If the arguments are improperly
  formatted.

<Side Effects>
  None.

<Return>
  Return True if 'digest1' is equal to 'digest2', False otherwise.