The Indian Penal Code, 1860 is repealed. It was replaced by The Bharatiya Nyaya Sanhita, 2023 from 1 July 2024; this provision still applies to matters that arose before then.
Whoever voluntarily has carnal intercourse against the order of nature with any man, woman or animal, shall be punished with [imprisonment for life], or with imprisonment of either description for a term which may extend to ten years, and shall also be liable to fine.
Explanation.—Penetration is sufficient to constitute the carnal intercourse necessary to the offence described in this section.