Sheth-Tormen mass function has been widely used to quantify the abundance of dark matter halos. It is a significant improvement over the Press-Schechter mass function as it uses ellipsoidal collapse in place of spherical collapse. Both of these mass functions can be written in a form that is universal, i.e., independent of cosmology and power spectrum when scaled in suitable variables. However, cosmological simulations have shown that this universality is approximate. In this work, we investigate the power spectrum dependence of halo mass function through a suite of dark-matter-only N-body simulations of seven power-law models in an Einstein-de-Sitter cosmology. This choice of cosmology and a power-law power spectrum ensures the self-similar evolution of dark matter distribution, allowing us to isolate the power spectrum dependence of mass function. We find that the mass function shows a clear non-universality. We present fits for the parameters of the Sheth-Tormen mass function for a range of power-law power-spectrum indices. We find a mild evolution in the overall shape of the mass function with the epoch. Finally, we extend our result to LCDM cosmology. We show that the Sheth-Tormen mass function with parameter values derived from a matched power-law EdS cosmology provides a better fit to the LCDM mass function than the standard Sheth-Tormen mass function. Our results indicate that an improved analytical theory is required to provide better fits to the mass function.