Quantum mechanical calculation of giant magnetoresistance in layered magnetic films