Theory of shock magnetization of asteroids Gaspra and Ida