principles of legality and non-retroactivity of the criminal laws