When an offense shall be committed in relation to any election and an indictment for such offense is returned, the allegation of the legality and regularity of such election shall be sufficient if it alleges that such election was authorized by law, without stating the names of the officers holding the election, or the persons voted for, or the offices to be filled at such election.