A Formal Correspondence between Offensive and Defensive JavaCard Virtual Machines