Garbled circuit is a cryptography protocol that facilitates secured function evalutation (SFE). This site demonstrates the basics of it and can be used for SFE in limited scenarios (semi-trusted).
See Demo in WebAssembly.
make -j4
./bin/garble --alice 1 # 0~3
./bin/garble --bob 2 # 0~3
# Should evaluate to min(1, 2) = 1