This blog post gives a comprehensive overview of constructing efficient comparison-based circuits using Homomorphic Encryption Schemes, right from the basic mathematics that goes behind constructing such primitives to understanding how practical these schemes are.