Yup. We did the same back in '61 on diesel boats. We blew the Essex (carrier) up six times in one day.
We had an exercise with a carrier group. We had a 3-D box of operation which didn't allow us to go deep or run around. They knew we were there and were active from the ships and sonar bouys. We sneaked in and fired a flare at the carrier, went under it and "disappeard" The exercise was to last for several hours but our part was over in minutes. We just sat outside the carrier group and waited for the "official" time to end.