Privacy and integrity preserving computation in distributed systems