示例#1
0
    def compute_cryptographic_checksum(self, p1, p2, data):
        checksum = eac.EAC_authenticate(self.eac_ctx, data)
        if not checksum:
            eac.print_ossl_err()
            raise SwError(SW["ERR_NOINFO69"])

        return checksum
示例#2
0
 def authenticate(self, data):
     """Compute a MAC for block of data using the secret established by the
     PACE protocol. This method can only be used after a successful run of
     eac.
     """
     auth = eac.EAC_authenticate(self.ctx, data)
     if not auth or not eac.EAC_increment_ssc(self.ctx):
         raise PACEException("Failed to compute MAC for: " + data)
     return auth