Self-consistent theory of the Darrieus–Landau and Rayleigh–Taylor instabilities with self-generated magnetic fields