Snapshot spectral imaging enables the acquisition of hyperspectral images (HSI) employing specialized optical systems, such as the coded aperture snapshot spectral imager (CASSI). Specifically, the CASSI system performs spatiospectral codification of light obtaining two-dimensional projected measurements, and these measurements are then processed by computational algorithms to obtain the desired spectral images. However, because HSIs often have a high spatial or spectral resolution, the sensing matrix related to the acquisition protocol becomes very large, leading to a high computational storage cost and long computation times. In this work, we propose an algebraic framework for computing the relevant operations in a tensorial form based on the nature of the codification protocol. We then test our framework against some comparison methods based on linear algebra decomposition, factorization, or block-operations, demonstrating that the proposed method is between 3 and 20 times faster than the best-competing method. Moreover, the gain becomes larger when the matrices become bigger, corresponding to realistic HSI sizes for spectral imaging applications. In extreme cases, our method can still operate when the competing methods stall due to memory shortage.