Efficiently Masking Polynomial Inversion at Arbitrary Order