Calculation of energy straggling for protons and helium ions