that's for real and complex fields, and it's not exactly that.
I don't think there's anything better than O(n^2) with no conditions
However, yes, there are big differences based on the encoding. Nobody would accept using unary input encoding to artificially inflate the size of the input. It's also why the time-compelixity of prime-testing is sometimes confusing.