> If I need to square a value many times in a loop, is using mpz_mul the > fastest way in GMP to achieve this or is there another function that > is better specifically for squaring? mpz_mul (t, r, r) is the best way: it automagically recognizes it is a squaring, and calls the corresponding squaring function. Paul Zimmermann