code: def card_auth(self, auth_mode, block_address, key, uid):
          
          buf = []
          buf.append(auth_mode)
          buf.append(block_address)
  
          for i in range(len(key)):
              buf.append(key[i])
  
          for i in range(4):
              buf.append(uid[i])
  
          (error, back_data, back_length) = self.card_write(self.mode_auth, buf)
          if not (self.dev_read(0x08) & 0x08) != 0:
              error = True
  
          if not error:
              self.authed = True
  
          return error
docs: Authenticates to use specified block address. Tag must be selected using select_tag(uid) before auth.
          auth_mode -- RFID.auth_a or RFID.auth_b
          key -- list or tuple with six bytes key
          uid -- list or tuple with four bytes tag ID
          Returns error state.