An efficient framework for privacy-preserving computations on encrypted IoT data