The move would need a trebling of the current capacity for initial teacher training, Fiona Hyslop, the SNP's education spokesperson, said in a debate on education.
The ruling coalition parties in the Scottish Executive have pledged to recruit another 3,000 teachers so the class size commitment can be implemented in time for the 2007-08 academic year.
Ms Hyslop said that, with training numbers already fixed for later this year, there are only two years left to hire 1500 teachers per year.
With 900 new teachers required every year to replace those who are leaving, this meant that 2,400 teachers would have to be trained each year for two years - nearly three times the 950 intake to teacher education institutions in the current academic year.
"I am concerned that that will prove to be a real challenge," Ms Hyslop said. "I have not so far heard about any initiatives to accelerate or significantly expand the number of teachers undertaking postgraduate training."
She also pointed out that just 401 maths and English teachers were trained in Scotland last year, 17 per cent of those in initial training, and she feared that the only way the Executive's pledge could be met was to transfer P7 teachers to work in S1 and S2.
"I recognise the need for that," Ms Hyslop said, "but transferring existing teachers from primary to secondary school is not a provision of new teachers, which is what was pledged, agreed to and promoted in the (coalition) partnership agreement."
Winding up the debate, Euan Robson, Deputy Education Minister, disclosed that agreement had already been reached with teacher education institutions to increase intakes. "Teachers will be trained and in place at the right times," Mr Robson promised.
He pointed out that planning teacher numbers, an annual exercise which will report next month, had to take into account not just increases in staffing but the decline in the pupil population.
There is also an expectation that continuing professional development would allow some teachers to move from primary into the early secondary stages.
Some pound;29 million extra would be ploughed in for 2004-05, Mr Robson said, and an additional pound;49 million in 2005-06. The salary costs of the class size commitments in later years will be pound;45 million.
"Yes, the teacher numbers are ambitious," Mr Robson said. "Yes, we recognise the fact that teachers will leave the profession. However, those issues have been factored into our planning and we are on track to deliver."
Mr Robson also gave an assurance that the Executive's pledges would not dilute the quality of teaching and that the General Teaching Council for Scotland would remain responsible for standards of entry.
In an earlier parliamentary answer, however, the Education Minister was less precise. Peter Peacock cited the same costs for restricting S1 and S2 classes to 20 and P1 classes to 25. But this money will be shared with the Spark national information and communications technology project.
Mr Peacock did promise, however, that "the split is heavily weighted in favour of recruiting additional teachers".