A Computer Algorithm for Calculating the Product AB Modulo M