Fast and Secure Edge-computing Algorithms for Classification Problems