We describe a method for exactly diagonalizing clean D-dimensional lattice systems of independent fermions subject to arbitrary boundary conditions in one direction, as well as systems composed of two bulks meeting at a planar interface. The specification of boundary conditions and interfaces can be easily adjusted to describe relaxation, reconstruction, or disorder away from the clean bulk regions of the system. Our diagonalization method builds on the generalized Bloch theorem [A. Alase et al., Phys. Rev. B 96, 195133 (2017)] and the fact that the bulk-boundary separation of the Schrödinger equation is compatible with a partial Fourier transform operation. Bulk equations may display unusual features because they are relative eigenvalue problems for non-Hermitian, bulk-projected Hamiltonians. Nonetheless, they admit a rich symmetry analysis that can simplify considerably the structure of energy eigenstates, often allowing a solution in fully analytical form. We illustrate our extension of the generalized Bloch theorem to multicomponent systems by determining the exact Andreev bound states for a simple SNS junction. We then analyze the Creutz ladder model, by way of a conceptual bridge from one to higher dimensions. Upon introducing a new Gaussian duality transformation that maps the Creutz ladder to a system of two Majorana chains, we show how the model provides a first example of a short-range chiral topological insulators hosting topological zero modes with a power-law profile. Additional applications include the complete analytical diagonalization of graphene ribbons with both zigzag-bearded and armchair boundary conditions, and the analytical determination of the edge modes in a chiral p + ip twodimensional topological superconductor. Lastly, we revisit the phenomenon of Majorana flat bands and anomalous bulk-boundary correspondence in a two-band gapless s-wave topological superconductor. Beside obtaining sharp indicators for the presence of Majorana modes through the use of the boundary matrix, we analyze the equilibrium Josephson response of the system, showing how the presence of Majorana flat bands implies a substantial enhancement in the 4π-periodic supercurrent. arXiv:1808.07555v1 [cond-mat.stat-mech]