Assume the following:
- $E: \{0, 1\}^k \times \{0, 1\}^b \rightarrow \{0, 1\}^b$ is a block cipher with a $k$-bit key size and a $b$-bit block size.
- $T$ is a $b$-bit authentication tag that is guaranteed to be untampered with (e.g., by being calculated abd stored by a trusted system).
- $X_i$ represents the $i$th of a string of data blocks that $T$ is calculated against.
- $X_i \in \{0, 1\}^b$.
- $K_1$ and $K_2$ are keys that both $k$ bits long.
If $T_i = E(K_1, X_i \oplus E(K_2, i))$ and $T = T_0 \oplus \ldots \oplus T_{n-1}$, then is $T$ secure as a MAC if it's stored by the party who wants to use it to verify some data? If so, can the calculation of $T_i$ be replaced by a difficult-to-reverse public function that takes $X_i$ and $i$ as input while still remaining secure?
I was driven to design this as an improvement on Apple's anti-replay scheme for their Secure Enclave's memory.