It is legal for two related reasons:1) First and foremost, remember that vesting is in the employer match portion: you are always vested in your own contribution. Therefore, it is logical to calculate from the date the match started.2) Second, remember that there is no obligation to have an employer match at all. The employer has free rein, if they elect to voluntarily have an employer match to set the parameters for it, such as amount of match and years to vest.