Forcing participants to be honest in Secure Multiparty Communication Alice and Bob engage to compute a secure function f(a,b) where a and b must be present in a set U. Although both Alice and Bob know f(a,b), how can Alice confirm that b is present in U and Bob confirm that a is present in U?
Try reading this paper https://www.math.ucla.edu/~tdokos/notes_files/garbledCircuits.pdf. It will answer your question.