It is narrated from Sayyiduna Jabir bin Samurah (may Allah be pleased with him) that when we used to pray behind the Messenger of Allah (peace and blessings be upon him), we would say, gesturing with our hands: 'As-salamu alaykum, as-salamu alaykum' (Peace be upon you, peace be upon you). The Messenger of Allah (peace and blessings be upon him) said: "What is the matter with these people who gesture with their hands like this, as though they were the tails of restive horses? Is it not enough for you that a man places his hand on his thigh and after that gives the salam to his brother on his right and on his left?"
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2993