Privacy Preserving Implementation of the Max-Sum Algorithm and its Variants