Catalyzes two sequential steps of tetrahydrofolate biosynthesis, the conversion of 7,8-dihydroneopterin to 6-hydroxymethyl-7,8-dihydropterin diphosphate. 7,8-dihydroneopterin = 6-hydroxymethyl-7,8-dihydropterin + glycolaldehyde 6-hydroxymethyl-7,8-dihydropterin + ATP = (7,8-dihydropterin-6-yl)methyl diphosphate + AMP + H(+) Cofactor biosynthesis; tetrahydrofolate biosynthesis; 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine diphosphate from 7,8-dihydroneopterin triphosphate: step 3/4. Cofactor biosynthesis; tetrahydrofolate biosynthesis; 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine diphosphate from 7,8-dihydroneopterin triphosphate: step 4/4. Homooctamer. In the N-terminal section; belongs to the DHNA family. In the C-terminal section; belongs to the HPPK family.