Switched to GMP for bigint operations