It sounds to me as if the teacher was giving you a chance to come forward, by indicating the discovery but not telling you yet that they know it was you.
I would ask to meet the teacher asap.
How long ago was it that the teacher indicated that a student had 100% correct answers for the other class’ test?