The following persons shall be guilty of primary or enrollment violations: (1) Any person unlawfully voting or participating or attempting to vote or participate in any primary in which he is not eligible to vote or participate; (2) in towns divided into voting districts, any elector who registers or votes at any primary in a voting district other than the district in which such elector is legally