Mod division
static BigInt mod(BigInt a, [BigInt? b]) { b ??= P; final r = a % b; if (r >= BigInt.zero) { return r; } return b + r; }