Assume that we know each matrix element $A_{ij}$ of a $n$-qubit matrix $A$, and we are given an $(n+m)$-qubit unitary $U_A$ that we would like to verify is a $(1,m)$-block encoding of $A$. To do this, we need to check that $$\langle 0^m, i | U_A |0^m,j\rangle = \langle i | A | j \rangle = A_{ij}.$$
Now, we can easily prepare the state $U_A|0^m, j\rangle$, but as I understand, it is impossible to design a quantum circuit that computes the inner product of the states, so we cannot take the inner product with $\langle 0^m, i|$, we can only compute the magnitude of the inner product (with, e.g., the SWAP test). So, how can block encoding actually be verified, since it seems like for all we know each entry in the top-left block of $U_A$ has the right magnitude but entirely the wrong phase, leading to a block encoded matrix $A'$ which is far away from $A$.
What I do know, is that if we prepare $U_A|0^m, j\rangle$, measure the first register, and post-select on on $0^m$ as the outcome, the resulting state on the second register is $\propto \sum_i A_{ij}|i\rangle$. I still don't clearly see how this can be used to verify the matrix entries.
