Key should be smaller than n, not p.