It’s state law, common to all the parties. And yes, NY has the earliest primary registration deadline in the country.
Aside: I’m a New Yorker. I register as a Republican, because for the down-ballot races where I live, the Dems don’t often have a contested primary. The GOP primary is where all the action is. Counting voters registered to any party is misleading, because lots of voters register strategically.
For what it’s worth, I was momentarily tempted to vote for Trump, figuring he’d be the weakest candidate in the general election. But then common sense got the better of me and I marked Kacich (who was the last man standing among Trump’s primary opponents). A whole lot of bad choices there, none of whom I could have borne to vote for in the general.