A search for CP violation in D^{0}→K^{-}K^{+} and D^{0}→π^{-}π^{+} decays is performed using pp collision data, corresponding to an integrated luminosity of 3 fb^{-1}, collected using the LHCb detector at center-of-mass energies of 7 and 8 TeV. The flavor of the charm meson is inferred from the charge of the pion in D^{*+}→D^{0}π^{+} and D^{*-}→D[over ¯]^{0}π^{-} decays. The difference between the CP asymmetries in D^{0}→K^{-}K^{+} and D^{0}→π^{-}π^{+} decays, ΔA_{CP}≡A_{CP}(K^{-}K^{+})-A_{CP}(π^{-}π^{+}), is measured to be [-0.10±0.08(stat)±0.03(syst)]%. This is the most precise measurement of a time-integrated CP asymmetry in the charm sector from a single experiment.