Ah I see --- it should returns any factor. Well, if we use the trial division, then `f` is always a prime. So I think if we use ECM, we should simply make sure that what it returns is a prime.